Simulation Circuit Design of Digital Voltmeter

Publisher:码梦小子Latest update time:2011-11-09 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This paper uses ADC0808 to convert the input analog signal, controls the core AT89C51 microcontroller to calculate and process the conversion result, and finally drives the output device 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 single-chip microcomputers and SPICE analysis. It is powerful, has rich system resources, low hardware investment, and intuitive images. It has been favored by the majority of users in recent years.

1 System Overview

1.1 Design Tasks

A digital voltmeter is designed using the single-chip microcomputer AT89C51 and ADC0808. The voltage value of the analog signal between 0 and 5 V is converted into a digital signal, which is displayed with a two-digit digital tube. The voltage value of the ADC0808 analog input signal is observed through a virtual voltmeter, and the LED digital tube displays the corresponding numerical value in real time.

1.2 Overall Plan

The block diagram of the digital voltmeter circuit is shown in Figure 1.

Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

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

Proteus software simulation circuit design of digital voltmeter#e#2 Proteus software simulation circuit design of digital voltmeter

The voltage input signal to be measured is within the maximum operating voltage range that the ADC0808 chip can withstand. It is converted into A/D by the analog/digital conversion circuit, processed by the microcontroller control circuit, and then displayed on the digital tube by the seven-segment decoding/driving display circuit.

The hardware circuit schematic is shown in Figure 2.

Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

2.1 Interface design of AT89C51 microcontroller 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 of 0 to FF, which is displayed with a two-digit digital tube. The simulation is started with the Proteus software. 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.

In Proteus software, set the crystal frequency of AT89C51 microcontroller to 12 MHz. In this circuit, EA is connected to high level and there is no external ROM.

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 grounds the address lines C, B, and A, 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 A/D conversion digital quantity is allowed to be read. The OE pin is controlled by the P2.0 pin and RD pin of the microcontroller through an 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 microcontroller 30 pin ALE. The 8 digital output terminals are connected to the P0 port of the microcontroller.

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 be completed, the digital result of the analog input signal of channel 0 of ADC0808 is converted and outputted and displayed 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.

Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer
The program design of this circuit mainly includes A/D conversion, LED display, initialization and timer interrupt. Part of the program code is shown below.

Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

Simulation Design of Digital Voltmeter Based on 51 Single Chip Microcomputer

5 Conclusion

The digital voltmeter in this paper 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. If you want to obtain higher accuracy, you need to use I2-bit, I3-bit and other A/D converters higher than 8 bits. 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.

Reference address:Simulation Circuit Design of Digital Voltmeter

Previous article:Virtual Prototype Model and Modal Simulation of Vibration System
Next article:Technical Analysis of Vehicle Alcohol Monitoring System

Latest Analog Electronics 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号