Skip to main content
added more details on the implementation
Source Link

SoWe used a Raspberry Pi to control AC power through a 5V relay switch, we just did thiswired through the breadboard. At least with our The breadboard had no metal terminals on the bottom-- it was plastic all around. We experienced inconsistent behavior, everythingbut we found out that it was okthe RaspPi sending a 3. It does seem3V control signal, which wasn't always enough power to mess upcontrol the pin holes after5V relay.

We also had the whole system behind a few uses15A breaker (cut an extension cord into 3 parts, but I guess it's safe.one that plugged from the wall to the breaker, one from the breaker to the relay, and the last from the relay to a standard wall receptacle you can buy from Lowes). This way, if we messed up somehow and the power ended up going back up the line, it would trip the breaker and not kill the electricity in our office.

As far as software, we used a Node. I mean sort ofjs on the Raspberry Pi to talk to a Socket.io server. The client maintains a persistent connection, listening for "pin up" or "pin down" messages over the socket. I mean take this with If it receives a grainmessage, it uses the pi-pgio npm module to control pin 12 of saltthe Pi, which triggers the relay and turns power on or off on our receptacle. Anyways here's

Here's the videofinished product:    https://www.youtube.com/watch?v=OmcQZD_LIAE

Ingredients:

  • Raspberry Pi, running Ubuntu and Node.js, using the pi-gpio module
  • Raspberry Pi GPIO pin header
  • USB wireless card
  • 5V Relay -> RadioShack
  • Breadboard and cables -> RadioShack
  • Extension cord -> Lowes
  • 15 amp breaker -> Lowes
  • Electrical tape -> Lowes
  • Wall power receptacle -> Lowes

Next steps:

  • Transformer to convert the AC line to DC power (before the relay) to power the Pi
  • Replace the Pi with an arduino and rewrite the socket client

In summary, yes, it is possible, and yes you can do it safely. Obviously, you need to be very careful handling any of this system when the power is plugged in. If you have access to anyone who's worked residential electric, it helps to ask their help, mainly as a sanity check and to give you the confidence to actually go through with it :)

Hope that helps, and good luck!

So, we just did this. At least with our breadboard, everything was ok. It does seem to mess up the pin holes after a few uses, but I guess it's safe.... I mean sort of... I mean take this with a grain of salt. Anyways here's the video:  https://www.youtube.com/watch?v=OmcQZD_LIAE

We used a Raspberry Pi to control AC power through a 5V relay switch, wired through the breadboard. The breadboard had no metal terminals on the bottom-- it was plastic all around. We experienced inconsistent behavior, but we found out that it was the RaspPi sending a 3.3V control signal, which wasn't always enough power to control the 5V relay.

We also had the whole system behind a 15A breaker (cut an extension cord into 3 parts, one that plugged from the wall to the breaker, one from the breaker to the relay, and the last from the relay to a standard wall receptacle you can buy from Lowes). This way, if we messed up somehow and the power ended up going back up the line, it would trip the breaker and not kill the electricity in our office.

As far as software, we used a Node.js on the Raspberry Pi to talk to a Socket.io server. The client maintains a persistent connection, listening for "pin up" or "pin down" messages over the socket. If it receives a message, it uses the pi-pgio npm module to control pin 12 of the Pi, which triggers the relay and turns power on or off on our receptacle.

Here's the finished product:  https://www.youtube.com/watch?v=OmcQZD_LIAE

Ingredients:

  • Raspberry Pi, running Ubuntu and Node.js, using the pi-gpio module
  • Raspberry Pi GPIO pin header
  • USB wireless card
  • 5V Relay -> RadioShack
  • Breadboard and cables -> RadioShack
  • Extension cord -> Lowes
  • 15 amp breaker -> Lowes
  • Electrical tape -> Lowes
  • Wall power receptacle -> Lowes

Next steps:

  • Transformer to convert the AC line to DC power (before the relay) to power the Pi
  • Replace the Pi with an arduino and rewrite the socket client

In summary, yes, it is possible, and yes you can do it safely. Obviously, you need to be very careful handling any of this system when the power is plugged in. If you have access to anyone who's worked residential electric, it helps to ask their help, mainly as a sanity check and to give you the confidence to actually go through with it :)

Hope that helps, and good luck!

Source Link

So, we just did this. At least with our breadboard, everything was ok. It does seem to mess up the pin holes after a few uses, but I guess it's safe.... I mean sort of... I mean take this with a grain of salt. Anyways here's the video: https://www.youtube.com/watch?v=OmcQZD_LIAE