Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

Publisher:雅意盎然Latest update time:2011-08-27 Source: 山西电子技术Keywords:MCS-51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: The design uses AT89C51 single-chip microcomputer, A/D converter ADC0808 and common anode digital tube as the main hardware, and analyzes the digital voltmeter Proteus software simulation circuit design and programming method. The single-chip microcomputer is applied to measurement technology, ADC0808 is used to convert analog signals into digital signals, AT89C51 is used to process data, and the digital tube is used to complete the display in a scanning manner. The designed digital voltmeter can measure the voltage value of 0~5 V. AT89C51 is an 8-bit single-chip microcomputer. When the input voltage of ADC0808 is 5 V, the output digital value is +4.99 V. The circuit of this design is simple, low-cost and stable in performance.
Keywords: digital voltmeter; 51 single-chip microcomputer; ADC0808; digital tube LED

0 Introduction
With the development of electronic science and technology, electronic measurement has become a means that must be mastered by the majority of electronic workers, and the requirements for measurement accuracy and function are getting higher and higher, and voltage measurement is particularly prominent because voltage measurement is the most common. Digital voltmeter is a voltmeter designed using digital measurement technology. Compared with analog voltmeters, digital voltmeters have the characteristics of intuitive and accurate readings, wide display range, high resolution, large input impedance, high integration, low power consumption, strong anti-interference ability, and strong scalability. Therefore, they are widely used in voltage measurement and voltage calibration. This paper uses ADC0808 to convert the input analog signal, and the control core AT89C51 microcontroller calculates and processes the conversion results. Finally, the output device is driven to display the digital voltage signal. The interface circuit design is realized through Proteus simulation software, and real-time simulation is performed.
Proteus software is a circuit analysis and physical simulation software. It runs on the Windows operating system and can simulate and analyze (SPICE) various analog devices and integrated circuits. It is a simulation software that integrates microcontrollers and SPICE analysis. It is powerful, has rich system resources, low hardware investment, and intuitive images. It has been favored by users in recent years.

1 System Overview
1.1 Design Task
Design a digital voltmeter using the MCU AT89C51 and ADC0808, convert the voltage value of the analog signal between 0 and 5 V into a digital signal, display it with a two-digit digital tube, and observe the voltage value of the ADC0808 analog input signal through a virtual voltmeter, and the LED digital tube displays the corresponding numerical value in real time.
1.2 Overall Scheme
The circuit block diagram of the digital voltmeter is shown in Figure 1.

a.jpg


The circuits needed in this design include power supply circuit, analog/digital conversion circuit, single-chip control circuit, display circuit, etc. The chips needed in the design include AT89C51 single-chip microcomputer, ADC-0808, 74LS74, LED digital tube, etc.

2 Proteus software simulation circuit design of digital voltmeter
The voltage input signal to be measured is within the maximum working voltage range of the ADC0808 chip, and is converted by the analog/digital conversion circuit to achieve A/D conversion, and the program data is processed by the single-chip control circuit, and then the digital tube displays the input voltage through the seven-segment decoding/driving display circuit.
The hardware circuit schematic is shown in Figure 2.

e.jpg

2.1 Interface design of AT89C51 single-chip microcomputer and digital tube display circuit
A digital voltmeter is designed using the single-chip microcomputer AT89C51 and ADC0808 to convert the DC voltage value of the analog signal between 0 and 5 V into a digital signal 0 to FF, which is displayed with two digital tubes. Proteus software starts the simulation. The current input voltage is 2.5 V, which is converted into a digital value of 7FH. The voltage of the input analog/digital converter ADC0808 can be changed by adjusting the potentiometer RV1 with the mouse pointer, and the voltage value of the analog input signal of ADC0808 can be observed through the virtual voltmeter. The LED digital tube displays the corresponding numerical value in real time.
The crystal oscillator frequency of the AT89C51 single-chip microcomputer is set to 12 MHz in the Proteus software. The EA of this circuit is connected to a high level, and there is no external ROM expansion.
2.2 Interface design of A/D conversion circuit
The A/D converter uses the integrated circuit ADC0808. ADC0808 has 8 analog input signals IN0~IN7 (pins 1~5, 26~28), and the address lines C, B, and A (pins 23~25) determine which analog input signal is A/D converted. This circuit connects the address lines C, B, and A to ground, that is, selects channel 0 to input the analog voltage signal. Pin 22 ALE is the address latch enable control signal. When the input is high, the address signal is latched. Pin 6 START is the start control signal. When the input is high, the A/D conversion starts. This circuit connects the ALE pin and the START pin together, and they are controlled by the P2.0 pin and the WR pin of the microcontroller through an NOR gate. Pin 7 EOC is the A/D conversion end signal. When the A/D conversion ends, pin 7 outputs a positive pulse. This signal can be used as a detection signal to indicate whether the A/D conversion is over or as a signal to request an interrupt to the CPU. This circuit is connected to the P3.2 pin of the microcontroller through a NOR gate. Pin 9 OE is the A/D conversion data output enable control signal. When the OE pin is high, the digital quantity of the A/D conversion is allowed to be read. The OE pin is controlled by the P2.0 pin and the RD pin of the single-chip computer through the NOR gate. Pin 10 CLOCK is the real-time clock input terminal of ADC0808. The clock signal is obtained by using the six-frequency crystal oscillator frequency of the single-chip computer 30 pin ALE. The 8 digital output terminals are connected to the P0 port of the single-chip computer.

