I am trying to design a latch for an energy harvesting application with a very low power system. Basically I have a setup with a 3.3V regulated output driving a circuit, which is run off a capacitor being charged by an energy harvesting system. If the system ever turns off because it runs out of energy, I want a switch to prevent any current from flowing from the 3.3V output to the circuit. This turning off can be detected by the output falling below 3.3V or from the charge across the capacitor dropping below 4V. I then dont want to close the switch again until the capacitor is charged up to 16V, at which point the system should start drawing power. Something that may be useful is that the output will always be at 3.3V when the capacitor is charged to this level.
I am having trouble with this because there is no true constant voltage supply and the system needs to be low power. I also may need the system to stay on for long periods of time once the switch closes.
Some form of comparator with hysteresis of a few volts could work? but I do not know how I would get this to happen without some Vcc input.
As an update, I attempted to use a comparator tied to a latch that I thought would stay on until there was no power to it, but it does not seem to have worked. any advice on getting this to stay on until it dies? https://www.circuitlab.com/circuit/67e536/possible-latch-mide/