I am a bit electronically challenged and need to hold an input pin high for about 8-10 seconds. I am implementing this solution: https://github.com/NeonHorizon/lipopi/blob/master/README.power_up_power_down.md, which works fine, but I have to hold the power on switch for 10 seconds before the Pi sets the UART pin high (and keeps it high). I looked at some explanation of RC circuits, and they seem to all have the same charge delay as discharge delay. Maybe I need a diode in there somewhere? Basically, I'd like to have the capacitor charge quickly, and discharge slowly through the resistor.
Following onto Flàvio's suggestion, can anyone tell me if using a transistor for isolation will work, something like this? The hoped for outcome is:
- Press switch
- Capacitor charges
- When switch is released, capacitor keeps base of transistor high until GPIO 14 goes high as a result of the Raspberry Pi powering up.
- By the time the capacitor would have discharged, GPIO 14 takes over to keep the transistor conducting, and EN remains high.
- To power down, when the switch is pressed again, the Raspberry Pi reads GPIO 18 and a script instructs the Pi to power down
- After shutdown, GPIO goes low, the capacitor discharges, and the powerboost cuts power to the Pi.
(fixed transistor orientation)