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.

[SOLVED] PIC Volt Meter and Battery Charging Techniques

Status
Not open for further replies.

d@nny

Full Member level 5
Full Member level 5
Joined
May 28, 2011
Messages
246
Helped
11
Reputation
22
Reaction score
11
Trophy points
1,298
Activity points
3,238
Please help me with providing some start with pic dc volt metre?
 

I think first of all your PIC should powered from a battery to have floating VSS compared to measurment point.
(ie you want to measure voltage on a resistor one side of the resistor is 3V other side is 1V, then you must attach your PIC device VSS (negative vref) to 1V side). To achieve such a floating point a battery usage is necessary i think.
On the other hand you should decide how to measure greater voltage levels like 24V with your 5V supplied pic. You need to use resistive voltage dividers probably (like manual adjustment on low cost multimeters). Some multimeters adjust it automatically i don't know how they do that. May be some experts can give an idea on it.
You chould consider a high voltage protection not to damage your PIC, unfortunately i have no idea. :(
I am wondering also possible solutions from other firends.
Good luck
 
i just want to use it with inverter for 12 or 24 volt battery monitoring
it will be on with same inverter battery using 7805
 
i just want to use it with inverter for 12 or 24 volt battery monitoring
it will be on with same inverter battery using 7805
This makes every thing different. When i read "dc voltmeter" i think you plan to implement somethink like a commercial voltmeter. Anyway..
In this case use a fixed resistor divider from 24V to some volatge value below your Vcc (ie. 4V letting some headroom for ADC).
Reading ADC values around that value means your battery is full and so on...
 

This makes every thing different. When i read "dc voltmeter" i think you plan to implement somethink like a commercial voltmeter. Anyway..
In this case use a fixed resistor divider from 24V to some volatge value below your Vcc (ie. 4V letting some headroom for ADC).
Reading ADC values around that value means your battery is full and so on...

no no no
not only full
i can do this with comparator as i have did it
i want to show the accurate voltages left into the battery
can i do this using pic and adc
the actual problem is getting linear voltage changes for the adc
 
circuit.GIF

3 digits Digital volt meter
 

Attachments

  • meter.jpg
    meter.jpg
    9.3 KB · Views: 542
  • meter_b.jpg
    meter_b.jpg
    9.4 KB · Views: 548
  • meter.zip
    27.8 KB · Views: 508
Last edited:
actually this technique is not providing linear values for change in voltages and eid mubarak.
Which one universal programmer u used for burning pics?
GENIUS G540 a chinese programmer is suitable.
Easy avail in local market near Rs,4500
Regarding dc volt meter for battery of your inverter, i hope this board from alertlink is best.
Although pcb is dual printed,very small in size and you can also fix in side of inverter,s cabinet.
 

I'm still not sure I understand the problem. Use the PIC with an external reference and a voltage divider as required (as suggested by emresl). Where is the problem getting linear voltage?
 

first 3 to 5 values are ok and matched with multimetre but than difference and as the battery get discharged the voltages differ so much
si i have searched and found some icl numbers icl 7206 something
 

Hi danny, first of all Eid Mubarak to you as well.

Now. You just want to measure voltages of 12V battery and 24V battery and no current monitoring right?

Well its fairly simple. But first know that 24V is not the limit. when you charge the 12V battery, the charging voltage is say 15v for 24V battery its 30V, and most battery even give 12.7v-13.3v of voltage on no load. 2x for 24v batteries. so at least your system should measure upto 30v Minimum. I hope u may know about ADC and you probably going to use ADC 0804 or ADC0808 if more than one voltage levels are to be measured. Both are 8-bit ADC. means you have 256 samples. and you need to divide them evenly so it gives you a linear change.

If you need 0.1V accuracy and that is the least u can get form 8-bit ADC, you have to assign 0.1V/bit. That will give voltage up to 25.5V as [256-1]/10. So how to expend this range?

Same thing i making right now. here is the link for how you can achieve it.

https://www.edaboard.com/threads/223049/

There is another way. since a 12V battery can be discharged down to 10 or max 8V so why to waste lower bits. Since i have to measure current also down to 0mA so i can't implement this. First make a Voltage divider network of 7.5K and 1.5K resistors. Voltage is to be measured across 1.5K. At 30V you will have 5V on the network. As you need 25.5V to divide 255bits evenly, for that you are now measuring form 4.5V - 30V (30-4.5=25.5). At 4.5V you voltage division network will give 0.75V. So a constant 0.75V is to be fed at Vref(-) of the ADC. Now you just bring the ADC value to your controller suppose its 128, this means you have voltage 12.8+4.5 = 17.3V where 4.5V was the offset.

You can add one useful thing in your circuit. i.e. Turn on charging when batteries are detected and that is what i am going to do. if when i connect the batteries and its voltage is between 10-13v or 20-26V, my charging will start else not. This will protect my charging terminals for accidental shortening.

Any question...just Ask...xD
 

I have genius 540 universal programmer.It was cheapest programmer in market, Rs 4500.I bought it last year, no problem until now. Device support list here
**broken link removed**
**broken link removed**
It also includes ic tester. Ten years back i made david trait's programmer myself.I used only pic16f84 then.
I am planning to make pickit2 lite clone now. it will cost around 1000.support many pics including pic676 and pic16f72 and debugging facility also.
ICL7107 ic is available easily, used in bench power supplies. You can make voltmeter yourself. here is link.
ICL7107 / ICL7106 - Digital Voltmeter
Eid mubarak to you too.
this technique is not providing linear values for change in voltages
Please explain, did you compaired with other digital volt meter.
 
Last edited:

I have genius 540 universal programmer.It was cheapest programmer in market, Rs 4500.I bought it last year, no problem until now. Device support list here
**broken link removed**
**broken link removed**
It also includes ic tester. Ten years back i made david trait's programmer myself.I used only pic16f84 then.
I am planning to make pickit2 lite clone now. it will cost around 1000.support many pics including pic676 and pic16f72 and debugging facility also.
ICL7107 ic is available easily, used in bench power supplies. You can make voltmeter yourself. here is link.
ICL7107 / ICL7106 - Digital Voltmeter
Eid mubarak to you too.

Please explain, did you compaired with other digital volt meter.

Yar please koi online site btaoo like electronicspk who sold this online?
I really need some cheapest pic like 16f72 and programmer
or if u can also shop for me when going to market and send it to your friend with bill
i am also ready to pay in advance
so discuss it after eid
bye
 

Dont trust your digital meters. My meter display 14V instead of 12v when battery is nearly exuausted. Now i always check accuracy against a voltage reference. A 7805 delivers 4.98v and the other 5.02v.
 

Dont trust your digital meters. My meter display 14V instead of 12v when battery is nearly exuausted.

It usually happens when Your multimeter 9V battery is ended. Try replacing it with a new one and then check again. Before that measure the voltage using same meter with old 9v battery for comparison.

---------- Post added at 03:00 ---------- Previous post was at 02:59 ----------

Where do you live danny?
 

d@nny
I have the same trouble and understand you what your saying reading the battery has it stands then put a load onto it and the PIC voltmeter reads slighty different to your meter.
I use a fluke 77-4 meter and I get my pic voltmeter to read the same has the fluke meter and then when I apply a load I get about 0.07-0.09 (may be a bit more can't find my readings I wrote sown to be exact) voltage difference in the readings, But my application is the discharged voltage needs to be more accurate than the start voltage so I just calibrated to ture load voltage what is said on my fluke meter.
I am looking into it in more dpeth what casues this becasue my data logger needs to show both start and finsish voltages need to be accurate where at the moment it starts off a lot higher than the battery voltage reads with no load on it but the load is applied the reading are the same.
I've not tried the reading yet if I was to charge the battery with the pic voltmeter connected I will let you know how I get on unless someone could give me ideas what could cause the voltage to differ with a load on it. I know the battery is not flat in my meter and you can trust Fluke meters it reads the same on my unti-70D meter
 
  • Like
Reactions: ggmssr

    ggmssr

    Points: 2
    Helpful Answer Positive Rating
what could cause the voltage to differ with a load on it.
First you have to see what accuracy you are into. For a pic voltmeter you have to cosider adc resolution which in turn limits minimum step of voltage display.There is noise issue in adc, if 10 bit mode is used have to be carefull in software while taking sample.
If readings are taken from different points of battery terminal while there is a load attached due to resistance and voltage drop on terminals and battery clips.
 

d@nny
I have the same trouble and understand you what your saying reading the battery has it stands then put a load onto it and the PIC voltmeter reads slighty different to your meter.

I have used 8052 with adc0808. I get the same value as Voltmeter. The catch here is how you quantize your signal. Fro example if you have to measure 15V with 0.1V accuracy then 256/150=1.7066667 bit per 0.1V. How would you assign 1.7066667 bit? definitely you have to assign 2 bits per 0.1V and some 1bit per 0.1V. Your reading will be varied. Try to pick voltage range which easily divide on your ADC steps.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top