Sunteți pe pagina 1din 3

Design of a Simple DC Digital Voltmeter

WangHui-feng1 Liu Xiao-hua2


1

Hubei Institute of Technology, Xianning, China; 2 Jiaozuo Teachers College, Jiaozuo, China

AbstractThe simple digital voltmeter is made of the ATMEL 8bit MCU(Main Computational Unit), AT89S52 and national
semiconductors ADC(Analog-to-Digital Converter)0804 ,
including a certain number of components. The system uses the
AT89S52 MCU as the main controller, which processes the
acquired analog voltage and realize LED(light-emitting diode)
digital display by dynamic scanning. The voltmeter can measure
the DC(direct current) voltage in the rage of 0 ~ 5V and display
the measurement results by the four LED digital tube. Because of
fewer components, low cost , automated adjustment, high
accuracy measurement, stable performance, the voltmeter has a
very good application prospect.
Key words- A/D converter; ADC0804voltmeter; microcontroller;
Single-chip Digital

I.

INTRODUCTION

In the measurement of voltage, current and frequency are


the three most basic quantity measured, the voltage
measurement is most frequent. With the development of
electronic technology, High-precision voltage measurement is
needed more as a necessary measure instrument. Digital
voltmeter which is called DVM for short is a electronic
measuring instrument the which converses the analog signal
into discrete digital form and display. The traditional pointer
voltmeter can not meet the demand of the digital age because
of the nature of single function and low precision.

AT89S52

The reset
circuit

P1

The A/D
conversion circuit

Measure
voltage input

P3
The Display
system

P2

The clock
circuit

P0

Figure 1.

Digital voltmeter system hardware design converter

III.

SCHEME DESIGN

HARDWARE CIRCUIT DESIGN

A. A/D Conversion Module


The analog to digital conversion is achieved through the
A/D converter.A/D converter is a device converting the analog
voltage or current into digital content, and is a interface
between a simulation system and computer. In the data
acquisition and control system, A/D converters have been
widely used.Successive approximation type A/D converter is

A. Design Goals
1) Based on AT89S52 single chip microcomputer as the
core device, consisting of a simple DC digital voltmeter.
2) The analog input, can measure 0 ~ 5V DC voltage
3) The voltage display with one of the 4 LED digital tube,
can display 3 decimal places.
4) Use fewer components as far as possible.

978-1-4799-2860-6/13/$31.00 2013 IEEE

C. Query Mode Options of Single Chip Microcomputer to


A/D Converters
The design method of program query mode is relatively
simple, but single chip microcomputer must repeatedly query
the A/D conversion end signal the end ,which Occupy CPU for
a long tiame; Only a I/O outlet and an interrupt source of single
chip microcomputer is occupied by interrupt mode. Interrupt
query mode is oue selection by comparison .
D. Design Schemes
Design of hardware circuit is composed of 6 parts:
AT89S52 single-chip system, A/D system, LED display system,
clock circuit, reset circuit and voltage measurement input
circuit. The hardware circuit design diagram as shown in Fig1.

At present, the digital voltmeter composed of a variety of


A/D converter has been widely used in electronic and electrical
measurement, industrial automation instrument, automatic test
system and other fields, showing a strong vitality. At the same
time, all kinds of general and special digital instrumentation
extended from DVM has improve electric and non-electricity
measurement technology to a new level. Due to such prominent
characteristic as the high precision as facilitate accurate
readings, small error, high sensitivity ,high resolution, and fast
measurement speed,digital voltmeter is developed. In this
design ,Conversion results of the input analog signal by
ADC0804 is processed by Single chip microcomputer, forming
high precision digital signal output which will be desplay on
digital tube.
II.

B. AD Chip Select
The 8 bit A/D converter mostly commonly used is ADC
series chip manufactured by the United States Chip
Manufacturers, among which ADC0804 and ADC0808/0809 is
the mostly commonly used, and they are successive type 8 bit
A/D converter. ADC0804 is a 8 bit successive CMOS type
A/D converter, the design requires only the measurement the
input voltage, and the ADC0804 is 8 bits of A/D converter, 0 ~
255 is the range of values, the input range analog voltage is 0
~5V, every digital change corresponds to the value is
5V/255=0.0196 V, which can meet the requirements of the
system, so we select ADC0804 as the A/D converter.

234

composed of a comparator, A/D converter, the memory and


control circuit. It uses the internal registerto test comparison
from high to low.

divided the initialization module, A/D conversion and display


program, the three program modules of the main program
software of the system, as shown in Fig.2.

B. Single-chip Microcomputer System


The AT89S52 is a low power, high performance CMOS 8
bit microcontroller, with 8K in system programmable Flash
memory. Using Atmel's high density non-volatile memory
technology manufacturing, fully compatible with 80C51
products and industrial orders and pin. The on-chip Flash
allows the program memory in system programmable, also
suitable for conventional programming. In a single chip, with
smart 8 bit CPU and in-system programmable Flash, such that
AT89S52 is widely used in many embedded control
applications.

Start

Initialization

Call the A/D conversion


program
Call display program

C. Reset Circuit and Clock Circuit


The reset circuit usually adopts automatic power-on reset
and reset button in two ways. For the sake of convenience, the
design is a power-on reset circuit.

Figure 2.

SCM each functional unit operation clock control signal for


the benchmark, everything in good order and well arranged.
Therefore, the clock frequency directly affect the speed of
MCU, clock circuit quality also directly affects the stability of
single chip microcomputer system. The clock circuit used in
two ways, one is the internal clock mode, another is the
external clock mode. This system uses the internal clock mode,
using the high gain of the inverting amplifier chip internal, the
external circuit is simple, requiring only a crystal and 2
capacitors.

