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.
Testing!
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.


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!
Soldering!








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!
Great job!!!
Thank you Benoit; i was looking for these kind of remote sensors and I found in your work all I neded
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,
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.
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?
Cheers,
Benoit
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.
http://uk.rs-online.com/web/p/products/403888/?cm_mmc=UK-PPC-_-google-_-3_UK_EN_M_SEMIS_Broad-_-microchip|low_dropout_voltage_regulators&mkwid=sjzGO8uuq_dc|pcrid|79440684555|pkw|%2Bmcp1700+%2B3302e+%2Bto|pmt|b|prd|&gclid=Cj0KEQjwz-i3BRDtn53Z5Z7t4PUBEiQA23q2APo7yeokN9oVWcXuNnXz9CFOoVQMyIEGpmD7sJBlWIEaAraC8P8HAQ