Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Voltmeter with PIC16F877 and LCD

Status
Not open for further replies.

tyro

Newbie level 5
Joined
May 11, 2004
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
92
pic16f877a voltmeter

I want to measure 2 voltages (~12V & 5V) with a PIC16F877 on an 16x2 LCD at the same time.

Is that possible?

Are there 2 A/D channels for the voltages.

Thank You
 

pic16f877 voltmeter

Hi Tryo

yes you can measure up to 4 voltages on the pic16f877 but rember that max input on pic is 5v to measure 12v you will have to use a resistor devider network so you dont exceed 5v and use the software to compensate for voltage loss (i.e input * 10 so 1.2V fed into pic through resistor net work would read 12V on lcd you can even display it like this 12.345V so going through resistor net work you could measure upto 30V

snaper
 

Re: pic16f877 voltmeter

Hello every one!!
I want to measure mili volts from pic and want to display on lcd. can any one help me.
I am using mikroc and pic16f877a.
My code can measure voltages upto 0.05 but not upto 0.005v.

Here is my code in c:

unsigned long adc_value;
unsigned char d1,d2,d3,d4;
#define printV lcd_chr(2,11,48+d1); lcd_chr_cp(d2+48); \
lcd_chr_cp('.'); lcd_chr_cp(48+d3); \
lcd_chr_cp(48+d4); lcd_chr_cp('V');


#define calcV d1=adc_value/1000; d2=(adc_value/100)%10; \
d3=(adc_value/10)%10; d4=adc_value%10;

void main()
{
ADCON1=0b10000010;
TRISA=0XFF;
LCD_Config(&PORTB,2,1,0,7,6,5,4); // RS,E,W,D7..4
LCD_Cmd(LCD_CLEAR);
LCD_Cmd(LCD_CURSOR_OFF);
LCD_Out(1,1,"V1.00 : ADC Read");
delay_ms(200);

lcd_out(2,1,"voltage:");
for(;;){
adc_value=ADC_Read(0);
adc_value=adc_value*500/1023;
calcV
printV
delay_ms(20);
}
}
 

you can use op-Amp to amplify the voltage and later adjust value using software...........like if you have gain of 100 you can do(input/100)
 

Like bijaypaudel said, you could use an op-amp to amplify the input voltage. While measuring such small voltages, it is better first to amplify them and then measure them. You might lower your reference voltage down to 1v or even lower to improve accuracy. What is the intended input voltage range?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top