I'm trying to make a Pi power on and off using one momentary switch and a powerbank which has a momentary on/off button. What I need to achieve is very simple in words but I'm not entirely sure what component(s) I need.
All I want is when the Pi is off the button press goes to the powerbank, but when the Pi is on it goes to the Pi.
So is this just a SPDT relay triggered by a GPIO I set high (using 5v so as to not blow my Pi)? Seems like like the easiest option, but a waste of power being as the relay will always be on.
Or I could use a latching relay which is great until the powerbank runs out of power, when the button will be stuck in Pi mode and there will be no way to turn it on...
Is there a third option I'm missing? Most Pi power circuits seem to involve an optocoupler, should I be looking at one of them?
Thanks for any thoughts.