Batter Inputs
The BATT+
and G
pins are the inputs for the battery. BATT+
goes to your battery’s positive wire (Red) while G
goes to GND wire (Black).
5V Output
The 5V
and G
pins are obviously the PowerSwitch’s 5V+ and GND outputs.
Safe Shutdown
TheS
and P
pins are your Safe Shutdown GPIO pins. The S
pin goes to GPIO11
and P
goes to GPIO10
on the Raspberry Pi.
LED Indicators
Power On LED – Use the P-
and P+
pins for connecting external LED as power on indicator. P-
is cathode(-) and P+
is the anode(+). Use a resistor in series with P-
.
Charging LED – Use the C-
and C+
pins for connecting external LED as charging indicator. C-
is cathode(-) and C+
is the anode(+). Use a resistor in series with C-
.
If you want to use your own charging port like a dc barrel jack or usb type-c port, you can use the 5V input
and GND input
for the PowerSwitch without charging port.
Safe Shutdown
In order to enable the Safe Shutdown feature of the PowerSwitch, login via SSH and execute the following command:
wget -O - https://www.tinkerboy.xyz/setup.php -q | bash -s ss
When it’s done you should get an “OK!” message if it’s successful. Otherwise, let me know when you get an error.
Now restart your Pi by issuing sudo reboot
. That’s it!
Have a nice day! 🙂
How to combine your safe shutdown with brightness control?? Both use gpio10..
Good question! 🙂 I will be doing a different script to control brightness using two controller buttons from a usb controller like my v3.
Any update for this problem?
For now just change the GPIO pins for the Safe Shutdown in config.txt.
What resistor would you use in-line for wiring up external charging/power lights?
1k – 10k resistor.
How do I connect the switch to the pcb board?
The GND and 5v output of the PowerSwitch goes to the controller board’s GND and 5V input.
Will the safe shutdown work with your dpi adapter?
yes.
Do you have a wiring guide to add a Wireless Charging PCB?
I have not tried any wireless charging module but but it should be easy to wire it to the PowerSwitch. The 5v output of the wireless charger goes to the 5v input of the PowerSwitch.
I connected S to GPIO 11 and P to GPIO 10, ran the command in this post and it said “OK! Have a nice day! :)” I then power cycled the Pi and it will not ever power off. Is there a daemon that should be running that I should look for? I see in the setup.php where we set the shutdown and poweroff in the /boot/config.txt, but not sure a daemon or cron job was setup to watch for it. Thanks for all these fun products, they are making my latest Gameboy Pi build the best I could hope for!!
Ahh, it is using dtoverlay with gpio-shutdown and gpio-poweroff. I was able to figure out my problem. I got S and P mixed up. 😡 I swear I connected GPIO 11 to S as mentioned, but apparently not. Thanks again, and it is working great!
Hello im new with build of the raspberry pi handheld, and im working with a pi 3 a+ and the power switch, can u send me please a wiring guide? i don’t know how to propertly connect my “S” and “P” wires to the gpio11 and gpio10 cause those pins are soldered under the dpi adapter with the pi, thanks for your help, hope you can read my question.
Will this board also do a safe shutdown when the battery voltage is low?
No, I did not include auto shutdown on the script but you can easily do that.
This may be a dumb question, but i am doing the 5v and gnd to the pcb v3 board, do I also need to do a 5v&gnd to from this powerswitch to the raspberry pi?
How did you mod the case to get this component to sit flush? I used flush cutters on the pins on the back of the board, but it was a bit messy, so I thought I’d ask.
Also, do you have any tips for drilling/cutting out the charge port on the side of the case?
I’m curious does the charging led turn off once charging has completed or does it stay on so long as there’s power on the 5v input pin?
If it’s completely charged the led light will turn off as long as you are not using the battery or the Game Boy Zero is off.
I have one of these in my current pieboy and it’s amazing! Thanks for your ministry 😉
I’ve been toying around with doing another build but make it appear as stock is possible including using AA batteries in the stock position. Two sets in series, then parallel.
These leads to my question, will this switch handle boosting a battery input voltage of 3v instead of 3.7v, or will that cause a brownout condition?
Only works with 3.7v battery.