Posted on 23 Comments

Setup and Wiring Guide for the tinkerBOY PowerSwitch

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! 🙂

23 thoughts on “Setup and Wiring Guide for the tinkerBOY PowerSwitch

  1. How to combine your safe shutdown with brightness control?? Both use gpio10..

    1. Good question! 🙂 I will be doing a different script to control brightness using two controller buttons from a usb controller like my v3.

      1. Any update for this problem?

        1. For now just change the GPIO pins for the Safe Shutdown in config.txt.

  2. What resistor would you use in-line for wiring up external charging/power lights?

    1. 1k – 10k resistor.

  3. How do I connect the switch to the pcb board?

    1. The GND and 5v output of the PowerSwitch goes to the controller board’s GND and 5V input.

  4. Will the safe shutdown work with your dpi adapter?

    1. yes.

  5. Do you have a wiring guide to add a Wireless Charging PCB?

    1. 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.

  6. 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!!

    1. 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!

  7. 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.

  8. Will this board also do a safe shutdown when the battery voltage is low?

    1. No, I did not include auto shutdown on the script but you can easily do that.

  9. 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?

  10. 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?

  11. 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?

    1. 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.

      1. 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?

        1. Only works with 3.7v battery.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.