Hello,
Following my Maintain power thread, the SBC now has enough time to shutdown properly when the main power source goes away.
However, I have an issue when the power comes back on in that the SBC must have been physically disconnected from its power source for it to boot up again.
Now, I know this comes from the fact that I use super capacitors that take a long time to fully discharge, but even after days being unpowered I still need to "unplug/plug" the SBC for it to come back on.
So I thought that's a perfect application for a relay as it does have a physical connection, but I'm struggling with the design of the driving circuit for it apart from the obvious flywheel diode.
Using PlantUML, I represented the following timing of events that I'm trying to achieve:
It's also visible online here.
24V is the main power source
5V is the stepped down voltage, backed up by the supercapacitor
PowerLoss is the signal from the previous discussion
PiRunning is a GPIO pin from the SBC that gets set/reset via code running in the SBC operating system
PiPower is the desired On/Off state of the relay
Basically, I want the relay (PiPower) to be in the On state when PowerLoss is 0 and to go to the Off state after a delay when PiRunning has changed to a low state.
I need a delay before the relay is switched off because there is a time gap between the operating system running its last script and the actual power off on the SBC. I believe this can be achieved quite easily, force instance with a NE555 as the needed delay is below 5 seconds.
But what I'm struggling with is the "conversion" of a state signal and a down front signal to a on/off state to drive the relay. As I envision driving it with an N mosfet, I believe the signal to generate would need to be inverted, but that's not much an issue.
Short of asking for a ready made solution, what resources would you suggest that I look at to be able to come up with a working solution?
Many thanks for your help.