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.
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.
I took a photo of the underside of the PCB to show you my soldering skills. Please don't criticise my amateur skills!
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.
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.
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.
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.
This Raspberry Pi code above will:
I have subsequently built a custom soldered breadboard to interface with the PowerSwitch Tail II.
The pinouts mapping on the GPIO adapter to the Wiring Pi software may be found on the web as http://wiringpi.com/pins/. 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.
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.
Here is the other end of the ribbon cable connected to an old Raspberry Pi Model B