I'm working on a power bank powered music box, based around a raspberry pi zero.
It should have several buttons, an on/off switch and a volume encoder. As you can see in the first schematic, I planned to use external pull ups resistor (10k) for all inputs, but I think I will omit all of them and configure each input pin with an internal pull up. This part should be fine and I don't expect any big issues with it.
The main struggle I have is related to the power supply. As soon as the raspberry zero is halted, it should disconnect from the power bank.
An idea could be as following: The 5V line is connected to the raspberry pi zero via a double coil latch relays.
As soon as the main switch is turned on, it generates a pulse to set the relays and closes the 5V > the raspberry gets power and starts.
It reads (GPIO16 as Input)in the main switch and initiates
when the main switch is open for a certain amount of time. The NC7SZ08 serves as level shifter 5V to 3.3V.
Code: Select all
sudo shutdown -h now
GPIO12 will be configured as gpio-poweroff high
This should slowly charge the 1uF compensator. About 10sec later the voltage is enough to activate the reset coil of the relays and disconnects the 5V line.Name: gpio-poweroff
Info: Drives a GPIO high or low on poweroff (including halt)
Unfortunately I don't have an electronic lab/equipment at home, so I can't really test it beforehand. What do you think about my approach?