I'm working on a project which has multiple switches. When any switch is activated, the always-on-supply (VBATT in the attached diagram) needs to be power the microcontroller (powered by +3V3). When the switch is released, the microcontroller needs to continue operating for a brief period (in the order of 10 seconds).
The current draw of the microcontroller will be around 5mA, so to provide this storage purely via capacitance would require a large amount of capacitance (which there isn't physically room for).
Each switch is read by a microcontroller input, so paralleling the switches together is not an option.
I'm looking for a very simple, low component count solution - timing accuracy is not a concern at all. I'm fairly happy the attached circuit will work - but it would be good to hear some agreement before I order the board!
Theory of operation:
- Normally gate of Q2 = 0v, base of Q7 = VBATT, +3v3 output is disabled.
- If any switch closes...
- C6 charges up through the specific switch's diode, gate of Q2 goes high
- Q2 switches on, base of Q7 pulled low
- Q7 switches on, +3v3 output is active
- Switch closes
- Time delay as C6 discharges through R20
- After a while, Q2 switches off, Q7 switches off
- +3v3 output is disabled