Rocode >> Hobbies >> PowerSwitchTail

Detailing my usage of a PowerSwitch Tail

This page details my usage of a PowerSwitch Tail to programmatically switch a power point on and off again.

I purchased my PowerSwitch Tail kit online from the USA. The 240 volt models may be purchased online at

I purchased a $2.50 mains extension lead from Bunnings and cut it in half.

Cheap Extension Lead From Bunnings

The PowerSwitch Tail came in a United States Postal Service cardboard box and included all parts.

I found the assembly instructions on the web at

Here is a photo of the printed circuit board with components assembled.

PCB Assembly of the PowerSwitch Tail II

I took a photo of the underside of the PCB to show you my soldering skills. Please don't criticise my amateur skills!

Underneath soldering of the PowerSwitch Tail II

The assembled PowerSwitch Tail components were then placed in the supplied mounting case and the cut off ends of the mains extension lead connected to the terminal blocks of the PCB.

Assembled PowerSwitch Tail II

The kit comes with some additional resisters so that you may change the desired input voltage from your relay source. I selected the 3 - 5 volts range in this instance as that matches the GPIO outputs on a Raspberry Pi.

Shown here is a Raspberry Pi GPIO Adapter with breadboard connecting to the signal input of the PowerSwitch Tail. The lit red LED on the PowerSwitch Tail indicates that the relay is enabled.

PowerSwitch Tail connected to a Raspberry Pi

When enabled in Normally Open mode, the PowerSwitch Tail will supply power to an appliance. In this case we show a red light being enabled.

PowerSwitch Tail controlling a light

In this example the relay input of the PowerSwitch Tail was connected to the GPIO pin #4.

So to turn the red light off and on you simply switch the output mode of GPIO #4 between on (1) and off (0).

Don't forget to firstly switch GPIO #4 to output mode.

Switching GPIO #4 on and off on a Raspberry Pi

This Raspberry Pi code above will:

  • Set GPIO Pin #4 to output mode
  • Make sure the red light is initially turned off
  • Wait 2 minutes
  • Turn the red light on
  • Wait 2 minutes
  • Turn the red light off again

    I have subsequently built a custom soldered breadboard to interface with the PowerSwitch Tail II.

    PowerSwitch Tail Soldered Breadboard

    The pinouts mapping on the GPIO adapter to the Wiring Pi software may be found on the web as This was confusing at first as the mapping was not as I initially expected. The above photo shows Wiring Pi pin "1" being used. This is referred to as the "GPIO18" pin.

    The new breadboard replaces the red GPIO breakout adapter, white solder less breadboard and blue terminal block previously used.

    PowerSwitch Tail Interface

    A standard ribbon cable connects the GPIO terminal on the Raspberry Pi to the black terminal on the breadboard. The header pin is for connecting +5 volts and negative to the PowerSwitch Tail.

    The earlier code needs updating to pin 1.

    Switching GPIO #1 on and off on a Raspberry Pi

    Here is the other end of the ribbon cable connected to an old Raspberry Pi Model B

    Raspberry Pi Model B