This is a simple project showing you how to make a digital voltmeter of range 0-20V using microcontroller PIC16F877A and a Liquid Crystal Display 16x4 HD44780 LCD in Proteus ISIS.
The microcontroller PIC 16F877A has 8 analog input channels for the in-built 10-bit ADC. In this project AN2 channel of pic16F877A microcontroller is used. ADC module of pic microcontroller converts analog signal into binary numbers. PIC16F877A microcontroller have 10 bit ADC. So it converts analog signal to 10 bit digital number which can be back converted into voltage and displayed on LCD.
You cannot feed 20V directly to a PIC I/O pin, you need a resistor divider network that converts 0-20V range into 0-5 V. A 5.1V Zener diode in the figure is to prevent V3 (V in) to rise above 5.1V if the input voltage goes much above 20V. This will protect the microcontroller.
PIC16F877A microcontroller built in ADC (analog to digital converter) is used to measure analog voltage. The analog to digital conversion isdone by the PIC ADC module. In the code, I’ve used the mikro C library function for ADC. You can view the library file in this link
Code Designing in MikroC Pro For PIC :
So, here’s the programming code you need to use for Displaying voltage value on LCD using PIC Microcontroller in Proteus ISIS:
Compile the PIC code and generate the hex file from it. For simulating with PROTEUS ISIS hit run button and then you will get above output.
So, now we can see the LCD is displaying exactly the same values as are shown in the voltmeter. Now if you change the value of variable resistor RV3 then the value of voltage will change in LCD.
This digital voltmeter using PIC16F877A can read voltage only between 0-20 volt.
You can download the MikroC Source Code and Proteus files etc from this link :
zip file of complete project digital voltmeter using pic16f677A
This Our Group (thanks to join and participate) :this link
Facebook page : this link
Youtube Channel (thanks to subscribe) : this link
BY: SALAH DAHOUATHI
Please ! share this project