li-ion batteries cannot be discharged further than 3v (begin fully charged at 4.2v). Using some in your projects means you need to make sure the power is cut when the batteries reaches 3v.
In my long quest to automate as much of my home as possible I want to have battery powered modules, mostly for sensors.
To achieve this, I made a comparator circuit connected to a transistor, which allows me to cut the power on my circuit when the batteries reaches 3v.
Note the voltage divider, it divide the battery voltage by a factor of 10, in order to make sure the battery voltage is always below 2.3v (Because the comparator is powered by 3.3v, and cannot take a higher voltage on it's pin than on it's power supply)
the transistor base resistor is 1.2k on this picture (seen above the comparator socket), I had to change it to 220ohm in order to have enough current flowing through my circuit. (thanks Arouse1973 for helping me find out the issue)
setting up the threshold voltage
The modules ready for the batteries
I didn't work much with comparators before, so I learned a lot this weekend, it was very interesting! I hope this could help some of you
Check out the more detailed version on my blog!