Protues simulation design of two-way digital voltmeter based on 51 single-chip microcomputer

       Digital voltmeter, referred to as DVM, is a voltmeter designed with digital measurement technology. From the point of view of performance: the development of digital voltmeters has changed from the accuracy of four-digit tube digital voltmeters to one-thousandth in 1952 in NLS Corporation of the United States, and now 8-digit digital voltmeters have appeared. Parameters can measure DC voltage, AC voltage, current, impedance, etc. The degree of automation of measurement is continuously improved, and it can cooperate with the computer to display, calculate the results, and then print them out. At present, the American FLUKE company in the world is at the international advanced level in the field of calibration of DC and low-frequency AC power. For example, the "4700A" multi-function calibrator and "8505" crisis digital multi-purpose voltmeter produced by the company can be displayed in 8 digits, the DC accuracy can reach ±5/10-6, and the reading resolution is 0.1μV. With A/D conversion mode, data output interface form IEEE-488. With ratio measurement software calibration and with AC resistance, current options. It also has high-precision voltage calibrator "5400A", "5200A", "5450A" and other digital instruments, all of which are standard instruments used as primary metering stations and national metering stations. There is also the British "7055" digital voltmeter that uses pulse modulation technology. The "2501" type of Yokogawa Corporation of Japan adopts three-time sampling and so on, and is constantly developing vigorously.

        From the perspective of development process: since the digital voltmeter came out in 1952, it has a development history of more than 50 years, and roughly experienced five generations of products. The first generation product is the electronic tube digital voltmeter that came out in the 1950s, the second generation product belongs to the transistor digital voltmeter that appeared in the 1960s, and the third product is the medium and small-scale integrated circuit developed in the 1970s. Digital voltmeter. This year, digital voltmeters and intelligent digital voltmeters composed of large-scale integrated circuits (LSI) or very large-scale integrated circuits (VLSI) have been launched successively at home and abroad, which belong to the fourth and fifth generation products respectively. They not only created a precedent for electronic measurement, but also are favored by the people for their excellent characteristics such as high accuracy, high reliability, high resolution, and high cost performance.

       As a branch of voltmeter, digital voltmeter has been greatly developed in the past fifty years. The core components of digital voltmeter have entered the stage of large-scale ASIC (application-specific integrated circuit) from early small and medium-scale circuits. The scope of digital voltmeter has also expanded from traditional measurement to automatic control, sensing, communication and other fields, showing a broad application prospect.

       The design ideas of traditional voltmeters are mainly divided into: voltmeters composed of ammeters and resistors; voltmeters composed of small and medium-sized integrated circuits; voltmeters composed of large-scale ASICs (application-specific integrated circuits). These voltmeter design methods have their own advantages and disadvantages, and are suitable for several specific application environments. At the same time, they are also used for reference and basis for the design of many novel voltmeters.

       In the 21st century, with the rapid development of information technology, the voltmeter will also experience the process of transition from single measurement to data processing, automatic control and other functions, especially the development of computer technology will inevitably appear intelligent technology. Therefore, the intelligent voltmeter combining voltmeter and computer technology will become a new topic in the 21st century. At present, digital instruments and microprocessors have made remarkable progress. As far as its technical background is concerned, an instrument with a built-in microprocessor means the transplantation of computer technology to instruments. Its software functions make the instrument appear There is a kind of extension, strengthening effect. Compared with the traditional, pure hardware instruments in the past, this is a new breakthrough, and its development potential is very huge, which has been confirmed by the history of instrument development since the 1970s. To sum up, the instrument with microprocessor has the following characteristics: ① the software control of the measurement process, the data processing function of storing and calculating the measurement data is the most prominent feature of the instrument; ② the software control and data are integrated in the measurement process of the instrument The processing function makes it easy to realize the multi-function of one machine or the multi-function of the instrument, which has become another feature of this type of instrument; ③The intelligent instrument with its software as the main body not only presents great flexibility in terms of convenient use and diversified functions .

