Skip to content

How-to: Undervoltage protection for li-ion batteries

in my previous post, I talked about how I got hold of a bunch of li-ion batteries, in this article I’ll describe how to create a module to protect them against under voltage.

Problem, plan of action and schematics

In order to use all these 18650 batteries I got, I bought a some of these double batteries holders, this will allow me to power up some projects.



18650 li-ion batteries, when fully charged, reaches 4.20v. They are considered completely discharged at 3v. Because the voltage will change over time, I need a power regulator that will ensure I get a constant voltage available for the electronics behind, for that I’m using a cheap Chinese modulator based on the LM2596:



It takes a wide range of input voltage (4.5v to 23v) and can deliver a stable output voltage between 1v and 17v.

The problem

The two batteries, when fully charged, will output 8.4V, and fully discharged about 6V – but the power module will still be able to give me a stable output until about 4v (so two volts/battery), then the voltage will get flicky. This have two consequences:

  • The electronics powered by the battery will lack power and might get damaged
  • The batteries, at 2v, are way under their safe voltage limit (3v) and this will drastically reduce their life expectancy.

How to solve it?

I need a circuit that will measure the voltage output from the battery, and cut down the power to the module once it reaches 6v (so 3v/battery). For that I’ll be using a voltage comparator circuit, whom input will be connected to a transistor that will “cut the cord” if the battery level goes below the predefined threshold voltage.

So, here is the schematics I came up with:



  • On the top part, you see the Chinese LM2593 power module that outputs 3.3v for my circuit (this module have a potentiometer on it’s PCB, the output voltage could easily be changed to 5v, for example)
  • On the left, there is the voltage divider circuit for the battery voltage (the three resistors in serial). Because the measured tension on the pins of the comparator cannot be more than it’s power input – 1v (I think), which would be 2.3v here, I had to divide it with a factor of 10 with the resistors, so if the battery voltage is equal to 9v, we will get 0.9v on the ‘+’ pin of the comparator.
  • The ‘-‘ pin of the comparator is wired to a potentiometer that will allow me to precisely select the threshold voltage. For 6v I will put 0.6v on the ‘-‘ pin.
  • On the output of the comparator, I wired a 2n2222a transistor that will be saturated (think closed switch) as long as the battery voltage (+ pin) is superior than the threshold voltage (- pin). I use a 220ohm resistor to get a sufficient current flow in my module. (Note: I originally had a 1.2Kohm resistor here, but the current was not enough, thank you Arouse1973 for helping me find out the culprit :)).
  • The circuit to power will be connected between the 3.3v point and the transistor. There’s a connector on the schematics.


First, we need to make sure the idea works, so let’s get the breadboards and try it out with a LED as a powered module.

5.5V, the battery is below the 6v threshold voltage: the LED is off



6.3V, the battery is above the 6v threshold voltage: the LED is on!

Looks easy, but it took me quite some time to get it right :). Anyways, now that I know my circuit works, let’s start soldering!


The first prototype, looking good!
preparing the components for the 4 others modules, taking example on the prototype above.




Setting the power module output to 3.3v


setting up the threshold voltage (by a factor of 10, so here I’m setting it at 6.02v)
Neat, 5 voltage controlled battery modules!
A bit of hot glue to stick it on one side
Working great 🙂

Now, the only thing left is to hook up a cool battery powered circuit. How about a WiFi temperature + humidity sensor?



I’ll talk about these in another post – thanks for reading!


Published inUncategorized


  1. Antonio Antonio

    Great job!!!
    Thank you Benoit; i was looking for these kind of remote sensors and I found in your work all I neded

  2. Hello, for how long will the unit run for in your setup, im doing a similar setup and using deep-sleep for 30min and then measuring but noticed that the DC-DC regulator im using which looks identical to yours has a quiescent current draw of around 7-10 mA which reduces the operation time from say 370days to 21days…
    ordered some linear voltage regulators (XC6203E332PR) with a quiescent current draw of around 10uA to make it more robust in that sense,

  3. Alan Lord Alan Lord

    Thanks for the very interesting write ups. I’m playing around with some ideas for ESP8266 modules in my polytunnel to report temperature and humidity.

    I have a test system working on the bench and am now thinking about battery power… Once point I note on your design is your voltage regulator has a high quiescent current rating – that is, it draws around 10mA even when not doing anything.

    There are far better LDO voltage regulators which have a very low quiescent current < 10uA and have a fixed voltage out so do not need potentiometers etc… One of these should help greatly to improve the life of the battery between cycles.

    Just a suggestion.

    • Benoit Dumas Benoit Dumas

      Hi there,

      Very interesting – my setup did not last as long as expected and it might very well be because of the voltage regulator.
      Do you have any reference I could search for?


      • Alan Lord Alan Lord

        Sure, the one I chose to use in the end was the MCP1700-3302E/TO. It’s quiescent current draw is a mere 1.6uA. I now have a working monitor in my Polytunnel running off a single 18650 battery. I’m hoping for many months of life between charges.|low_dropout_voltage_regulators&mkwid=sjzGO8uuq_dc|pcrid|79440684555|pkw|%2Bmcp1700+%2B3302e+%2Bto|pmt|b|prd|&gclid=Cj0KEQjwz-i3BRDtn53Z5Z7t4PUBEiQA23q2APo7yeokN9oVWcXuNnXz9CFOoVQMyIEGpmD7sJBlWIEaAraC8P8HAQ

Leave a Reply

Your email address will not be published. Required fields are marked *