[Graduation project] 6-Electronic weighing device based on 51 single-chip microcomputer_electronic temperature measurement_pressure test control system design (schematic diagram + source code + simulation project + answer essay + answer PPT)

[Graduation project] 6-Design of electronic weighing device/electronic temperature measurement/pressure test control system based on 51 single-chip microcomputer (schematic diagram + source code + simulation engineering + paper + PPT)

mission statement

Main research content:
Design an electronic weighing device based on 51 single-chip microcomputer, which is mainly composed of 51 single-chip microcomputer, sensor, A/D converter, power supply, keyboard, LCD, LED display and other experimental equipment. Object weight and overweight alarm. The design mainly uses C language for programming to realize all the control functions of this design.
Research methods and requirements:
According to the requirements, this program is divided into three parts: data acquisition module, controller module and LCD display module. In these three parts, the digital signal converted by the data acquisition module needs three conversion processes: signal preprocessing, pressure sensor and A/D transmission to the pressure sensor, and then the drive display module will display the data after processing . These functions are almost all controlled by software, and only a small part does not need to be controlled by software.
Data link
Schematic project file
Project source code project file
Simulation project file
Paper (low repetition rate), 21533 words
Schematic screenshot
Simulation screenshot

design manual

Summary

Weighing technology is closely related to people's life, whether it is in industry or agricultural trade production, it is inseparable from weighing. Even today's sophisticated technology needs to pay attention to weighing. Its status has been from ancient times to the present. Unaltered. Nowadays, the development speed is extremely fast, but this is not the only requirement. At the same time as the development speed, the production efficiency is accelerated, and the utilization rate of materials is improved to improve the quality. These are all factors considered, and these can be optimized by improving the weighing technology. . The electronic scale is an innovative product that combines many functions, such as comprehensive processing, information technology, single-chip microcomputer, conversion technology and measurement. At the same time, it also has the advantages of accurate measurement, automatic operation, and digital display.
The main process of designing the electronic scale is as follows: firstly, the common electronic scale design scheme is compared and analyzed, the scheme of this paper is improved, and the selection and parameters of the system components are introduced; then, the hardware circuit design of the system is carried out, Design the system power supply circuit, serial port program download circuit, single-chip microcomputer control circuit, system display circuit and overweight alarm prompt circuit respectively, and draw the system hardware circuit and make PCB, at the same time, carry out the corresponding software design of the system; finally, carry out the electronic scale The overall debugging of the system, after the adjustment is improved, the actual adjustment results of the system are obtained. The results show that the electronic scale device designed in this paper works well and has certain practical application value.

Design framework

insert image description here

Preface 1
Chapter 1 System hardware scheme design 3
Section 1 Overview of electronic scale 3
1. Components of electronic scale 3
2. Working principle of electronic scale 4
3. Related parameters of electronic scale 4
Section 2 Overall scheme of system design Comparison 5
Section 3 System Component Selection and Parameter Introduction 7
1. MCU Type Selection 7
2. Sensor Selection 8
3. Display Selection 13
4. AD Conversion Chip Selection 14
Section 4 Chapter Summary 17
Chapter 2 System Hardware Circuit Design 18
Section 1 System power supply circuit design 18
Section 2 System serial port program download circuit design 18
Section 3 Single-chip control circuit design 19
Section 4 System display circuit design 21
Section 5 Overweight alarm prompt circuit design 21
Section 6 System hardware Circuit drawing and PCB production 22
1. Protel99SE software introduction 22
2. System schematic diagram design and drawing 22
Section 7 Summary of this chapter 23 Chapter 3
System software design 24
Section 1 System main program software flow chart 24
Section 2 System Flowchart of the display part 25
Section 3 Flowchart of the system key detection section 25
Section 4 Summary of this chapter 26
Chapter 4 System overall debugging 27
Section 1 Problems encountered in hardware circuit debugging 27
Section 2 System Debugging Effect Diagram 27 Section 3 Summary
of This Chapter 28 Summary 29 Acknowledgments 33 References 34 Appendix 35 Appendix 1 English Original Text 35 Appendix 2 English Translation 36 Appendix 3 System Overall Circuit Diagram 37 Appendix 4 System Main Program Source Code 38







