I'm replacing the cheap flashlight bulb in my daughter's toy lantern with a white LED. It uses 2 AA batteries, so I have to use a boost converter, which is fine with me since it'll help exhaust the batteries far beyond almost anything else that uses batteries.
However, I want it to turn off after a few minutes since she'll of course leave it on not once, but many times. Since I expect this to continue operating after the combined battery voltage is under 2 volts, a small PIC would have to be powered by the boost regulator....a tricky situation. So I came up with a simple RC network on the regulator's /SHDN pin. This seems to work, but when I turn off the power, nothing discharges the cap.
Here is a rough schematic of what I'm doing. It's just the diagram from Maxim's datasheet with my additional components added.
Any ideas on a simple, elegant way to discharge the cap when power is turned off, or any other ideas to achieve the same objective? The power switch is SPDT. If it was DPDT I could use the other pole to put across the cap.