1 Introduction
In the measurement of electrical quantity, voltage, current and frequency are the three most basic measurements, and voltage measurement is the most common. The digital multimeters used by students now can measure a variety of electrical quantities, and have a certain degree of accuracy and are easy to use. In order to let students better understand the working principle of digital voltmeters and stimulate their interest in learning single-chip microcomputer courses, this article starts from the aspects of software and hardware design, proteus simulation, physical production, and error analysis, and explains the working principle of digital voltmeters, data program processing methods, and digital signal software filtering principles.
2. Hardware Design
The hardware circuit design consists of four parts: A/D conversion circuit, AT89C51 single-chip microcomputer system, LED display system, and voltage measurement input circuit. The hardware circuit design block diagram is shown in Figure 1. The overall design block diagram is as follows:
The working principle of this circuit is: +5V analog voltage signal is divided by variable resistor VR1 and enters through IN0 channel of ADC08008 (because of the use of IN0 channel, ADDA, ADB and ADC are all connected to low level). After analog/digital conversion, the corresponding digital quantity is generated and transmitted to P0 port of AT89C51 chip through its output channel D0-D7. AT89C51 is responsible for processing the received digital quantity, generating the correct display segment code of 7-segment digital tube and transmitting it to the four-digit LED. At the same time, it also generates bit selection signal through its four-digit I/O port P2.0, P2.1, P2.2 and P2.3 to control the lighting of digital tube.
The hardware circuit of the simple digital DC voltmeter has been designed. You can select the corresponding chips and components, use Proteus software to draw the hardware principle, and carefully check and modify it until a complete hardware schematic diagram is formed. However, to truly realize the circuit's function of measuring and displaying voltage, corresponding software is also required to meet the design requirements.
3. Software Design
According to the module division principle, the program is divided into initialization module, A/D conversion subroutine and display subroutine. These three program modules constitute the main program of the entire system software, as shown in Figure 2.
The core of the whole program design is to process the data of A/D conversion, including digital filtering, data decimal processing, etc. The A/D conversion subroutine is used to control the acquisition and measurement of the input module voltage signal and store the corresponding value into the corresponding memory unit.
The display subroutine uses dynamic scanning to realize the numerical display of the four-digit digital tube. When using the dynamic scanning display method, in order to make the LED display more uniform and have sufficient brightness, it is necessary to set an appropriate scanning frequency. When the scanning frequency is around 70hz, it can produce a better display effect. Generally, the LED can be dynamically scanned once at an interval of 10MS, and the display time of each LED is 1MS.
4. Results and error analysis
Since the MCU AT89C51 is an 8-bit processor, when the input voltage is 5.00V, the ADC0808 output data value is 255 (FFH), so the maximum numerical resolution of the MCU is 0.0196V (5/255). This determines that the maximum resolution of the voltmeter can only be 0.0196V. As can be seen from Table 1, the test voltage generally changes in an amplitude of 0.01V.
When the input voltage value of in0 port is 13.5V, the display result is shown in Figure 3. The measurement error is 0.1V.
As can be seen from Table 1, the value measured by the simple digital voltmeter is basically 0-0.01V larger than the standard voltage value. This can be solved by correcting the reference voltage of adc0808 or reducing the error through software calibration. Because the voltmeter is designed to directly use a 5V power supply as the voltage, the voltage may be biased. When measuring a voltage greater than 5V, a voltage divider resistor can be used at the input port, and the divisor of the calculation program can be adjusted in the program.
Judging from the test data, the absolute errors are all controlled below 1V, and the relative errors are all below 1%, which can meet the needs of most applications. If the experimental data induction method is adopted, the obtained data is plotted into a curve, and then a more reasonable algorithm is used, more accurate results will be obtained.
Previous article:51 MCU learning practice: Use NTC resistor to measure temperature and display it on TM1637 digital tube
Next article:Design of single chip digital voltmeter (Part 2)
Recommended ReadingLatest update time:2024-11-17 00:06
- 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
- Recruitment: RF Engineer
- NuMaker-IIoT-NUC980 Review EBI
- How to convert K210 image into JPEG data stream after acquisition
- Design and implementation of 3D wireless RF mouse based on single chip microcomputer and touch control module
- RSL10 ADC multi-channel data acquisition
- MicroPython Hands-on (34) - Universal Sensor
- Practical Information 2 - Performance Comparison between CDMA2000 1X and GPRS
- 【FAQ】RISC-V Safe Place|Microchip Security Solutions Series Seminar No. 4
- 【Development and application based on NUCLEO-F746ZG motor】1. Development board introduction
- MSP432 learning notes: import of environment configuration library functions