Design of single chip digital voltmeter (I)

Publisher:琴弦悠扬Latest update time:2020-12-18 Source: elecfansKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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:

Summary of single-chip digital voltmeter design solutions (detailed explanation of nine analog circuit design schematics)

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.

Summary of single-chip digital voltmeter design solutions (detailed explanation of nine analog circuit design schematics)

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.

Summary of single-chip digital voltmeter design solutions (detailed explanation of nine analog circuit design schematics)

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.

Summary of single-chip digital voltmeter design solutions (detailed explanation of nine analog circuit design schematics)

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.

Keywords:MCU Reference address:Design of single chip digital voltmeter (I)

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

MCU RS485 communication interface, control line, schematic diagram and program example
The RS232 standard was born before RS485, but RS232 has several shortcomings: The signal level of the interface is relatively high, reaching more than ten V. Improper use may easily damage the interface chip, and the level standard is also incompatible with the TTL level. The transmission rate is limited and cannot
[Microcontroller]
MCU RS485 communication interface, control line, schematic diagram and program example
51 single chip microcomputer learning - 4 - digital tube display
Digital tube static display principle Display and its interface Commonly used displays in single-chip microcomputer systems are: Light Emitting Diode (LED) display, Liquid Crystal Display (LCD) display, TFT liquid crystal display, etc. LED display has two display structures: segment display (7-segment, crossbar, etc.)
[Microcontroller]
51 single chip microcomputer learning - 4 - digital tube display
51 MCU drives TEA5767 FM radio chip C program
Complete source code download address:  http://www.51hei.com/bbs/dpj-19294-1.html   Below is the main part of the program:                  /*----------- TEA5767 driver-----------*/                  /*------ External crystal is 12MHz-------*/                 /*--------Last modified 2011.02.26-------*/ #include
[Microcontroller]
51 MCU drives TEA5767 FM radio chip C program
Production of the minimum system based on AT89S51 single chip microcomputer
1. Determine the tasks Developing a single-chip minimum system 2. Task Analysis: The system has the following functions: (1) It has a 2-digit LED digital tube display function. (2) It has eight light emitting diodes to display various flowing lights. (3) It can complete various sound-generating experiments
[Microcontroller]
Production of the minimum system based on AT89S51 single chip microcomputer
How to access bytes in int in 8051 microcontroller
In the use of single-chip microcomputer, unsigned int occupies 2 bytes, unsigned char occupies 1 byte. Single-chip microcomputer implements byte addressing. 16-byte bit addressing is really not easy to use. It is not useful because it cannot create arrays. In the actual development process, DPTR, as well a
[Microcontroller]
How to access bytes in int in 8051 microcontroller
Design of Switched Reluctance Motor Drive System Based on Single Chip Microcomputer
1 Introduction The switched reluctance motor is a control device composed of a reluctance motor and an electronic switch drive controller, also known as a switched reluctance motor drive system (Switched Reluctance Motor drive, referred to as SRD). The motor has a simple and sturdy structure and reliable operat
[Microcontroller]
Design of Switched Reluctance Motor Drive System Based on Single Chip Microcomputer
Application of C504 microcontroller in stepper motor control
    Abstract: C504 is a single-chip microcontroller produced by the German SIEMENS company. This article introduces the application of C504 single-chip microcomputer in stepper motor control, and gives a method of using the resource advantages of C504 to control stepper motors through certain expansions. Control syst
[Industrial Control]
Analysis of Anti-interference Performance of Single Chip Microcomputer
  Friends who have worked on products all have experienced this: a design may seem simple, and the hardware design and code writing can be completed quickly, but there are more or less unexpected events during the debugging process. These are all manifestations of insufficient anti-interference capabilities.   Let’s
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号