Li-ion Over-discharge Protection


Senior Member
I have a moderately fast single engined scale electric boat which is a bit overweight. It currently cariies two 6 x subC NiMH packs of 3500 mAh each. I am looking into replacing them with 7.2V Li-ion pack(s), but am concerned about damage due to over-discharge. Overcharging is not an issue.
I think that I have come up with a really simple solution. Maybe too simple, so ask this Forum to find the catch.
My plan is to use a -08M to sit between the reciever and the speed controller, and also monitor battery voltage via ADC. In normal circumstances, the Picaxe would simply read the input pulse, and re-transmit it unchanged. If the voltage dropped to, say, 6V, then speed would be limited to 1/2 (perhaps 1/4 at 5.5V, and fully off at 5V). I do not want a single full cut-off point, since that would leave the boat stranded.
My first quick attempt at code:
pulsin 4,1,w0  'word variable since I may trap for invalid pulses which could be >256
readadc 4, b2  'assume 2:1 voltage divider, so 10V gives 256
select case b2
   case <154 '<6v battery voltage
   case <141 '<5.5V battery voltage
   case <128
     b3=150 '<5.0V battery voltage
end select
w0=w0 max b3
pulsout 2,w0
goto restart
One problem that I can see is if the loop is too slow to read the pulses coming in at 60/s. I could not find the time for the ADC command to execute. Is this a problem?
Another problem may be "hunting". If, say, a voltage of 5.9V is detected, and motor power reduced to 1/2, the voltage may then rise above the threshold, and full motor power will be restored, retriggering the limiter. I'm sure that I can add to the code to make the limit persistant once triggered.
Can anyone see a fault in my logic? Still seems too good to be true.


Senior Member
How is the picaxe going to be powered? Separate supply with common ground? Supplied from motor battery pack?

If it's measuring it's own unstable/variable supply/battery voltage then that causes several issues as the result from adc will change as supply voltage falls.

You need a separate stable voltage reference to enable a picaxe to measure it's own fluctuating supply voltage.


Senior Member
My speed controller has a BEC which supplies 5V to the reciever (probably just a simple linear regulator built in, but cannot check since it is a sealed unit). I would hope that it is stable enough to be a decent reference.


New Member
Your concept is seems sound to me. A few comments:

1. Cut-off voltage limit. I would be a little more conservative on the voltage level to start the fall back speed. I would start at 6 volts for a 2 cell Li-ion. Of course your description already stated that you understand you need to have a resistor divider string such that the A/D input only sees 1/2Vcc voltage to remain in it's input measurement range.

2. Instead of cutting back on speed, might it be simpler to just trigger a loud pizo buzzer when low voltage trigger is reached. That would make the program much simpler and you would only have to work on filtering of the analog read samples and the hystiris value to use to set and reset trigger value.

3. You should probably use a low drop-out regulator for powering the Pixaxe chip as accurate A/D conversion requires a stable Vcc. The standard 7805 linear regulator has a minimum input voltage requirement of around 7.5vdc where as a good LDO regulator will stay in regulation with just 100-200mv above output voltage. You want the minimum regulator input voltage requirement to above the minimum voltage that your battery will be running at. A battery at 6vdc output will not keep a standard 7805 in good regulation. Find out what your BEC regulator has for a drop-out voltage rating and use an external LDO 5vdc regulator if the BEC is not a LDO type.

Good luck
Last edited:

Michael 2727

Senior Member
What type/brand of Cell pack are you using.
You may find that there are battery management chips built into the pack.
Even some very small packs for Phones, MP3s and other devices have some
form of management/protection system built into the top of the pack itself.

Some Li-ion batteries just shut down completely when they hit the 3V mark.
(there is a small circuit board in series with the battery terminals)
If you measure the voltage directly off the Cell there is still 3V available
but no voltage at all when you measure the output terminals of the pack.


Technical Support
Staff member
The loop should be fast enough for what you need. To improve throughput I'd rewrite the loop as a Finite State Machine (FSM) and follow the PULSIN as quickly as possible with the PULSIN ...

  ReadAdc 4,b2
  Do while b2 >= 154 ' Above 6V0
    PulsIn 4,1,w0
    PulsOut 2,w0
    ReadAdc 4,b2
  Do while b2 >= 141 ' Above 5V5
    PulsIn 4,1,w0
    w0 = w0 Max 170
    PulsOut 2,w0
    ReadAdc 4,b2
  Do while b2 >= 128 ' Above 5V0
    PulsIn 4,1,w0
    w0 = w0 Max 160
    PulsOut 2,w0    
    ReadAdc 4,b2
  Do                 ' Below 5V0
    PulsIn 4,1,w0
    w0 = w0 Max 150
    PulsOut 2,w0
PS : You seem to be reading your PULSIN and READADC from the same pin.


Senior Member
Thanks for all responses. Rapid and useful as always.
I cannot determine whether the speed controller uses an LDO since it is a sealed aluminum housing, and no detailed spec sheets. I can always experiment by varying the voltage to the ESC and looking at the 5V output. I will use a separate LDO regulator if necessary.
The buzzer idea is something I had not considered. May be an alternative approach.
From what I have seen, the battery packs with protection are considerably more expensive, and are not available in high current draw versions (my motor probably draws about 15A).
I like the FSM approach, simple and effective. It also solves the problem of hunting.
Be carefull, powering the Picaxe from the Electronic Speed Control (ESC). Most ESC regulate the voltage to the receiver to 6V because the receiver and the servos work Ok at that voltage. Some of them are not very precise and exceed 6V which wll not harm the RX and servos but could be a problem for the 8M.
I am using an ESC and powering the Picaxe from the regulated output but I measured 6.4V output. An in-line diode droped it to 5.7V and the 8M is working OK but it could have burnt otherwise.


Senior Member
Thanks for the warning. I'll check the ESC "5V" voltage and stability. Adding a separate 5V LDO regulator is always an option, and not really expensive or difficult.


Monitoring batteries

It just so happen that I have been working on a project to monitor the voltage of a battery, sound a warning tone when it drops below a certain level and then shut off power when it drops even further.

The design application is for 12V SLA batteries which can fail permanently if let discharge to low. (Sulfination)

I have been running it in my robot for a while now, and aside from the voltage regulator failing. (replaced with one with a heat sink) the design has been robust in switching currents up to 6 Amps.

Take a look:

have fun,