当前位置:网站首页>Electronic scale weighing system design, hx711 pressure sensor, 51 single chip microcomputer (proteus simulation, C program, schematic diagram, thesis and other complete data)

Electronic scale weighing system design, hx711 pressure sensor, 51 single chip microcomputer (proteus simulation, C program, schematic diagram, thesis and other complete data)

2022-04-23 14:23:00 Jiang Yuzhi

The design requirements
1. The system can realize the basic weighing function of the electronic scale ( The weighing range is 0~10Kg, The weight error shall not be greater than ±0.005Kg);
2. The system shall have keyboard input function , Display weight , The function of calculating the total price ;
3. The unit of unit price and total price is yuan , The maximum amount is 999.99 element , The amount error shall not be greater than 0.01 element ;
4. The system is out of the maximum measurement range 10Kg when , With alarm indication function ( Buzzer 、LED Warning light );
5. The electronic scale is designed with both peeling function and weight calibration function ;

Design Overview
The electronic scale system is mainly composed of the minimum system of single chip microcomputer 、 data acquisition system 、 Human computer interface system 、 The alarm system consists of five parts .

The minimum system of single chip microcomputer mainly includes AT89C51 And classic reset circuit ; The data acquisition part consists of a load cell 、 Signal amplification and A/D The conversion part consists of , Signal amplification and A/D The conversion part is mainly composed of special-purpose high-precision 24 position AD Conversion chip HX711 Realization .

The human-computer interaction interface is keyboard input and dot matrix liquid crystal display , The main use of 4*4 Matrix keyboard and 1602 Liquid crystal display , It can input data conveniently and display data intuitively ; The alarm system consists of buzzer and LED The lamp consists of .
 Insert picture description here
Simulation circuit diagram
 Insert picture description here
 Insert picture description here
Schematic diagram of electronic scale
 Insert picture description here
Analysis of simulation results
open Proteus Simulation file , Its suffix is DSN. Double click the MCU , load main.hex file ( Position in : MCU loading file ); then , double-click HX711 chip , load HX711.hex file ( Position in :HX711 Module load file ).
 Insert picture description here
Click on Proteus Run button in the lower left corner of the software , Run the simulation .LCD1602 Liquid crystal display (LCD) :Welcom to Use Electronic Scale.
 Insert picture description here
Then , After a prompt tone , Red LED The light is on ,LCD Display weight 、 Unit price and total price , All values are 0. here , The system is waiting for the goods to be weighed .

LCD According to the 3 The parameters are :WE(Weight, Abbreviation for weight )、PR(Price, Abbreviation for unit price ) and MONEY( Indicates the total price ).
 Insert picture description here
Press down ‘ weight +’ or ‘ weight -’ key , Simulate cargo weighing , The weighing range is :0~10Kg. If the weight is greater than 10Kg, Overweight alarm , The buzzer beeps , Red LED flashing ,LCD in WE Show :-.–.
 Insert picture description here
 Insert picture description here
Enter the unit price through the matrix keyboard (PR), The maximum input unit price is 99.9, You can enter a decimal point , The unit price is set to the nearest corner . Such as input 5.4 element , Enter the number key 5、 Dot keys and number keys 4 that will do .

Unit price input completed , Automatically display the total price (MONEY), The total price is accurate to the decimal point 1 position ; The maximum total price is 999 element , Greater than this value ,LCD Show ‘-.–’ Indicates that the display range is exceeded .
 Insert picture description here
 Insert picture description here
This simulation design has calibration function , adopt ‘ calibration +’ and ‘ calibration -’ Two keys , It can be used in a small range ( Press down 1 Time , The weight display changes 0.001Kg) Calibrate the weight of the goods displayed on the scale . for example , Put the weight by 3.576Kg Calibrated as 3.574Kg.
 Insert picture description here
After weighing the goods , Click on ‘ eliminate ’ key , Clear the unit price and total price , Click on ‘ peel ’ Key to clear the weight display , Note that the peeling key has the function of clearing the weight display ; Then you can weigh next time .
 Insert picture description here
Simulate peeling function
First, press ‘ weight +’/‘ weight -’ key , Simulate the weight of a basket or box , When this weight is set , Press down ‘ peel ’ key , At this time, the weight display is cleared .

for example , Press down ‘ weight +’ key , Set basket weight 1.083Kg, And then click ‘ peel ’ key ,WE The display is cleared .
 Insert picture description here
 Insert picture description here
