I made a nightlight and was very happy with the dim yet usable output and runtime (months), but my assumptions about battery safety were wrong. I expected the LDO 3.3 V regulator to stop output when the source voltage dipped below 3.3 V, and that it would not draw much current in that case. I must have been wrong, since the 18650 lithium ion cell was irredeemably dead after a couple months. The circuit is below.
(Note: the output would be more efficient with two LEDs and a changed resistance to reduce the current as needed. At tiny currents like this, even a white LED does not have the expected large voltage drop.)
How could I better protect the battery from over-discharge? Could I use an additional regulator (3 V), a comparator, and a MOSFET so the comparator switches off the MOSFET if the battery's output voltage becomes less than 3 V? Even if it works, finding low power versions of these chips might be hard (or expensive). Is there a better way to cause the circuit to turn off instead of draining the battery? I assume a dedicated battery protection IC would be best, but most seem to come in a package that I won't be able to solder at home.