Using Raspberry Pi to control an electrical outlet

Lead Image © Deanna Boldrick, 123RF.com

Socket Hop

Raspberry Pi fills in for a remote control device, switching the power on and off at an electrical outlet.

I'm sure I'm not the only person who jumped at the chance to buy a machine like the Raspberry Pi, then wondered what to do with it. It isn't the first time I've bought something that seemed like a good idea then been stuck for how to use it. A couple of years ago, I noticed a sign on a petrol pump advertising a similarly fascinating device: a remote-controlled power sockets at UK£ 5 for a pack of three (Figure 1). The device plugs into a wall socket, and you can plug an electrical appliance into it. A remote control that comes with the device lets you turn the power to the appliance on or off. The device thus lets you use the remote to control the power to any appliance (such as a lamp or a coffemaker), as you would for a garage door opener or a TV set.

I bought the device and tried it with a few random appliances, stuck it in the cupboard, and forgot about it. When pondering a project for my Raspberry Pi, I hit upon the idea of combining these two impulse purchases. Could I get the Raspberry Pi to imitate the behavior of the remote so that I could turn appliances on and off with it?

I made up a lot of this as I went along, and I'll describe the episode chronologically, so you can share my sense of discovery.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Automating the home with the Raspberry Pi

    The Raspberry Pi GPIO interface offers the perfect starting point from which to control devices, such as turning lights on and off, starting the coffee machine in the morning, or turning on the TV and playing your favorite movies at scheduled times.

  • Android Pi

    Your Android device can be a versatile companion for Raspberry Pi. We describe some useful apps to help you make this happen.

  • Raspberry Pi IR remote

    Turn a Raspberry Pi into an IR remote control for your DSLR, TV, or any other device with an IR port.

  • A new way of no-solder prototyping

    The Grove system's standardized connector and multitude of devices allow quick and easy project prototyping with your favorite small-board computers.

  • PHP on Raspberry Pi

    Getting started with PHP on Raspberry Pi is easy. We show how to build a simple PHP app to control an LED.