Design instructions and design documents

insert image description here
insert image description here

Total words: 21533 words
![533![](https://img-blog.csdnimg.cn/b0e08e88395948d1b8e26a40ec1504ac.png)

Source code display

#include <reg52.h>
#include "delay.h"
#include "buzzer.h"
#include "LCD96x64.H" 
#include "HX711.h"  

sbit key1=P3^2;//去皮
sbit key2=P3^3;//微调重量-
sbit key3=P3^4;//微调重量+
float m__1=3.50;
unsigned long HX711_Buffer = 0;
unsigned int Weight_Maopi = 0,Weight_Shiwu = 0;
bit Flag_OK = 0;
//****************************************************
//称重
//****************************************************
void Get_Weight()
{
	HX711_Buffer = HX711_Read();
	HX711_Buffer = HX711_Buffer/100;
	if(HX711_Buffer > Weight_Maopi)			
	{
		Weight_Shiwu = HX711_Buffer;
		Weight_Shiwu = Weight_Shiwu - Weight_Maopi;				//获取实物的AD采样数值。
		Weight_Shiwu = (unsigned int)((float)Weight_Shiwu/m__1+0.05); 	//计算实物的实际重量
//因为不同的传感器特性曲线不一样,因此,每一个传感器需要矫正这里的4.30这个除数。
//当发现测试出来的重量偏大时,增加该数值。
//如果测试出来的重量偏小时,减小改数值。
//该数值一般在4.0-5.0之间。因传感器不同而定。
//+0.05是为了四舍五入百分位
	}
	if(Weight_Shiwu > 5000 )
	{
		buzzer = 0;	
	}
	else
	{
		buzzer = 1;
	}
	if(Weight_Shiwu < 5)Weight_Shiwu=0;

}

//****************************************************
//获取毛皮重量
//****************************************************
void Get_Maopi()
{
	HX711_Buffer = HX711_Read();
	Weight_Maopi = HX711_Buffer/100;		
} 

void main(void)
{
	LCD_Init();
	delay_ms(500);
	Beep(200);//提示初始化完成
	LCD_Clear();//重新清一次屏
	LCD_HanZi12x12("电子秤",12*3,0);
	LCD_HanZi12x12("重量",0,2);
	LCD_HanZi12x12("克",12*6,2);
	LCD_Ascii8x12(':',2*12,2); 
	Get_Maopi();				//称毛皮重量
    //主函数
	while(1)
	{
		if( Flag_OK == 0)
		{
			Get_Weight();			//称重
			LCD_Ascii8x12(Weight_Shiwu/10000%10+'0',2*12+8,2);
			LCD_Ascii8x12(Weight_Shiwu/1000%10+'0',2*12+8*2,2);
			LCD_Ascii8x12(Weight_Shiwu/100%10+'0',2*12+8*3,2);
			LCD_Ascii8x12(Weight_Shiwu/10%10+'0',2*12+8*4,2);
			LCD_Ascii8x12(Weight_Shiwu/1%10+'0',2*12+8*5,2);
			//LCD_Ascii8x12('g',2*12+8*6,2);
			//显示当前重量
		}
		if(key1==0)			//
		{
			delay_ms(10);
			if(key1==0)
			{	
				while(!key1);	//
				Get_Maopi();			//去皮	
				Beep(200);
			}
		}
		if(key2==0)			//
		{
		
			delay_ms(10);
			if(key2==0)
			{	
				while(!key2);	//	微调重量-
				m__1=m__1+0.10;
				if(m__1>=5.10)m__1=5.00;
				Beep(200);
				
			}
		
		}
		if(key3==0)			//
		{
		
			delay_ms(10);
			if(key3==0)
			{	
				while(!key3);	// 微调重量+
				m__1=m__1-0.10;
				if(m__1<=1.10)m__1=2.50;
				Beep(200);	
			}
	
		}
	}
}

Guess you like

Origin blog.csdn.net/qq_22592979/article/details/128125800