当前位置:网站首页>AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc

AT89C51 MCU digital voltmeter development, measuring range 0 ~ 5V, proteus simulation, schematic diagram, PCB and C program, etc

2022-04-23 14:25:00 Jiang Yuzhi

The design requirements
1. With MCS-51 Series single chip microcomputer as the core device , Design a simple DC digital voltmeter ;
2. Voltage range :0~5V;
3. Minimum resolution :0.01V;
4. Less components are used , The cost is low , And the measurement accuracy and reliability are high ;

System Overview
This design is based on Atmel 51 A digital voltmeter system based on MCU development platform and automatic control principle .

The system adopts AT89C51 Single chip microcomputer as the control core , With ADC0809 Analog to digital conversion chip , Realize range 0 To 5V Sampling of measured voltage data ;LCD1602 Character LCD displays the measured voltage value .

meanwhile , The measurement accuracy of digital voltmeter is 0.01V, It can meet the general measurement requirements , The system framework is shown in the figure below .
 Insert picture description here
Simulation circuit diagram
 Insert picture description here
 Insert picture description here
Schematic diagram
 Insert picture description here
PCB chart
 Insert picture description here
Analysis of simulation results
open Proteus Simulation file , File suffix DSN. Double click the MCU , load DianYa.hex file ( be located C In the program folder ), Run the simulation , The results are shown in the following figure .
LCD Display the voltage value 1.84V
And you can see that ,LCD Show AD Switching channels IN0 voltage (Voltage) The size is 1.84V, use Proteus The software comes with a voltmeter (Volts) The result of the measurement is 1.85V, Both occasionally 0.01V The deviation of , It belongs to the normal phenomenon of simulation .

Slide the rheostat by clicking RP2 Up and down red arrows , Simulate the change of measured voltage value (0~5V Between ),LCD Real time tracking and display of voltage changes .

The figure below shows how to adjust the sliding rheostat ,LCD The displayed voltage value is 4.25V, And Volts The voltmeter shows the same result .
 Insert picture description here
in summary , Digital voltmeter Proteus The running effect of simulation design meets the design requirements .

part C Code

#include"include.h"
#define TIME0H 0x3C
#define TIME0L 0xB0
uchar uc_Clock=0;		// Timer 0 Interrupt count 
bit b_DATransform=0;

void vShowVoltage(uint uiNumber)
{
    
	uchar ucaNumber[3],ucCount;
	if(uiNumber>999)					
		uiNumber=999;
	ucaNumber[0]=uiNumber/100;								// Store each bit of the calculated number in the array .
	ucaNumber[1]=(uiNumber-100*(int)ucaNumber[0])/10;							
	ucaNumber[2]=uiNumber-100*(int)ucaNumber[0]-10*ucaNumber[1];
	for(ucCount=0;ucCount<3;ucCount++)
	{
    
		vShowOneChar(ucaNumber[ucCount]+48);				// Output one by one from the first to the last .
		if(ucCount==0)
			vShowOneChar('.');
	}
}
void main()
{
    
	TMOD=0x01;			// Timer 0, Pattern 1.
	TH0=TIME0H;
	TL0=TIME0L;
	TR0=1;				// Start timer .
	ET0=1;				// On timer interrupt .
	EA=1;				// General interruption 
	vdInitialize();
	vWriteCMD(0x84);	   // Write display start address ( The first line is 4 A place )
	vShowChar("voltage");
	vWriteCMD(0xC9);     
	vShowChar("(V)");
	while(1)
	{
    
		if(b_DATransform==1)
		{
    
			b_DATransform=0;
			vWriteCMD(0xC4);
			vShowVoltage(uiADTransform());
		}
	}
}

Shared content

(1) be based on 51 MCU digital voltmeter design paper complete version ;
(2)C Program ;
(3)Proteus Simulation file ;
(4) Schematic diagram and PCB file ;
(5)Visio flow chart ;
(6) List of components ;
(7) Reference material ;

Content as shown
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here
Say the important thing again !!!

Obtain a complete set of design data of digital voltmeter design !

WeChat search for my official account : Jiaoyuan Xiaozhi

版权声明
本文为[Jiang Yuzhi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231412471956.html