PICAXE LiPo voltage monitor

Having realised that LiPo batteries are probably the best choice for my project, I've been doing some reading and have seen the dire warnings about overdischarging them. As such, I'm looking into building a low-voltage warning system into my existing circuit (which is based around a PICAXE-14M). As I've already made the circuit board, I'd like to be able to use as few external components as possible.

So here's what I want to happen:

  1. Battery voltage falls to 3V
  2. Output of warning circuit switches from low to high
  3. PICAXE interrupts on this output and stops driving loads (two high-power motors)

Would appreciate some help on the circuit design to achieve this.
 

eclectic

Moderator
As a start, try
Advanced Search

usint the terms
LiPo volt* monit*

There's informative threads and leads there.

e
 
So, what I read from those is it can be as simple as a voltage divider, with the PICAXE calibrated for a 3V cutoff. Stuff I'd seen elsewhere led me to believe it'd be a far more complicated affair with opamps, resistors and capacitors all over the place ;)

...Oh yeah; actually had a another look and all that's happening is the opamp is being driven by a potential divider. So I'm just replacing the opamp with a PICAXE.
 

eclectic

Moderator
So, what I read from those is it can be as simple as a voltage divider, with the PICAXE calibrated for a 3V cutoff. Stuff I'd seen elsewhere led me to believe it'd be a far more complicated affair with opamps, resistors and capacitors all over the place ;)

...Oh yeah; actually had a another look and all that's happening is the opamp is being driven by a potential divider. So I'm just replacing the opamp with a PICAXE.
How are you going to calibrate,
or do you have more than one battery supply?

e
 
Well, run the battery till it reaches say 3.2v, hook it up to the analogue in of the PICAXE running on regulated 5V and test to see what the reading is.
 
Actually, this isn't as simple as I thought, is it...

Wikipedia says:

Any ratio between 0 and 1 is possible. That is, using resistors alone it is not possible to either invert the voltage or increase Vout above Vin.
So 3.2V in ain't gonna make a 5V output, so digital outputs are out of the window. And the supply voltages are different, so analogue readings would be screwy... :confused:
 

BeanieBots

Moderator
You certainly can't get a higher output than input using a simple potential divider (the clue is in the name) but don't let that be a problem.
As long as you have some sort of constant reference with which to compare your battery voltage, then there's no problem.
Possibly the easiest would be to run the PICAXE at a voltage BELOW that of the lowest voltage your battery will be allowed to get to.
Other options depend on which PICAXE you use but could include external references.
 

hippy

Ex-Staff (retired)
Actually, this isn't as simple as I thought, is it...
Or maybe it is. I'm not sure what the Wikipedia quote refers to but there's no reason you can't read a 3.2V voltage on a 5V PICAXE. Perhaps some clarification as my crystal ball has failed :)
 

BeanieBots

Moderator
I think the problem is where will the 5v come from when using a 3.3v battery.
There are many ways of doing that trick too, but overkill for such a simple task as battery monitoring.

eg 7660 voltage doubler feeding 5v LDO.
 
Ah, I've been being stupid, actually. The LiPo in question will be a series 2-cell pack (so 7.4V). The critical voltage for each cell is when they have dropped to 2.5V as a minimum but 3V to be safe, so adding that up for the whole battery gives 6V. So what I actually need is to trigger the warning when that level is reached, which ought to make things simpler.

And the plan is to run the PICAXE from the same supply, seeing as that'll actually be >6V that shouldn't be a problem either..
 
Last edited:

BeanieBots

Moderator
Yep, simple!
7.4v nominal into 5v regulator to power the PICAXE and provide a 5v reference.
Simple divide by two potential divider to give ~3.7 nominal at ADC input.
Job done:)
 
Yes, so at cut-off point about 2.9V at input. Should be a detectable change; add a timer to account for momentary drops when motors are starting (eating in excess of 6A). Looks like it was simple after all :)
 
Top