PDA

View Full Version : Propeller to measure voltage



xanadu
03-31-2012, 10:37 PM
I have a robot that I'd like to be able to monitor the 12v battery voltage on. The motor controller has all this built in, but I want redundancy built into my telemetry.

I have a couple pins left on the Prop, is there an analog circuit I can build to monitor the battery? It could even be as simple as a High/Low indicator with .5v accuracy.

kwinn
04-01-2012, 01:02 AM
You could use a comparator to indicate good/bad, a dual comparator for good/marginal/bad, or use 2 pins as a sigma/delta adc to get an actual voltage reading.

Leon
04-01-2012, 11:05 AM
Or, interface an I2C ADC.

rwgast_logicdesign
04-01-2012, 11:21 AM
funny i just found this blog yesterday...
http://embeddederic.blogspot.com/ The 3rd and 2nd
post are about building a battery monitor
based on.... Ardunio yuck. Amyways i know
its not analog and maybe a bit overkill, but
maybe itll inspire you. if you go this route
you could just build a quick atmel dev board
to program the chip and then add the chip to your
propboars and communicate via i2c which would save
your prop pins.... let me know if this was helpfull
or if its to much.

Phil Pilgrim (PhiPi)
04-01-2012, 03:45 PM
You could easily do this with a few passives to make sigma-delta ADC. See AN008, the section on extended voltage ranges:


http://www.parallaxsemiconductor.com/sites/default/files/appnotes/AN008-SigmaDeltaADC-v1.0_0.pdf

-Phil

Duane C. Johnson
04-01-2012, 04:06 PM
Hi xanadu;

By far the simplest AtoD is this RC circuit.
91248

1. Set the Pin to output a LOW which discharges the capacitor to near 0 volts.
2. Reset a counter variable.
3. Set the Pin to input which allows the capacitor to start charging up.
4. Watch and count the variable until the Pin reads HI
5. The value in the variable represents the measured input voltage.

OK, this is not linear but using a small look up table you can convert the value into battery voltage.

Keep the resister fairly large to protect the Prop pin from damage due to over voltage.
Almost any small capacitor will do. The smaller the value the quicker the conversion time.

This is a fairly low resolution AtoD converter but quite adequate for battery voltage monitoring.

Duane J

xanadu
04-01-2012, 06:17 PM
Thanks guys, it looks like I'm going to try the Sigma-delta Analog to Digital Conversion (great PDF btw!). I really couldn't see spending $20 on a couple resistors in a pre-made solution, so as always you saved me time and money ;)

I'll probably also build that comparator and the RC circuit since I have the parts. Should be a good learning experience. Now all I need to do is stop the phone from ringing hehehe.