Hardware

If you have 220V mains, this tutorial wont work for you - If we knew of an equivalent 220V controller like the PST we would have a link to it here

Power Tail 2

This tutorial works with all versions of Raspberry Pi (rev 1, 2, A, B, B+ and Zero) except the compute module which has no headers. 

The Powerswitch Tail 2 from Adafruit, looks like a 110V electrical lead with a box in the middle. 

The box is actually an opto-isolated solid-state relay. The opto-ilsolation bit means that there is no actual electrical connection between the low voltage switching circuit and the 100V mains. This makes it extremely safe and removes any chance of accidentally frying your Pi.

What is more the control input consumes just 3 mA of current at 3.3V, which means we can control it directly from one of the Pi's output pins.

The PIR sensor is connected to a different pin from lesson 12, so be sure to move the yellow lead.

 

Controllable Four Outlet Power Relay Module Version 2

The Controllable Four Outlet Power Relay Module Version 2 can be used as an alternative for this project. 

40-Pin (A, B, B+ and Zero) Cobbler Plus Schematic

20-Pin (Raspberry Pi Rev 1 and Rev 2) Cobbler Schematic

The Powerswitch Tail comes with a little indicator LED that shows when it is on, so you do not need to connect anything high voltage to it yet.

This guide was first published on Feb 18, 2013. It was last updated on Feb 18, 2013. This page (Hardware) was last updated on Jul 21, 2019.