So I'm making a battery-powered Raspberry Pi project, and it would be ideal if it could cut off power to the Raspberry Pi after the Raspberry Pi shuts down. It would also be ideal if the power for the whole system was controlled via a single on/off button. The events I'm looking to respond to are like so:
- Short press of power button:
- Closes circuit if circuit is open (powers on the Pi)
- If the Pi is already on, it boops one of the GPIO pins on the Pi (I'll configure the Pi to listen for this and prompt the user to shut down the system safely)
- Long press of power button:
- Opens circuit if circuit is closed (forced shut down of the Pi)
- A GPIO pin on the Pi goes high or low (I'll configure the Pi to do this on halt):
- Opens circuit if circuit is closed
The power supplied will be 5V, and I doubt current drawn by the Pi and its peripherals will be much more than 2-3A. My knowledge of active circuit components is very limited, but is there any one component that can do what I'm shooting for?