You are on page 1of 7

EMBEDDED SYSTEMS BLOG SEARCH

EMBEDDED SYSTEMS BLOG SEARCH

This blog is dedicated for Embedded Projects and Tutorials. ARM, AVR, PIC, 8051, Arduino Projects and
Tutorials are discussed here.

Digital Voltmeter using PIC


Microcontroller

January 25, 2013

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

16x2 LCD display. MikroC

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 language itself (adc_read, for instance, using mikroc).

The ADCON0

As we can see this registers are 8 bit registers where.

- 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.

- bit 2 represents the status of the conversion procedure.

- bit 0 starts the conversion.

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)

Resolu on = 5/(1024) (as it is 10 bit ADC)


= 5/1024

= 4.8828 mV It means that for a change in 4.8828mV, the binary output


changes by 1.

For More Details See

PC Based Digital Voltmeter Using PIC 16F877A

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

Digital Voltmeter using PIC Microcontroller


EMBEDDED
Code SYSTEMS BLOG SEARCH

/**********************************************/
/*

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;

sbit LCD_RS_Direction at TRISC0_bit;


sbit LCD_EN_Direction at TRISC2_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
// End LCD module connections

unsigned long temp;


unsigned int i;
char digit[]="0.000 VOLTS";

void main() {

TRISA=0xFF;

ADCON0=0x01;
ADCON1=0x0E;

Lcd_Init(); // Initialize
LCD

Lcd_Cmd(_LCD_CLEAR); // Clear display


Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
LCD_Out(1,1,"EMBEDDED");
LCD_Out(2,1,"PROJECTS BLOG");
Delay_ms(1000);

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);
}

Download Project Files

LABELS: DIGITAL VOLTMETER, EMBEDDED, EMBEDDED PROJECT, MICROCONTROLLER,


MICROCONTROLLER PROJECT, MIKROC, PIC, PIC ADC, PIC PROJECT, PIC VOLTMETER, REAL TIME
MONITORING

SHARE
EMBEDDED SYSTEMS BLOG SEARCH
8commentaires

Ajouter un commentaire

Top des commentaires

T V S R PRASAD il y a 1an - Partag en mode public


need for pic 16f72 sine wave inverter ups
Traduire

1 Rpondre

Mruthyunjaya B il y a 11mois
Search in eda
Traduire

Crown Electronic Systems il y a 1an (modi ) - Partag en mode public



Crowntnm is Manufacturer and Supplier High Voltage Breakdown Tester, DC regulated power supply, Digital Micro Ohm Meter & LED Testing Instruments provider in Del
We are best online DC regulated power supply, Multi function Meter, Digital Measuring Instruments. www.crowntnm.com
Traduire

1 Rpondre

ella asley il y a 3ans



Nice information.Generally in <a href="http://www. nalyearprojects.in" rel="nofollow">College nal year projects</a>, Digital Voltmeter is used to measure voltage. 8051
voltmeter and A/D converter are the main components of the digital voltmeter. The circuit diagram clearly depicts the concept of signal conversion through PIC Microco

Vishal Kottarathil il y a 3ans



@Muhammad I dont know Hindi well please write in English. If the reading shown is 0.000 make sure that the program enter in do-While Loop, make sure ADC con g is
and make sure ADC read something. There is another version of it USing PC is published here check it also

Muhammad Muqeem il y a 3ans


yar ye jo code likha hua hy is se 000.000 ki velu show krva dy aor ye program PIC16F676 ka ley compile krva dy main os ka bahot shukria ada kron ga main programm
hy
thora thora samjhta ho ap logo ki mehrbani ho gi reply is email par kr dain muqeemcsk@gmail.com Code /**********************************************/ /*
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_
LCD_D6 at RD6_bit; sbit LCD_D7 at RD7_bit; sbit LCD_RS_Direction at TRISC0_bit; sbit LCD_EN_Direction at TRISC2_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit
LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD7_bit; // End LCD module connections unsigned long temp; unsign

Sameer il y a 4ans
May I know which software you used to draw circuit and simulation?

alain frenois il y a 4ans


superbe rationalisation

Popular posts from this blog

PIC Microcontroller Based


Electronic Lock
March 01, 2012
EMBEDDED SYSTEMS BLOG
Circuit Diagram SEARCH

Security is a prime concern in our day-today life. Everyone

wants to be as much secure as possible. An access control for

SHARE MORE

PIC Serial Communication


Tutorial (UART)
March 24, 2012

First, a quick history of RS232. What is RS232? It's just a name

for a standard that has propagated from generation to


generation of computers. The rst computers had serial ports

that used RS232, and even current computers have serial

SHARE MORE

Electronic Voting Machine


Using 8051 Microcontroller
(AT89C51)
March 16, 2012

SHARE MORE

About Me

Vishal Kottarathil
Suivre 320

VISIT PROFILE

Archive

Labels

Report Abuse
EMBEDDED SYSTEMS BLOG Powered by Blogger
SEARCH

Embedded Projects

You might also like