After peeling , Press again ‘ weight +’ Simulate the net weight of the goods 4.880Kg, then , Enter the unit price 3.0 element , The total price 14.06 element .
 Insert picture description here
Press again ‘ peel ’ key , here WE Displays the net weight of the goods plus the weight of the basket , The total price also calculates the part of the basket , Press again ‘ peel ’ key , The weight is cleared .
 Insert picture description here
part C Code

void main()
{
    
	init_eeprom();  // Start initializing the saved data 
	Init_LCD1602();									// initialization LCD1602
   EA = 0;
   Data_Init();
   Timer0_Init();
   // The beginning of junior high school , Disconnect 
   EA = 1;
	
// Get_Maopi();
	LCD1602_write_com(0x80);						// Pointer setting 
   LCD1602_write_word(" Welcome To Use ");	// 
   LCD1602_write_com(0x80+0x40);						// Pointer setting 
   LCD1602_write_word("Electronic Scale");
// Delay_ms(2000);
   Get_Maopi();
   LCD1602_write_com(0x80);						// Pointer setting 
   LCD1602_write_word("WE:0.000 PR:00.0");
   LCD1602_write_com(0x80+0x40);				// Pointer setting 
   LCD1602_write_word("MONEY: 0.00 ");
   Display_Price();
// Get_Maopi(); // Weigh the fur 

	while(1)
	{
    
// Every time 0.5 Weigh once a second 
	  if (FlagTest==1)
		{
    
			Get_Weight();
			FlagTest = 0;
		}			
	  	
	  keycode = Getkeyboard();
	  // Valid key values 0-15
	  if (keycode<16)
	  {
    
		 KeyPress(keycode);
		 Buzzer=0;
		 Delay_ms(100);
		 Buzzer=1;
		 while(keycode<16)
		 {
    
			if(keycode==12||keycode==13)
			{
    
				Buzzer=0;
				 Delay_ms(10);
				 Buzzer=1;
				 KeyPress(keycode);
				 Get_Weight();
				 flag_key=1;
			}
			keycode = Getkeyboard();
		 }
		 write_eeprom();			   // Save the data 
	  }
	}
}
//****************************************************
// Weigh 
//****************************************************
void Get_Weight()
{
    
	Weight_Shiwu = HX711_Read();
	Weight_Shiwu = Weight_Shiwu - Weight_Maopi;		// Get the net weight 
	
	Weight_Shiwu = (unsigned int)((float)Weight_Shiwu*10/GapValue)-qupi; 	// Calculate the actual weight of the object  
	if(Weight_Shiwu > 10000)		// Overweight alarm 
	{
    
		Buzzer = !Buzzer;	
		LED=!LED;
		LCD1602_write_com(0x83);
	   LCD1602_write_word("-.---");
	}
	else
	{
    
		if(Weight_Shiwu==0)
		LED=1;
		else if(Weight_Shiwu>0)
		LED=0; 
		Buzzer = 1;
		Display_Weight();
		money = Weight_Shiwu*price/1000;  //money In minutes 
	       // Show total amount 
	       Display_Money();
	}
}

//****************************************************
// Get fur weight 
//****************************************************
void Get_Maopi()
{
    
	unsigned char clear;
mm:	Weight_Maopi_0 = HX711_Read();
	for(clear=0;clear<10;clear++)
	{
    
		Buzzer=1;
		LED=1;
		Delay_ms(100);
		LED=0;
		Delay_ms(100);	
	}
	Weight_Maopi = HX711_Read();
	if(Weight_Maopi/GapValue!=Weight_Maopi_0/GapValue)
	goto mm;
	Buzzer=0;
	Delay_ms(500);
	Buzzer=1;
} 

The shared resources are
(1) be based on 51 SCM and HX711 The electronic scale system design of pressure sensor is completed, and the complete version of the paper is ;
(2)Proteus Simulation file ;
(3)Keil C Program files ;
(4)HX711 Module information ;
(5)Visio flow chart ;
(6) Schematic diagram of electronic scale ;
(7) List of electronic components ;
(8) Excellent literature translation ;

The full set of resources is as follows
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
Important things are to be repeated for 3 times !

Important things are to be repeated for 3 times !

Important things are to be repeated for 3 times !

Get the graduation thesis of electronic scale design 、Proteus Simulation 、C Program 、 Schematic diagram 、Visio flow chart 、 List of components 、HX711 A complete set of information such as modules .

Please search WeChat for official account : Jiaoyuan Xiaozhi

版权声明
本文为[Jiang Yuzhi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231412472284.html