Digital Voltmeter using 8051 Microcontroller: Electronics Projects

A voltmeter is a voltage measuring instrument. We can measure the potential difference between any two points in an electrical network using a voltmeter. Let us design and make a simple voltmeter using 8051 microcontrollers which you can use as a mini-project in your college.

There are two types of voltmeter as analog voltmeter and digital voltmeter. Analog voltmeter moves the pointer on a scale but it has some limitations like the accuracy of few percent of full scale.

Digital Voltmeter using 8051 Microcontroller


In this section, we are going to make a digital voltmeter using 8051 microcontrollers. A digital voltmeter can display the numerical value of the voltage on a display by use of analog to digital converter (ADC). All the data processing and manipulating are in digital form, so it is essential to use ADC. We have used ADC0804 analog-to-digital converter IC. The range of input voltage is 0-15V. Here the input voltage should be DC voltage so as to get the steady output on the LCD display. If you give the AC voltage as an input, it will display continuously running numbers as the nature of AC voltage.

Components required for Digital Voltmeter using 8051 Microcontroller:



  1. Microcontroller,  AT89C51

  2. Analog-to-Digital  Converter,  ADC0804

  3. 16x1  LCD

  4. Oscillator  circuit  for  the  microcontroller

    1. 12MHz  Crystal  Capacitor

    2. 33pF  Capacitors



  5. Voltage  divider  circuit/  Input  terminals

    1. 200k,  100k  Resistors

    2. 100nF  Capacitor



  6. ADC  Clock  Circuit  100k  Potentiometer  (to  adjust  the  back-light  of  the  LCD)

    1. 10k  Resistor

    2. 150pF  Capacitor



  7. 100k  Potentiometer  (to  adjust  the  back-light  of  the  LCD)


Circuit Diagram of Digital Voltmeter using 8051 Microcontroller:








[caption id="" align="aligncenter" width="490"]Digital voltmeter using 8051 micrcontroller Digital voltmeter using 8051 microcontroller[/caption]





Pin description of 16×1 LCD Display








[caption id="" align="aligncenter" width="300"]LCD pin diagram LCD pin diagram[/caption]





























































































Pin  NoNameDescription
1VssGround
2Vdd+5V
3VeeContrast  Adjustment  -2V  to  -5V
4RSRegister  Select
5RW1  -Read,  0- Write
6EEnable  Strobe
7D0Data  Line
8D1Data  Line
9D2Data  Line
10D3Data  Line
11D4Data  Line
12D5Data  Line
13D6Data  Line
14D7Data  Line
15LED+Backlit  LED  +V   Vdd  (Optional  signal)
16LED-Backlit  LED  –V   Vss  (Optional  signal)

C program for digital voltmeter using 8051 microcontroller:


#include <REGX51.H>
#include "lcd.h"
#define adc_port P1              //ADC Port
#define rd P3_7                  //Read signal P3.7
#define wr P3_6                  //Write signal P3.6
#define cs P3_5                  //Chip Select P3.5
#define intr P3_4                //INTR signal P3.4
void conv();                     //Start of conversion function
void read();                     //Read ADC function
unsigned int adc_avg,adc;
void main(){
char i;
LCD_INI();
while(1){                                                              //Forever loop
adc_avg = 0;
for(i=0;i<10;i++){
conv();                  //Start conversion
read();                  //Read ADC
adc_avg += adc;
}
adc_avg = adc_avg/10;
wrt_cmd(0x80);
wrt_string("V(DC): ");
adc = adc_avg * 59;
hex2lcd((unsigned char)(adc/1000));
wrt_data('.');
adc = adc%1000;
hex2lcd((unsigned char)(adc/10));
wrt_data('V');
}
}
void conv(){
cs = 0;                                    //Make CS low
wr = 0;                                  //Make WR low
wr = 1;                                  //Make WR high
cs = 1;                                    //Make CS high
while(intr);         //Wait for INTR to go low
}
void read(){
cs = 0;                                    //Make CS low
rd = 0;                                   //Make RD low
adc = adc_port; //Read ADC port
rd = 1;                                   //Make RD high
cs = 1;                                  //Make CS high
}

C Program:


Click here to download the C program, Hex file and project report of digital voltmeter using 8051 microcontrollers.

http://www.youtube.com/watch?v=MlDrj8A9D7w

You may also like:



If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!