start

start convert
the end of A/D

D. Design of Display System


LED has been widely used because of the advantages of
simple structure, low price, and convenient and MCU interface.
LED display is composed of a plurality of light emitting diode
display device field display. In single-chip microcomputer
seven digital display is the mostly used. LED seven digital
display is composed of 8 light emitting diode display field,
which led 7 strip arranged into a "" - shaped, another dot
shaped light-emitting diode is used displaying a decimal point
in the lower right corner of the display, which can be used to
display a variety of digital through different combinations.
According to the design goals and the analysis above
consideration, in this design, the choice is 4 in one on common
cathode digital LED display, called "4-LED".for short.

Output conversion data


Data processing
End
Figure 3.

A/D conversion chart

Two key in program design is simulation of voltage and


display code convert. Calculation formula of the analog voltage
value can be calculated by the formula below:
=0.0196

E. Interface of Display Section and MCU Design


Because the parallel port current of MCU driving ability is
limited to drive digital tube, the Special-purpose drive circuit
chip must be used. Only if the current is large enough, the
display can work properly. This design uses P0, so you need to
add a pull-up resistor to P0 with. Then DB0~DB7 of the drive
chip and A~G Digital tube is connected.
IV.

DC digital voltage meter block diagram of main


program

voltage V -- the calculated values; D 8 digit A/D converter


output. In programming, if A/D conversion result is multiplied
by 0.0196, the result is a decimal number, in the computer
called a floating point number. On 8 bit MCU, do not have
floating-point operation ability, if t calculating a floating point
number is necessary, a lot of memory unit and MCU CPU time
will be occupied. Therefore, using a simple algorithm, directly
multiplie digital ADC0804 the 196, namely, integer arithmetic,
the result of the operation is 1000 times than the actual value,
the integer arithmetic speed is still fast, not occupying too
much CPU time.

PROGRAM DESIGN

A. The overall Design Scheme


Based on the principle of modular program, the program is

235

Display program is used to display the voltage in digital


form measured by ADC0804. This part adopts dynamic
scanning to achieve the numerical displayby four digital
tube .In dynamic scanning display mode, in order to make the
LED display more homogeneous, there are certain
requirements on the scanning interval. In this design display
times of every LED is about 1ms, digital display is relatively
stable.

B. System Program Design


The so-called initialization, the initial state is set to internal
parts of SCM or expansion of the chip, as well as some variable
initialization. The initialization of this design is relatively
simple, the main is disconnected and allow external interrupt,
due to relatively simple, the initialization portion is directly
included in the main function.
A/D measurement acquisition conversion program is used
to control the module voltage of the input signal, and the
corresponding values in the memory unit deposit to the
conversion process, as shown in Fig.3 .

V.

Display program is used to measure the voltage ADC0804


is displayed in digital form, this part adopts dynamic scanning
to achieve the four digital tube display the numerical, in
dynamic scanning display mode, in order for the LED to
display more homogeneous, there are certain requirements on
the scanning interval. This design shows every LED is about
1ms, digital display relatively stable.
TABLE I.
Standard voltage /v
0.00
0.50
1.00
1.50
2.00
2.50

The test table by simple digital voltmeter and the "standard"


digital voltmeter are got through the above simulation results,
as shown in the table:

TABLE BY SIMPLE DIGITAL VOLTAGE METER AND THE "STANDARD" DIGITAL VOLTAGE METER

Simple volt meter /V


0.00
0.490
0.999
1.489
1.999
2.489

Absolute error /V
0.00
0.01
0.001
0.011
0.001
0.011

Standard voltage /v
3.00
3.50
4.00
4.50
5.00

As the microcontroller AT89S52is 8 processors, when the


input voltage is 5.00V, output data of ADC0804 value was 255
(FFH), so the numerical resolution of the microcontroller
0.0196V (5/255). The highest resolution can only determine the
voltmeter of 0.0196V.The above table shows that the test
voltage changes generally in the range of 0.01V. The values
measured by simple digital voltmeter measured is small
0~0.01V than by the standard voltmeter, this error is Almost
negligible.
VI.

SIMULATION AND ERROR ANALYSIS

Debugging this system is mainly based on software, among


them, system circuit diagram and simulation used Proteus
software, and procedures, using C language, using Keil
software program to write mcu.

Simple volt meter /V


2.998
3.488
3.998
4.488
4.998

Absolute error /V
0.002
0.012
0.002
0.012
0.002

carry, the most important is the high precision and can control,
high practical value and conform to the trend of technology.
REFERENCE
[1]

[2]

[3]

SUMMARY

By means of error analysis, the system using MCU and


AD0804 as the core device, realize the measurement of DC
voltage of 0~5V, and displayed in digital form, very small
measurement error, simple operation, low cost, also easy to

[4]

236

Zhang gang-yiPeng xi-yuanPrinciple and application of single chip


microcomputer [M] Beijing Higher education press,2010 (In
Chinese)
Guo tianxiang New concept 51 single-chip C language tutorial
[M] Beijing Publishing House of electronics industry ,2009 (In
Chinese)
Han-jianguoLiao-junbiGuiyun tianFoundation and Application
of Microcontroller[M] Beijing Higher education press2004 (In
Chinese)
Richard
R.Spencer Introduction
to
Electronic
Circuit
Design[M] Beijing Publishing House of electronics industry
2004

S-ar putea să vă placă și