18X self battery monitoring?

Dippy

Moderator
Answer: Yes.

But try a search as this was covered over many pages some months ago.

The configurations basically varied depending on whether you used direct battery supply or battery-via-regulator supply. And there's no point covering old ground if you can find it with the search - or perhaps some kind soul will find it for you and do a link.
 

premelec

Senior Member
yes... just remember the ADC is ratiometric to the power supply you want to measure so you have to establish a separate reference V if you want to get meaningful results.
 

xstamp

Senior Member
Provided that the PICAXE supply is regulated, and therefore your ADC reference is stable, all that you need is a potential divider between the battery positive terminal and ground. With the centre of these two resistors connected to an ADC input. For example, if the battery was 9 volts and you used two 10K resistors the input to the ADC would be 4.5 volts. The low threshold value that you set in software will depend on whether the regulator used is a standard type, that requires at least a 7.5volt input, or a low drop version that only requires about 5.5 volts. It might also be a good idea to add a capacitor between the ADC input and ground to filter power supply noise.

 

johndo

Member
A good micro-power regulator would the LP2951 from National.
Very low quiescent current (75µA typ.),and able to supply 100ma,great for a battery powered project. Run the picaxe of the LP2951 at 3v with voltage divider on battery+ ,and monitor with ADC,run high current devices directly off the battery. Farnells and RS have them (not cheap)... I'm using a 4.2 lithium phone battery for my project,hence the 3v,low batt at 2.8v...I suppose you could set any voltage you want!

Edited by - johndo on 17/07/2006 03:24:16
 

GeorgeLoo

New Member
Thanks for all your help.
The dilemma is that when the batteries get low in a mobile Picaxe device, giving some sort of warning might hasten the drainage!!!
 

johndo

Member
Perhaps incorporate an LED flashing at 10hz and a period of 10ms or so. And set the trigger voltage high enough so as to give you time to either change battery or recharge it before the battery is damaged,if using rechargable. Why not make an inbuilt charging circuit!!! Li-on is easy... Google it!!! Use picaxe to detect when the battery is fully charged.I've done it myself,takes a bit of time and effort and code,but very satisfying...
 

Dippy

Moderator
If you sense a low battery status you could reduce the clock speed before flashing an LED. Or you could flash an LED with Naps, which would be a 'low power' flash.

Edited by - Dippy on 17/07/2006 09:45:33
 

Mycroft2152

Senior Member
A simple way to monitor the battery voltage on a NON-regulated circuit is to read the voltage from a resistor/led combination.
+
|
\
/ 10k to 100K resistor
\
/
|
| --- < to adc
|
-
V LED
|
|
gnd

The LED has a constant voltage drop, but since the ADC in the PICAXE references to the supply voltage. the ADC value will change as the battery voltage changes.

For example, a red LED can be used as a 1.2 volt reference (other color LEDs are different). It the battery voltage is 4.8 volts then the ADC value will be 1.2/4.8 * 256 or 64, At a battery voltage of 3 .6 volts the ADC value will be 1.2/3.6 * 256 or 85.

Use the largest resistor possible, it is not necessary to "light" the LED. Multiple regular diodes can also be used. each having a 0.6 volt reference.

TANSTAAFL!

Myc
 

hippy

Technical Support
Staff member
Myc's circuit worked very well for me, monitoring both the non-regulated ( eg battery ) and the regulated side. If you have a power-on LED indicator already, it's probably just a simple matter of taking a feed from the LED to an analogue input.

Although regulators need a few volts overhead to work properly, I've found that many pass voltage through even when the input voltage drops below what it should be, and PICAXE's which work down to about 2V will keep on running. Probably not the best way to run a regulator, but it does prove how useful that circuit is.

Edited by - hippy on 17/07/2006 12:54:15
 

xstamp

Senior Member
When using LEDs to generate a reference remember that the voltage will be different for each type/colour used. From about 1.5 volts for IR to 3.8 volts for ultra blue. Also, like must semiconductor diodes, this value will be temperature and current dependant (you normally need a couple of mA to get off the knee of the transfer curve). None of the above items should be a problem for low battery detection circuits because battery discharge characteristics are from exact. However, for a ‘real’ voltage reference you cant beat a band gap device.

 

BeanieBots

Moderator
If you want high accuracy, try a REF03 2.5v reference from Analog Devices.
http://www.analog.com/UploadedFiles/Data_Sheets/56211209654177REF03_f.pdf
 

Mycroft2152

Senior Member
There are a number of specialized chips for monitoring voltage. GOOGLE "voltage supervisors", "voltage supervisors" or "voltage detectors"

I've used both he 3 pin MN1381 and the 8 pin and MAX8212 dual, programmable supervisors.

They are used as an external Brown Out Detector, to signal for an orderly shutdow before the voltage gets too low.

Still, you can't beat the cost and simplicity of a LED and a resistor.

Myc


 

andrewpro

New Member
When I have a chip that needs to monitor it's own voltage for whatever reason, I use a buck/boost regulator to power it, and provide the raw voltage (pre regulator) to an ADC pin. This way it takes the fact that the chips ADC reference is it's own VCC out fo the picture, as it's VCC will b constant over a very large voltage swing (both above and below the regulated voltage for the chip).

If you dont have the need to draw a large current, this is a pretty simple and compact way to go. The regulator is generally an 8 pin dip, sometimes with a fw external components, sometimes not (depends on the device) and really rextends battery life quite a bit.

--Andy P
 
Top