Digital Voltmeter Using PIC Microcontroller
Digital Voltmeter Using PIC Microcontroller
This blog is dedicated for Embedded Projects and Tutorials. ARM, AVR, PIC, 8051, Arduino Projects and
Tutorials are discussed here.
SHARE
Labels
Digital Voltmeter
Embedded
This is a simple voltmeter which measures 0-5V at a precision of 4.8
Embedded Project
mV. This is a simple design using inbuilt ADC of PIC 16F877A. PIC Microcontroller
16F877A have 8 channel 10bit ADC. Measured voltage is displayed on Microcontroller Project
PIC
Using one of the most popular 8 bit PIC 16f877A, for instance, reading the datasheet,
pic ADC
we'll nd that the ADC modules (10 bit) are controlled by four different registers. The
pic project
rst two, ADCON0 and ADCON1, are used to set and start the ADC module. When high
PIC Voltmeter
level language is used, the programmer doesn't need to care a lot of the register
Real Time Monitoring
connected to the results because they are normally stored in a variable by a routine of
The ADCON0
- bit6 and bit 7 are used to set the frequency of the conversions.
- bits 3, 4 and 5 are used to select the pins of the microcontroller enabled to
theadc conversions.
Regarding the second register, ADCON1, it must be set for two reasons: to select the
format of the result value (bit 7), to select (bit0...bit3) the reference voltage and to set
the port con guration control bits according to the following table
EMBEDDED SYSTEMS BLOG SEARCH
This circuit uses AN0 channel of ADC. The voltage conversion is employed in a logic,
16F877A have 10 bit ADC. That is, it can have 1024 levels. Reference voltage is xed at
0 5 V Analog I/P is mapped to one of the 1024 levels (0-1023 Digital Count)
ADC module of PIC Microcontroller converts the Signals on its analog pin to 10
bit binary data and it has so ware selectable high and low voltage reference
input to some combina on of VDD, VSS, RA2 and RA3. The analog input to PIC
is limited to 0 to 5.The converted value is in mV. It is then converted to volts and
displayed on LCD.
Circuit
/**********************************************/
/*
http://www.facebook.com/EmbeddedProjects
http://microcontrollerprojects00.blogspot.in/
Author: Vishal K M
uC:16F877A
Compiler: mikroC
Crystal freq: 4MHz
*/
/**********************************************/
// LCD module connections
sbit LCD_RS at RC0_bit;
sbit LCD_EN at RC2_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
void main() {
TRISA=0xFF;
ADCON0=0x01;
ADCON1=0x0E;
Lcd_Init(); // Initialize
LCD
do {
temp = SYSTEMS
EMBEDDED ADC_Read(0);
BLOG // Get 10-bit results of AD SEARCH
conversion
temp=temp*5000/1023; //Convert ADC value to mV
digit[0]=(temp/1000)+48;
digit[2]=((temp%1000)/100)+48;
digit[3]=(((temp%1000)%100)/10)+48;
digit[4]=(((temp%1000)%100)%10)+48;
LCD_Cmd(_LCD_CLEAR);
LCD_Out(1,1,digit);
//Carriage Return
Delay_ms(500);
} while(1);
}
SHARE
EMBEDDED SYSTEMS BLOG SEARCH
8commentaires
Ajouter un commentaire
1 Rpondre
Mruthyunjaya B il y a 11mois
Search in eda
Traduire
1 Rpondre
Sameer il y a 4ans
May I know which software you used to draw circuit and simulation?
SHARE MORE
SHARE MORE
SHARE MORE
About Me
Vishal Kottarathil
Suivre 320
VISIT PROFILE
Archive
Labels
Report Abuse
EMBEDDED SYSTEMS BLOG Powered by Blogger
SEARCH
Embedded Projects