3 Software programming of digital voltmeter
When the system is powered on, the startup address of ADC0808 is initialized, the digital tube display is turned off, and the A/D conversion is started. After waiting for the startup to end, the digital quantity result of the analog input signal of channel 0 of ADC0808 is converted and output on the three-digit digital tube through the dynamic display of the digital tube.
According to the design requirements and the hardware circuit, a resistor voltage divider is used when inputting analog signals. The final sampled input voltage is only one tenth of the actual input voltage. Therefore, a data adjustment program should be written in the program. It should also be noted that the hardware display circuit uses dynamic scanning display. In the dynamic scanning display mode, there are certain requirements for the frequency of dynamic scanning. If the frequency is too low, the digital tube LED will flicker. Usually, the digital tube lighting time interval is generally about 5ms. This requires that when writing the program, it should be lit and maintained for a certain time. Summarizing the above analysis, the program flow chart is shown in Figure 3 and Figure 4.

d.jpg


The program design of this circuit mainly includes A/D conversion part, LED display, initialization and timer interrupt part. Part of the program code is shown below.
b.jpg
c.jpg

5 Conclusion
The digital voltmeter in this article can measure the voltage value of 0~5V. AT89C51 is an 8-bit single-chip microcomputer. When the input voltage of ADC0808 is 5V, the output digital value is +4.99V. If you want to get higher accuracy, you need to use I2-bit, I3-bit and other higher than 8-bit A/D converters. The display part of the digital voltmeter can add a BCD code adjustment program to display its data through a three-digit digital tube. The display deviation of this design can be solved by correcting the reference voltage of 0808, or by using software programming to correct its measured value. This system was debugged by Proteus simulation software during the design process, and has the characteristics of simple circuit, low cost, high accuracy, fast speed and stable performance.

Keywords:MCS-51 Reference address:Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

Previous article:Single chip music program design (including source code)
Next article:Design of a solar alarm system

Recommended ReadingLatest update time:2024-11-16 20:23

Application of MAX1247 chip in MCS-51 series
    Abstract: MAX1247 is a new 12-bit A/D converter produced by MAXIM Company in the United States. The article introduces its functions, working modes and conversion parameters, and gives the software interface program between MAX1247 and MCS-51. MAX1247 is a 12-bit A/D converter. It features a four-channel multip
[Analog Electronics]
Reset Problems in MCS-51 Interrupt System
The MCS-51 series of microcontrollers provide multiple interrupt sources (8051 provides 5, 8052 provides 6 interrupt sources). Each interrupt source can be programmed with two levels of interrupts, high-level interrupt requests and low-level interrupt requests, so two-level interrupt service nesting can
[Microcontroller]
Reset Problems in MCS-51 Interrupt System
Design of real-time online environmental monitoring system using MCS-51 microcontroller data collector
1 Introduction The data collector based on GPRS and MCS-51 microcontroller is a real-time online environmental monitoring system. It uses the packet wireless service GPRS to transmit the environmental conditions detected online in real time to the environmental protection department monitoring information processing c
[Microcontroller]
Design of real-time online environmental monitoring system using MCS-51 microcontroller data collector
How many working registers does the MCS-51 microcontroller have?
        There are 4 groups of working registers, each group contains 8 working registers R0~R7. The RS1 and RS0 bits in PSW are used to select which group to use. If no selection is made, group 0 is selected by default.         When the RS1RS0 combination is 00, the 0th group of working registers is selected, and th
[Microcontroller]
Several methods of anti-interference of microcontroller software
1. Research on software anti-interference methods In engineering practice, the content of software anti-interference research is mainly: 1. Eliminating the noise of analog input signals (such as digital filtering technology); 2. Methods to get the program back on track when the program is running chaotically. This a
[Microcontroller]
MCS-51 series microcontroller control register TCON (88H)
   The high 4 bits of the special function register TCON are the timer operation control bit and overflow flag bit, and the low 4 bits are the external interrupt trigger mode control bit and latch external interrupt request source. The TCON format is as follows: D7 D6 D5 D4 D3 D2 D1 D0  TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
[Microcontroller]
Discussion on the Design of Serial Communication between PC and Multiple MCS-51 Single Chip Microcomputers
Introduction: This paper mainly discusses the design of serial communication between PC and multiple MCS-51 microcontrollers. The software and hardware of this system have been debugged on IBM PC/XT and DICE series MCS-51 microcontrollers and run well. Its control on the simulation platform has been verified and is no
[Microcontroller]
Discussion on the Design of Serial Communication between PC and Multiple MCS-51 Single Chip Microcomputers
Why does the MCS-51 microcontroller need to interrupt the system expansion? How does the timer serve as an external interrupt source?
Why does the MCS-51 microcontroller need to use interrupt system expansion? Answer: Although MCS-51 has provided two external interrupt request input terminals INT0 and INT1, when there is still a large demand for external interrupt request sources, interrupt system expansion is required. When the timer is used as
[Microcontroller]
Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号