Posted on 15 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! πŸ™‚

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

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.