PDA

View Full Version : Measure the voltage of my rc batteries



ngeronikolos
- 9th February 2006, 11:34
Hello guys,

I am looking for a way to measure the battery voltage (0-12v) using pic16f628.I search in the forum and I find the way using a POT and ADC pin.

My PIC does not have ADC!!!!

Any other suggestion?

Thsnks

@sda
- 9th February 2006, 15:43
Hi,
Take a look here :
http://www.picbasic.org/forum/showthread.php?t=5327

But my penny's worth, either go for an external ADC or choose a PIC with ADC's.

Regards,
sda

Acetronics2
- 9th February 2006, 17:38
Hi, N'geron

there's a way to do it with a simple 16F84 an the RC Time command ...

look :

first : connect a resistor between your voltage to be mesured and the input port. a capacitor between input and ground.

second : make your input a 0 v ... output

Third: make the input ... an input with RCTime and measure the time to go up from 0v to the pic transition input voltage (1.5v) ...

so, time = - RC Log ( 1.5/ Vbatt ) ...

a small lookdown table will easily translate time to voltage, if needed.

of course, you must reduce your batt voltage to fit into the 0 - 5 volts range or use a zener not to exceed the Pic input range.

not so precise as an ADC ... but useful here.

Alain

Darrel Taylor
- 9th February 2006, 21:36
Hi ngeronikolos,

Another way might be to use the Comparator Module of the 628.

After reducing the voltage with a pair of resistors, apply it to 1 input of a comparator.

Then using PWM output on another pin (filtered with a resistor and capacitor), adjust the DutyCycle to control the analog voltage being applied to the other comparator input.

Then when the comparator changes state, you know what voltage it was at.

Not the best resolution, but it should be good enough to tell if the battery's getting Low or not.
<br>

ngeronikolos
- 10th February 2006, 07:59
Goodmorning boys,

I have just bought an etxternal ADC tlc549 8Bit resolution A/D converter.
Can you please let me know whickh is the next step?

Two resistors connected in Series,one point connect to the Supply to be measured and the other to Vss (0v).The junction to the ADC.

Please can someone help me?