Circuit Diagram of Digital Voltmeter Using 8051 Microcontroller

Schematic Diagram of Digital Voltmeter With LCD Display Using AT89C51 Microcontroller With Source Code

A digital voltmeter is an electronic instrument that measures the voltage of an electrical signal. It is used in various applications, including in the field of electronics, power systems, and automation. In this article, we will discuss the implementation of a digital voltmeter using 8051 microcontroller.

The 8051 microcontroller is a widely used microcontroller, which is suitable for a variety of applications. It has 4KB of on-chip ROM, 128 bytes of on-chip RAM, 32 I/O pins, and a 16-bit timer. The microcontroller can be programmed in assembly language or in a high-level language such as C.

The microcontroller has several features that make it ideal for use as a digital voltmeter, such as a built-in ADC (Analog-to-Digital Converter) and an 8-bit timer.

If you’re interested in a compact and mini Digital Voltmeter described in the circuit below for general maintenance, troubleshooting and testing electrical/electronic components, you can get one at the following link.

Get Mini Digital Voltmeter

Related Posts:

Components Required

To build a digital voltmeter using 8051 microcontroller, we need the following components:

  1. 8051 microcontroller (AT89C51).
  2. LCD display – (7 Segment 4 Digit).
  3. Analog-to-Digital Converter (ADC0804 IC).
  4. Voltage Sensor (25V).
  5. Battery or DC Adaptor.
  6. Microcontroller Programming Board.
  7. Crystal Oscillator = 12MHz.
  8. 3 Nos. of Resistors = 10kΩ.
  9. 4 Nos. of Capacitors = 2 of 33pF, 1 of 150pF and forth one as 10µF/16V.

Circuit Diagram

Click image to enlarge

Digital Voltmeter Circuit Diagram Using 8051 Microcontroller

Overview of the Circuit:

The circuit for the digital voltmeter using the 8051 microcontroller consists of several components such as the 8051 microcontroller, LCD display, voltage divider network, and a few other passive components. The voltage divider network is used to reduce the voltage to a level that can be read by the microcontroller.

Voltage Divider Circuit (ADC0804 IC)

The voltage divider circuit is used to increase the ADC range of input signal to 25V or step down the input voltage to a safe level, which can be measured by the microcontroller. The potentiometer is used to adjust the voltage range of the voltmeter. The ADC is used to convert the analog voltage signal into a digital signal, which can be displayed on the LCD display.

The voltage divider circuit consists of two resistors, R1 and R2, connected in series. The input voltage is applied across the series combination of R1 and R2, and the output voltage is taken across R2. The ratio of R2 to (R1+R2) determines the output voltage. We can adjust the output voltage range by varying the values of R1 and R2.

The ADC converts the analog voltage signal into a digital signal by comparing the input voltage with a reference voltage. The resolution of the ADC depends on the number of bits used in the converter. For example, an 8-bit ADC can measure a voltage range of 0-5V with a resolution of 19.53 mV per step.

The software for the digital voltmeter is written in assembly language or in C language. The software reads the voltage signal from the ADC, converts it into a digital value, and displays it on the LCD display. The software can also be programmed to implement additional features, such as peak voltage measurement, voltage averaging, and voltage logging.

To summarize, a digital voltmeter using 8051 microcontroller is a simple and cost-effective solution for measuring voltage signals in various applications. It requires a voltage divider circuit, an ADC, a potentiometer, and an LCD display. The microcontroller can be programmed in assembly language or in C language to implement additional features.

Working of the Circuit:

The voltage divider network is made up of two resistors in series. One of the resistors is a potentiometer that can be adjusted to calibrate the voltmeter. The output of the voltage divider network is connected to the analog input pin of the microcontroller. The microcontroller uses its built-in ADC to convert the analog voltage to a digital value.

The digital value is then displayed on the LCD display. The LCD display is connected to the microcontroller through a digital interface. The microcontroller sends the digital value to the LCD display, which then displays it in a readable format.

The programming for the microcontroller involves initializing the ADC, reading the analog voltage, converting it to a digital value, and then sending it to the LCD display. The microcontroller continuously reads the voltage and updates the display.

How to Program the Microcontroller AT89C51 for Digital Voltmeter?

The process described above outlines the steps to test a circuit that has already been programmed and built (Circuit diagram and project code is given below). Here are the steps compared and explained in more detail:

Programing Code:

#include
#define lcd P3
#define dat P2
sbit rs=P1^6;
sbit e=P1^7;

void delay (int);
void display (unsigned char);
void cmd (unsigned char);
void init (void);
void string (char *);
void intro (void);
char i=0;

void delay (int d)
{
unsigned char i=0;
for(;d>0;d--)
{
for(i=250;i>0;i--);
for(i=248;i>0;i--);
}
}
void cmd (unsigned char c)
{
lcd=c;
rs=0;
e=1;
delay(10);
e=0;
}
void display (unsigned char c)
{
lcd=c;
rs=1;
e=1;
delay(10);
e=0;
}
void string (char *c)
{
while(*c)
{
display(*c++);
}
}
void init (void)
{
cmd(0x38);
cmd(0x01);
cmd(0x0c);
cmd(0x80);
}
void intro (void)
{
string(" Electronics ");
cmd(0xc0);
string(" Hub ");
delay(2000);
cmd(0x01);
string(" Digital ");
cmd(0xc0);
string(" Voltmeter ");
delay(2000);
cmd(0x01);
cmd(0x80);
}

void main()
{
unsigned int temp=0;
unsigned int temp1=0;
float val=0.0;

init();
intro();
dat=0xff;
while(1)
{
if(i==0)
{
string(" Volts - ");
i++;
}
val=dat*0.02; // 0.02 is resolution of adc
val=val/0.2; // 0.2 is nothing but (R2/(R1+R2)) resistor values in the voltage sensor
cmd(0x89);
if((val>=1.0) && (val<10.0)) { display(' '); temp=val*1000; temp1=((temp/1000)+48); display(temp1); display('.'); temp1=(((temp/100)%10)+48); display(temp1); } else if((val>=10.0) && (val<100.0))
{
temp=val*100;
temp1=((temp/1000)+48);
display(temp1);

temp1=(((temp/100)%10)+48);
display(temp1);

display('.');

temp1=(((temp/10)%10)+48);
display(temp1);
}
else
{
display(' ');
string("0.0");
}
delay(1000);
}
while(1);
}

Advantages of Digital Voltmeter using 8051 microcontroller:

1. The digital voltmeter is more accurate and precise than analog voltmeters.
2. The microcontroller can be programmed to perform other tasks besides measuring voltage.
3. The digital display is easy to read and interpret.
4. The circuit is simple and inexpensive to build.
5. The voltmeter can be powered using batteries, making it portable and easy to use in the field.

Limitations

Want one Mini Digital DC Voltmeter for General purpose Applications? Get One below

Get Mini Digital Voltmeter

Related Posts:

Exit mobile version