1.2. The meaning and purpose of the subject

        Digital voltmeter is the core and foundation of many digital instruments. With the digital voltmeter as the core, it can be expanded into various general digital instruments, special digital instruments and various non-electrical digital instruments (such as: thermometer, hygrometer, acidity meter, weight, thickness meter, etc.), covering almost all electronic and electrician Measurement, industrial measurement, automation instrumentation and other fields. In addition, digital voltage has incomparable advantages over traditional pointer voltmeters: intuitive and accurate readings, wide display range, high resolution, high transfer impedance, low power consumption, strong anti-interference, etc. [3]. Therefore, it is necessary to have a comprehensive and in-depth understanding of digital voltmeters. However, the traditional digital voltmeter design usually uses a large-scale ASIC (application-specific integrated circuit) as the core device, supplemented by a small number of medium-scale integrated circuits and display devices. However, this design method has poor flexibility and fixed system functions, making it difficult to update and expand. Can not meet the growing electronic industry requirements [6]. The digital voltmeter using a microprocessor (single chip microcomputer) as the core unit has high flexibility, simple system function expansion, and stable and reliable performance. Under these backgrounds, it is very meaningful to design a digital voltmeter based on single-chip microcomputer, simple in structure, reliable in operation and good in flexibility.

Two, realize the function

      This design uses AT89C51 chip and ADC0809 chip to complete a simple digital voltmeter, which can measure the input analog DC voltage of 0-5 V and display it on the LCD1602 liquid crystal display screen. The measurement error is about 0.02 V. The measurement circuit of the voltmeter is mainly composed of three modules: A/D conversion module, data processing module and display control module. The A/D conversion is mainly completed by the chip ADC0809, which is responsible for converting the collected analog quantities into corresponding digital quantities and then sending them to the data processing module. The data processing is done by the chip AT89C51, which is responsible for processing the digital quantity transmitted by the ADC0809, generating corresponding display codes and sending them to the display module to display in percentage form. In addition, it also controls the work of the ADC0809 chip.

3. Simulation demonstration

The actual voltage value of channel 0 is 2V, accounting for 40%, the measured voltage value accounts for 39%, and the error is 1%; the actual voltage value of channel 1 is 2.5V, accounting for 50%, the measured voltage value The value accounts for 49 percent, and the error is 1 percent;

Change the voltage value of the two channels, the actual voltage value of channel 0 becomes 4V, the measured voltage value accounts for 79%, and the error is 1%; the actual voltage value of channel 1 is 1V, and the measured voltage value accounts for 100%. 19, the error is 1 percent;

4. Some program display

#include "reg52.h" 
#include "intrins.h"
#include "LCD1602.h"

uint8 i;
fp32  volt0,volt1; 
uint8 getdata; 
uint8 dispbuf[8]={10,10,10,10,10,0,0,0};  //存放ad采集过来的值(只有最后3位有用)

uint8 table2[7]="CH0:  %";
uint8 table1[7]="CH1:  %";

sbit ST=P3^0; //是否选中该芯片
sbit OE=P3^1; //所存转换的值
sbit EOC=P3^2; //当EAC数据有效时,将转换数据送出
sbit CLK=P3^3; //给adc0809提供时钟

sbit Re1=P3^4;
sbit Add_A=P3^5;
sbit Add_B=P3^6;
sbit Add_C=P3^7;

void Timer0Init(void)
{  
	TMOD=0x12;//设置定时器0和1的工作方式  
	TH0=216; 
    TL0=216; //设置定时器0的初值为216(为adc0808提供时钟)
    ET0=1; //启用定时器0
    TR0=1;  //开定时器0  
	EA=1;    //开总中断
}

void Timer0Service(void) interrupt 1 using 0           //定时器0中断服务
{ 
  CLK=~CLK;  //给adc0809提供时钟
}

Simulation source file and source program Baidu network disk link: https://pan.baidu.com/s/1Brkqf2MvjgSEjD2cs0mCPw 
Extraction code: 099h 

Guess you like

Origin blog.csdn.net/weixin_53402301/article/details/130895390