trev7
Posts: 1
Joined: Sun Oct 28, 2012 10:20 pm

Home Automation - First Step

Sun Oct 28, 2012 10:36 pm

Hi All,

Like many others, I am new to the Pi but I have enjoyed what I have done with it so far.

What I would like to do is to take my first step towards home automation. As a first step I would like to use the Pi to switch on a couple of 240v 1w LED lights (you know, the kind you can get from B&Q which have a GU10 fitting and are direct replacements for the halogen version). I assume that to do this would require some kind of relay connected to the GND of the GPIO, and a switch live on say GPIO17.

If this is correct then it would be great to get the thumbs up from you guys as I don’t want to break my Pi. Also, I have no idea what relay I should buy and any help on this front would be very much appreciated; especially if you can recommend a part number from Maplins, RS, CPC, Tandy etc.

Many thanks in advance for your help.

Kind regards,

Trev

User avatar
MattHawkinsUK
Posts: 538
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
Contact: Website

Re: Home Automation - First Step

Mon Oct 29, 2012 12:00 am

You should definitely start by playing with low voltage stuff. LEDs, motors, buzzers etc. When you have mastered those move onto 240V. You do not want to make your early mistakes on mains voltages!
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: Home Automation - First Step

Mon Oct 29, 2012 12:15 am

Definitely what @MattHawkinsUK said is best to start.

I have used one of the relay's from E-bay to do exactly what your are asking, bear in mind one side of the relay is 110-240 (actually it states 30Vdc to 250Vac @10amps and the other side is 5v.

Mine says 5volt for arduino etc. but it works fine on the 3.3v for swichting but also note that each channel uses about 20ma and the 3.3v pin on the Raspi has a small ma limit so I have not used more than 2 of the 4 channels on my board.

the 110/220 side of the board is rated at 10 amps so that should easily power the light you want to use.

on the 5 volt side you have 1 ground for the 5volt(3.3volt in this case) and four pins to attach to GPIO pins for control.(there is a vcc pin also to fire up the led lights when a channel is activated)

On the 110/240 volt side you have three contacts per channel of which one is ground/neutral, one is normally open and will close when the relay is activated. and one is normally closed and will open when the relay is activated.

This one is similar to the one I bought and you can see the pin-outs in the pictures
http://www.ebay.com/itm/US-seller-4-Cha ... 20ca55ed35
I recommend you look around as you can find them cheaper sometimes and with more or less channels to use.(1,2 4,8,12,16 up to 32 that I have seen)
to use all 4 channels (or MORE)you would have to use a breakout board that allows you to use more amperage to fire more channels as 2 channels is starting push the raspi GPIO pins too hard.

All in all be careful to not to fry your Raspi.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

Return to “Other projects”