News for hackers. Stuff that matters.
Re:Turn a light bulb on with every new user or download by ra on Tuesday April 30, 2013 @12:04AM (#5630370)
BIG FAT WARNING: If you're going to relay your Raspberry Pi / Arduino to mains electricity, be very, very careful!

Mains electricity can KILL. Make sure you learn about safe shielding, connecting and grounding practices.

Above all, be extremely cautious!

I can't stress this enough.

EDIT: For more information: http://tubelab.com/Safety.htm

Re:Turn a light bulb on with every new user or download by ars on Tuesday April 30, 2013 @12:23AM (#5630409)
Better yet: Don't connect your Raspberry Pi / Arduino at all to mains electricity unless you use an opto-isolator, or you have training in designing such circuits.

The usb relay is NOT designed for this! See the picture: http://www.circuitgizmos.com/products/cgu451/cgu451.shtml

In a device intended for hybrid hi/low voltage there is a clear gap between the high and low voltage components, and an isolation transformer or opto-isolator between them.

Re:Turn a light bulb on with every new user or download by glimcat on Tuesday April 30, 2013 @12:44AM (#5630462)
I have training in designing such circuits and I'd still use an opto-isolator.

This is not manufacturing. It's a one-off project. It's not a highly refined design. You don't have to worry about finessing a marginally lower build cost because of what it will mean in 10k unit quantities. Just use the opto-isolator.

Re:Turn a light bulb on with every new user or download by HeyLaughingBoy on Tuesday April 30, 2013 @04:28PM (#5634665)
You're overreacting!

An isolation transformer would be of absolutely no use here and the optoisolator would provide the same functionality that the existing relays on that board do.

I can't see how the PC board is laid out so I can't verify if there is inadequate separation between the control side and the isolated side of the relay (even so, you only need about 5mm separation to be minimally safe at 120V), but barring that, it's fine!

Yes, this particular device is not explicitly designed to deal with all the hazards of switching a high voltage load, but I don't see anything that leads me to believe that it's unsafe for that purpose.

Re:Turn a light bulb on with every new user or download by beagle3 on Tuesday April 30, 2013 @01:58AM (#5630627)
Others have mentioned the Belkin WeMo, which seems to be the best solution for anyone who doesn't want to mess with circuits (though I have no experience with, so can't comment). Does anyone know if it is available in a 220v format?

But if you do mess around with RasPis or Arduinos for that, I can't stress how useful the PowerSwitchTail is http://www.powerswitchtail.com/Pages/default.aspx - you give it a low power signal, and it switches a high power one. They have a 220v version as well.

Re:Turn a light bulb on with every new user or download by lostlogin on Tuesday April 30, 2013 @02:50AM (#5630740)
It's sold in New Zealand where I am, and we are on 240v.
Re:Turn a light bulb on with every new user or download by mikeash on Tuesday April 30, 2013 @09:03AM (#5631874)
Thanks a lot for the link. I've been idly pondering a couple of projects that would involve switching mains power with a microcontroller, but didn't encounter anything like that at a price that made me want to consider it. You may have saved me from a fiery doom.
Re:Turn a light bulb on with every new user or download by laumars on Tuesday April 30, 2013 @06:23AM (#5631293)
LEDs would be much better suited for this.

In fact if I had the free time then I'd build a binary display for page hits using a series of LEDs on a Raspberry Pi (sadly I have a million other projects going on at the moment - such as finishing my website so I can get hits to begin with hehehe)

Re:Turn a light bulb on with every new user or download by nitrogen on Tuesday April 30, 2013 @01:18AM (#5630537)
Indeed. For your own good, don't do this: http://palace-dci.sourceforge.net/images/electronics.jpg

Amazingly, I never had a single incident with that parallel port->breadboard+transistors+relays->lights setup from my high school days.

Re:Turn a light bulb on with every new user or download by michaelkscott on Tuesday April 30, 2013 @02:27AM (#5630697)
Pro tip: avoid hardware, stick to software. Just kidding.