I'd like to control a 120V switch of some kind with a computer. I was hoping a unit might exist that could be plugged into 120V power with a male 120V on one end (which would be connected to a standard outlet), a female 120V on the other end, and USB B (or possibly Ethernet or something else) connector in the middle. Let's call this USB, Ethernet, or other connector the "middle connector."

I'd like to use a Raspberry Pi to send a signal across this middle connector, which would switch on the female 120V plug. I imagine using a "raw" (driver-less) method to send this signal over the middle connector, but maybe a Linux driver would exist for such a device, especially if it were USB.

So does anyone know if a computer-controlled 120V switch exists? I don't necessarily need a product recommendation (although I wouldn't mind it). I'd really like to know what these sorts of things are called or where to look. My searches for "computer-controlled 120V switch" have not been fruitful. I'd also like something UL certified, as opposed to some DIY kit. And I'd like to be able to load it up to 1kW.

  • possible duplicate of Easy way to trigger a switch via USB? – sawdust Sep 19 '13 at 22:27
  • This is in danger of being a product recommendation which is off-topic, however. pwrusb.com/featuresandbenefits.html – Tog Sep 20 '13 at 6:47
  • sawdust, the question you gave above is not nearly specific enough. The asker doesn't specify voltages, operating systems, or much of any details. I found that question earlier, but the answer of "USB relay switch" turned up nothing for me. – user1325179 Sep 21 '13 at 3:48
  • Tog, that looks promising. I'll need to do more research. Do you know of a generic name of that sort of thing? – user1325179 Sep 21 '13 at 3:51
  • @user1325179 sorry, no. FYI, adding the @ sign in front of someone's name will notify them that you've used their name. Hence the 2 day delay before I replied. – Tog Sep 23 '13 at 10:04

I use X10 devices to achieve this in a 240V country, and communicate with the X10 devices with a the computer interface device - I use the serial port version, but there are USB versions available now.

This has some advantages and disadvantages over what you are asking:

  • Pro: It allows one computer in one place to control relays spread around the house.
  • Pro: The computer is electrically isolated from most of the devices.
  • Pro: The basic power switcher unit does what you want - mains power at 2400W for the 240V version.
  • Pro: There are a range of other devices you can control. For example units that can go into a pre-existing light switch.
  • Pro: No special drivers required - just a serial port (or, I think a serial USB driver for the more modern USB computer controllers)
  • Con: It's pretty slow response - maybe half a second. Not usually a big deal.
  • Con: It can't be used where security is a concern.
  • Con: Signalling is normally one-way - you can't ask the switch what state it's in.
  • Con: The protocol is not guaranteed delivery - you can't be sure whether your issued request has been received or not.
  • I didn't end up going the route about which I originally asked. Instead, I'm using the GPIO pins. But I wanted to mark yours as the answer since its the best match for my original question. Thank you. – user1325179 Oct 9 '13 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.