Ever been scared to venture into the world of controlling AC power from your microcontroller? Me too. And that’s smart, because household AC can hurt/maim/kill if you’re not careful. The PowerSwitch Tail is a safe, easy-to-use AC relay that is triggered with a mild-mannered 5V DC signal from your Arduino or other microcontroller or circuit. Computers can talk to Arduinos directly, but adding XBee radios to the mix makes your serial communications wireless.
Build a circuit
First thing we want to do is build a circuit to control the PowerSwitch Tail from an Arduino.
You may be able to plug a Digital output pin and ground from the Arduino directly into the PST, but the current is a bit low and may fail to switch the relay. So this power circuit should do the trick. We’re using the Arduino Pin 13 to switch on a transistor, which in turn switches on the PST relay with the higher, recommended current.
Follow the circuit diagram here, then upload a default “Blink” sketch to the Arduino. When you plug the PST into the wall, and a blender (or other AC device) into the PST, your blender will turn on and off every second.