lilyhack
Posts: 6
Joined: Wed Jan 22, 2014 9:44 pm

connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 3:02 am

I am trying to connect a light bulb with a Rasp Pi (get power from Pi). The goal is to control the bulb from the Pi.

Is there any way to connect the power cable (2 prong US AC cable http://ecx.images-amazon.com/images/I/4 ... SX342_.jpg ) with the Pi?

Any other alternative?

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 3:24 am

A solid state relay is what you want.

A SSR can be directly driven from the GPIO pins safely.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
DougieLawson
Posts: 41683
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 7:52 am

IF YOU DON'T UNDERSTAND THE BASICS OF MAINS SWITCHING YOU SHOULD NOT BE EXPERIMENTING WITH MAINS VOLTAGES.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on Twitter/LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

mikerr
Posts: 2826
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 8:15 am

A safe way is those energenie plugs as recently featured on the rpi blog:
http://www.raspberrypi.org/controlling- ... e-pi-mote/
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
Douglas6
Posts: 5027
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 3:09 pm

lilyhack wrote:Is there any way to connect the power cable (2 prong US AC cable http://ecx.images-amazon.com/images/I/4 ... SX342_.jpg ) with the Pi?

Any other alternative?
You could use a PowerSwitch Tail II like this one: https://www.adafruit.com/products/268

But heed the warning: "Please note, this is a safer alternative to wiring up your own relays but still requires common sense and knowledge of electrical circuits. Stay within the rated limit of the relay and de-rate properly when not using resistive loads. Do not leave DIY electrical projects unattended or where they can get wet! This product is intended to be used by advanced hobbyists who are comfortable working with power supplies."

Are you an advanced hobbyist?

User avatar
Douglas6
Posts: 5027
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 3:19 pm

mikerr wrote:A safe way is those energenie plugs
I couldn't find a US version of those, unfortunately.

bbodin
Posts: 70
Joined: Sat Jun 28, 2014 3:23 pm

Re: connecting a light bulb with a Raspberry Pi

Sun Jul 20, 2014 4:34 pm

Douglas6 wrote:
mikerr wrote:A safe way is those energenie plugs
I couldn't find a US version of those, unfortunately.
A possibility is to use wireless power socket and hack the remote control to interface it to the RPi.

http://www.provantage.com/chamberlain-g ... HAM021.htm
Binh Bui

Mistertee
Posts: 24
Joined: Tue Aug 13, 2013 6:43 am

Re: connecting a light bulb with a Raspberry Pi

Wed Sep 10, 2014 3:15 pm

Take great care when switching mains. There is more to switching mains ON and OFF than just using the correct relay.

One has to take into account the following:
1. The correct spacing on the PCB between the mains voltage side and the low voltage side
2. Anchoring the mains cable so that they do not accidentally pull out and touch other parts - thus making them LIVE
3. The correct fusing - to prevent a fire in case of a fault
4. Prevent the user from accidentally touching the PCB with mains voltages on it.

Here is a safe way to do this. http://www.sf-innovations.co.uk/mains-s ... idget.html

Return to “Interfacing (DSI, CSI, I2C, etc.)”