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.

Help me with voltmeter code for PIC16f876

Status
Not open for further replies.
Re: pic16f876 voltmeter

Q1. How is the PCB laid out (sounds like a niose problem to me)
R1. Now is not good because of changing components and circuit and has some wire circuit. I have to rebuild it
Q2. Have you got some 100NF decoupling caps in the 5V line ad one right by the pic
R2. What do you mean by "ad one right by the pic" - Sorry for my bad english ! (100nF to put where ?). I have 100nF between GND and pic input - that is your question ?
Q3. have you got some smothing caps accross the 5V supply
R3. I have 100nF, do I need a bigger caps ?
Q4. How are you tapping in to the power supply to measure the voltage aslo is the
voltag going into the PIC stable
R4.I have measured with a multimeter and it is stable.
 

Re: pic16f876 voltmeter

Q3. have you got some smothing caps accross the 5V supply
R3. I have 100nF, do I need a bigger caps ?

Yes and I would add a 10uF or a 47uF accross the supply. You put a cap close to the PIC 5V and PIC GND. I double checked mine to today on my power supply and it was stable. PCB layout needs some consideration has this can have an effect your getting, I'm not saying it is that though.

I will try and think some more
 

Re: pic16f876 voltmeter

wizpic said:
Q3. have you got some smothing caps accross the 5V supply
R3. I have 100nF, do I need a bigger caps ?

Yes and I would add a 10uF or a 47uF accross the supply. You put a cap close to the PIC 5V and PIC GND. I double checked mine to today on my power supply and it was stable. PCB layout needs some consideration has this can have an effect your getting, I'm not saying it is that though.

I will try and think some more

Thanks for info. I'll make another pcb with modification for caps and for divisor input.
 

Re: pic16f876 voltmeter

Made another pcb and readings (without load) is good , but when I connect the load stability problems appear
Next thing is to modify the code for multiple reading and make average for displaying.

That's correct ?
 

Re: pic16f876 voltmeter

try this code modified from your first posting not checked the LCD part
 

Re: pic16f876 voltmeter

rajudp said:
try this code modified from your first posting not checked the LCD part

Tried but didn't work - it show only blocks (first line)
 

pic16f876 voltmeter

i used lcd.c send flex_lcd.c i will compile with that and send
 

Re: pic16f876 voltmeter

Here is the file
============================
 

Re: pic16f876 voltmeter

check now compiled with new header file
 

Re: pic16f876 voltmeter

rajudp said:
check now compiled with new header file

1. Very stable
2. for amps calculation you use
"amps_read = (float)(amps * 3)/1023;"
or
"amps_read = (float)(amps * 51)/1023;"

I have 0.1 ohm resitor in series with ground and I measure voltage dropout and write to lcd as amps. Max amps output is 3A. but if I put that value 60-70mA instead of 3A that why I put here 51 instead of 3.
Can you send me the source file ?
 

pic16f876 voltmeter

i used this one
amps_read = (float)(amps * 3)/1023

you make a op-amp dc amp with gain of 10-20 for amp measure
 

Re: pic16f876 voltmeter

Can you build another hex with this one ?
"amps_read = (float)(amps * 51)/1023;"

Tks
 

Re: pic16f876 voltmeter

here is with amps_read = (float)(amps * 51)/1023
 

Re: pic16f876 voltmeter

Rajudp - What did you do for stability ?
 

pic16f876 voltmeter

i just read adcs for several times and take the average of that

Added after 2 minutes:

since the hardware is not with me here i read it for 500 times and taken average
 

Re: pic16f876 voltmeter

birlan97 said:
Rajudp - What did you do for stability ?

Did this work ?

Does it take a second or so to play catch up. I read mine 64 times and I found anymore than that it slowa the PIC down due it working out the average
 

pic16f876 voltmeter

it will update more than three times a second
 

Re: pic16f876 voltmeter

It's working fine now
 

Re: pic16f876 voltmeter

birlan97
Can you try this one as well so I can compare it against your version you have running

For the amps 0-70MV = 0-4.76 amps

Let e know how it goes

May be read it 150 or 300 times this should make more readings in a second
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top