0 Introduction
With the continuous development of electronic technology and automated measurement technology, traditional weighing systems can no longer meet people's needs in terms of function, accuracy, cost performance, etc., especially in terms of intelligence, portability, and measurement of tiny masses. In recent years, the emergence of new single-chip microcomputers and the development of integrated circuit technology have provided conditions for updating product design and developing cost-effective weighing controllers. This design uses an AVR single-chip microcomputer as the control core, combined with a resistive strain gauge pressure sensor and a corresponding signal acquisition circuit, to design a new type of electronic scale with high precision, multi-function and low cost.
1 Overall system design
First, the weighing sensor collects the voltage signal generated by the pressure change, converts the analog signal into a digital signal through the A/D converter, and sends the digital signal to the AVR microcontroller. After the microcontroller does the corresponding processing, it obtains the current object weight data and displays it on the LCD. The system hardware structure is shown in Figure 1.
The system hardware circuit includes A/D conversion module, 4×4 matrix keyboard module, LCD module and buzzer alarm module; the software module can be divided into main program module, matrix keyboard scanning module, A/D conversion module and LCD1602 module.
2 System Hardware Design
2.1 AVR Microcontroller
This design uses ATmega16 from the AVR series of microcontrollers as the microcontroller. ATmega16 is a low-power 8-bit CMOS microcontroller based on the enhanced AVR RISC structure. Due to its advanced instruction set and single-clock cycle instruction execution time, the data throughput of ATmega16L is as high as 1MIPS/MHz. It integrates 16kB of programmable FLASH, 512B of E2PROM, and 1kB of on-chip SDRAM. In terms of peripherals, it has two programmable serial UARTs, 8-way 10-bit ADC, four-channel PWM, and supports SPI, TWI, and JTAG interfaces, allowing ATmega16L and other peripherals to perform high-speed data transmission.
2.2 Load Cell
The resistance strain type weighing sensor is a sensor that converts force (weight) into an electrical signal by pasting a resistance strain gauge on an elastic sensitive element and then forming an electric bridge in an appropriate manner. In the resistance strain type weighing sensor, the change in resistance is converted into a change in voltage through a bridge circuit. The working principle of the resistance strain type weighing sensor is shown in Figure 2.
This design uses the SB-B cantilever weighing sensor of Hunan Aerospace Company, with a rated range of 5kg, sensitivity of 3mv/V, nonlinear error of 0.03%ES, repeatability error of 0.02%ES, creep (30 minutes) of 0.03%FS, zero temperature drift of 0.03%FS/10℃, and temperature compensation range of -10~60℃. This series of sensors adopts a cantilever single shear structure, has strong overload capacity, good automatic centering after force, and has the characteristics of high precision, good long-term stability, anti-fatigue and strong anti-eccentricity.
2.3 High-precision A/D conversion
The weighing sensor outputs a voltage signal of mV level. This design uses AD7705 to collect the signal. AD7705 is a 16-bit A/D conversion chip based on ∑-△ conversion technology launched by AD. It has the characteristics of high resolution, wide dynamic range, self-calibration, excellent anti-noise performance, low voltage, low power consumption, etc., which is suitable for the needs of microcomputer signal processing in weighing systems. It has a programmable gain amplifier with a gain range of 1 to 128. It can be directly connected to the pressure sensor. It uses a synchronous serial SPI interface and can be directly connected to the hardware SPI interface of the AVR microcontroller. Its circuit connection diagram is shown in Figure 3.
When the sensor is loaded with a full-scale weight of 5kg, the sensor obtains an output voltage of 15mV at an operating voltage of 5V. The 5V operating voltage is divided to provide a reference voltage for the AD7705, so changes in the operating voltage will not cause system errors. The voltage divider resistors are 24kΩ and 15kΩ, and the generated reference voltage is 1.92V. When the device's programmable gain is 128, the corresponding full-scale input voltage is 15mV. [page]
2.4 Human-computer communication
Human-computer communication includes three parts: keyboard scanning, LCD, and buzzer alarm. The keyboard uses a 4×4 matrix scanning keyboard, which is connected to the PC port of the single-chip computer; the display part uses LCD1602 liquid crystal, which can display 16×2 or 32 characters at the same time. The character generation memory (CGROM) inside the 1602 liquid crystal module has stored 160 different dot matrix character graphics. When programming, you can directly assign values using AS-CII codes, or you can assign values using character constants or variables; the function of the buzzer is to sound an alarm to remind the user when the weighing object exceeds the range of the sensor.
3 System Software Design
The system software development platform is WinAVR, and the development language is C. In order to facilitate program debugging and improve reliability, the program design adopts a top-down, modular, and structured programming method. The programs divided by task modules in this design mainly include initialization program, main program, A/D conversion subroutine, LCD display subroutine, and keyboard scanning subroutine.
The system is divided into initial interface mode and weighing mode when working, and a flag can be set for change and judgment. In the initial interface, the first line of the LCD screen displays "Place object!", prompting the user to place the object to be weighed on the electronic scale; the second line displays "Price:", prompting the user to enter the unit price of the object.
Then the system enters the keyboard scanning state. When the corresponding weighing button is pressed, the single chip controls AD7705 to perform AD conversion, and the result is processed and displayed on the LCD. The display includes the weight and total price of the item, and the weighing accuracy is 1g. In this way, the real-time measurement of the item is completed in a continuous cycle. The main program flow chart is shown in Figure 5.
4 Conclusion
This paper proposes a design of a digital electronic scale based on ATmega16 microcontroller, which gives full play to the powerful control ability of AVR microcontroller, realizes high-precision measurement of weight through weighing sensor and 16-bit AD7705 converter, and has the characteristics of low cost, strong stability and simple circuit. The system has achieved satisfactory results in the actual application of electronic scale.
Previous article:Special IC decryption technology--AVR application skills
Next article:AVR MCU Course Design Program
Recommended ReadingLatest update time:2024-11-16 21:31
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Free Download | TE White Paper "The Importance of Pressure Sensors in HVAC Refrigeration Systems"
- Things to note when routing high-frequency and high-speed signal lines along the edge of a PCB
- CAN protocol and CAN driver?
- lwip stability issue?
- [Gizwits Gokit3 Review] Gokit3 Hardware Circuit Learning
- Finally solved the XDS100 V2.0 driver problem of TMS320F28377S development board
- AD9 mid-level schematic design
- Download the white paper and answer questions to win prizes | TE "Smart Monitoring Application Connectivity Solution Guide"
- Use of TI DSP Integrated Development Environment CCS
- Shared information: 2019 H Topic Electromagnetic Gun (Laser Version) + 483431Z