A-to_D of battery supply

PFM

New Member
OK,

I read most of the posts on AtoD and it seems that if your project is battery powered you cannot use the AtoD in the Picaxe to monitor it's own power supply. As the battery looses voltage the reference moves with it, as has been described in other posts. I had hoped to have a battery test in my current project but this has caused a bit of a glitch. I assume all three batteries will degrade at equal rates so measuring one cell will not help, what if I were to use a reference voltage say 2.5 VDC and read it on one AtoD and then a single cell (of the three) on another? The reference will still move but the 2.5 will be a constant to work out the battery voltage.

Just trying to get out of the box here.

Regards,

PFM
 

andrewpro

New Member
The best way that Iv'e found to do it is to manipulate the circuit so that the supply voltage is relatively significantly higher or lower than the picaxe supply voltage.

Case 1) Use a boost converter on a 3 to 4 volt supply to bump it up to 5 volts. The converter will regulate the voltage to 5 volts independant of the battery voltage, and you can use a direct line to the batteries to measure thier voltage. The bat. voltage can change, but your reference for the picaxe ADC will not.

Case 2) use 9 volts of supply and a "normal" regulator to drop it down to 5 volts. Use a voltage divider to bring the maximum battery voltage below the safe 5 volt level of the picaxe supply and measure that. In this case the battery voltage really needs to be significantly higher than the picaxe supply so that the regulator continues to do it's job as the voltage on the battery drops.



--Andy P
 

wilf_nv

Senior Member
The X1 parts include the CALIBADC and CALIBADC10 functions that can be used to calibrate the ADC by measuring an internal 0.6V reference voltage.
 

moxhamj

New Member
I'd do what Andypro suggests - for a quick and simple circuit my preference is a 9V battery and a 5V reg. But there are other stepup options too - see http://drvernacula.topcities.com/315_mhz_solar_powered_radio_rptr.htm for a circuit that runs on a single 1.2V nicad and steps up to 9V and then to a regulated 5V.

Or another option is to generate a fixed reference and measure that. Eg a 1k resistor and a red led will generate a fairly stable 1.2V. Feed that into the ADC and if the supply volts are 5V it will read (1.2*255)/5 = 61. But if the volts fall to 4V it will read (1.2*255)/4 = 76. Note that the readings go up as the battery goes flat. You can calibrate with a variable power supply and debug, or just do the maths.
 

moxhamj

New Member
My mistake = make that 2V. You could use two 914 diodes at 0.6V each. Green leds are higher than red. Actually it doesn't really matter exactly what the volts are once it is calibrated.
 
Top