1. Introduction
Weighing devices are indispensable measuring tools in industrial and agricultural production and the expansion of commodity circulation. Electronic scales are favored by people for their accuracy, speed, convenience, intuitive display and many other advantages. With the improvement of people's living standards, as the whole nation pays attention to health and the quality of life is improving, in addition to being able to achieve weighing, intelligence and the development of new functions are the main trends in design and research and development. The development of intelligent calorie scale functions has become a new direction, applying electronic technology to daily life, solving and filling the deficiencies and gaps in certain functions of practical household appliances. This paper studies the design of electronic scales based on single-chip microcomputers, develops new functions of electronic scales without increasing costs, designs digital intelligent electronic calorie scales, guides people to live a healthy life, and has practical application and promotion value.
2. Electronic calorimeter system design
The weighing sensor senses the measured gravity. In this design, a resistive strain gauge pressure sensor is selected as the electronic weighing sensor. When vertical pressure is applied, the sensor converts the change in resistance value into a weak millivolt voltage signal output. The voltage signal is amplified by the amplifier circuit and input into the analog/digital (A/D) converter, converted into a digital signal and then output to the single-chip microcomputer for processing. The single-chip microcomputer outputs the result obtained by the electronic heat scale to the LCD display according to the heat information input by the matrix keyboard. The overall design of the system is shown in Figure 1.
In Figure 1, the sensor signal conditioning and conversion circuit uses the HX711 chip. The HX711 is a 24-bit A/D converter chip designed specifically for high-precision electronic scales. It has built-in gain control, high precision, and stable performance. The chip communicates with the microcontroller via a 2-wire serial method. The microcontroller reads the measured data, performs calculations and conversions, and then displays it on the LCD screen.
3. System hardware design
3.1 Load Cell
In this design, the weighing sensor uses a high-precision resistance strain pressure sensor with a measuring range of 0-10kg and a measuring accuracy of up to 5g. The resistance strain pressure sensor is mainly composed of an elastic body, a resistance strain gauge cable, etc. It has good stability, high accuracy and sensitivity, long life, and is not very strict on the measurement environment. The internal Huygens bridge is composed of 4 resistance strain gauges. When the strain gauge is stretched or compressed to produce deformation, its resistance value will change, causing the bridge to lose balance and generate a corresponding differential signal for subsequent circuit measurement and processing. The measurement principle of the resistance strain sensor is shown in Figure 2.
3.2 HX711 Circuit
Figure 3 is a weighing signal conditioning and conversion circuit composed of HX711. Channel A is connected to the sensor, and pins PD_SCK and DOUT form a serial communication line to output data and select input channels and gains.
When the data output pin DOUT is at a high level, it indicates that the A/D converter is not ready to output data. At this time, the serial port clock input signal PD_SCK should be at a low level.
When DOUT changes from high level to low level, PD_SCK should input 25 to 27 clock pulses. The rising edge of the first clock pulse will read out the highest bit (MSB) of the 24-bit data, until the 24th clock pulse is completed, and the 24-bit output data is output bit by bit from the highest bit to the lowest bit. The 25th to 27th clock pulses are used to select the input channel and gain of the next A/D conversion.
The number of PD_SCK input clock pulses should not be less than 25 or more than 27, otherwise it will cause serial communication errors. When the input channel or gain of the A/D converter changes, the A/D converter needs 4 data output cycles to stabilize.
DOUT will change from high level to low level and output valid data only after 4 data output cycles.
3.3 Matrix keyboard
When there are many keys in the keyboard, in order to reduce the occupation of I/O ports, the keys are usually arranged in a matrix. In a matrix keyboard, each horizontal line and vertical line are connected by a key at the intersection. In this design, the P1 port of the 8051 microcontroller is used as the keyboard I/O port. The column line of the keyboard is connected to the lower 4 bits of the P1 port, and the row line of the keyboard is connected to the upper 4 bits of the P1 port. The column lines P1.0-P1.3 are connected to the positive power supply +5V respectively, and the column lines P1.0-P1.3 are set as input lines, and the row lines P1.4-P1.7 are set as output lines. 4 row lines and 4 column lines form 16 intersections. Setting a 4×4 matrix keyboard at the intersection can display 0-9 numbers, a decimal point and five function keys.
3.4 LCD Display
The LCD uses the 128*64 Chinese character screen JLX12864G-086-PC to display information. This display module can be used as an ordinary image-type LCD display module (i.e., it can display ordinary image-type monochrome pictures), and it also contains the JLX-GB2312 font library IC, which can read the dot matrix data of the built-in font library from the font library IC and write it into the LCD driver IC to achieve the purpose of displaying Chinese characters.
4. System software design
This design uses STC89C52 as the core device, uses the keil C51 compiler, and combines the proteus software to perform functional simulation of the design. The system software consists of a timer interrupt module, a keyboard scan module, a display module, and a main program module. The timer is used to achieve weighing every 0.5 seconds. The main program flow chart is shown in Figure 4.
5. System performance test
In the process of designing the circuit, we first simulated it in the proteus software. The voltage value of the simulated weight is controlled by the potentiometer in the circuit. Changing the voltage is equivalent to changing the output voltage of the weight on the pressure sensor. This is to achieve the process of simulated weighing. After the simulation is successful, the circuit model is actually made, the unit calorie parameters of the food are input, and the physical object is debugged to meet the design requirements.
6. Summary
A new type of digital electronic calorimeter has been developed with the microcontroller as the core. It realizes intelligent weighing under the control of software and hardware, and directly converts the weight into the calories of common foods. The design has high accuracy and good stability. Without increasing the cost, the microcontroller technology is used to develop new functions of electronic scales at zero cost, opening up new application paths for electronic scales and making them a must-have electronic product that modern families can afford. Today, when the whole nation pays attention to health and the quality of life is improving, the actual application of electronic technology in daily life provides health references for every household, solves and fills the deficiencies and gaps in certain functions of practical household appliances, and has broad promotion and application value
Previous article:Application of digital filtering anti-interference technology in A/D conversion
Next article:Design of intelligent car based on AT89C51
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- [TI millimeter wave radar evaluation]_1_AWR1843BOOST unboxing
- A brief introduction to FPGA
- CCSv5.5 simulation problem
- IX. Some suggestions for training on “control” questions
- Reference voltage and clock issues of microcontrollers
- CrumpS2 ESP32-S2 Development Board
- TI full range of component libraries (component library, package library, 3D library) collection
- A pdf explaining the device tree
- Parameter calculation help for a zero-crossing detection circuit
- [Voice and vision module based on ESP32S3] Hardware design, debugging and progress-1