blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Raspberry Pi Relay Board and Light Bulb

Thu Dec 18, 2014 5:31 pm

Hi everyone,
Im planing on creating a home automation system for a school project next year but I want to start planing it out now. The biggest and probably most important part I think would be controlling the lighting. I know you can use a relay board to control appliances and stuff but how would I go about controlling a light bulb?

UrosRaspberry
Posts: 40
Joined: Thu Mar 27, 2014 6:36 pm

Re: Raspberry Pi Relay Board and Light Bulb

Fri Dec 19, 2014 12:02 pm

It's exactly the same !
You could either use relays or solid state relays (I think a simple relay will be easier )
You just need to have a relay board , female to female jumper wires , light bulb socket and some wires to wire it.
If you already setup the raspberry pi and relay all you need is the socket and the wires.
BUT : First test the relay with a small voltage not mains , and experiment a little on it because there are 2 types of relays (1. activate when the gpio is set low , and the other activate when its set high ) I have both types , if you want i can show you how to setup it .
Hope this helps!

blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Re: Raspberry Pi Relay Board and Light Bulb

Fri Dec 19, 2014 4:43 pm

Thanks so much, certainly did help!

blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Re: Raspberry Pi Relay Board and Light Bulb

Fri Dec 19, 2014 5:04 pm

Just another small question, would I be able to connect a bunch of other things at the same time, for example with an 8 channel relay board could I control 8 light bulbs or 4 light bulbs and 4 other appliances or would that fry the poor raspberry pi?

User avatar
BAStumm
Posts: 134
Joined: Fri Aug 23, 2013 3:37 pm
Location: Loon Lake, WA USA
Contact: Website

Re: Raspberry Pi Relay Board and Light Bulb

Fri Dec 19, 2014 11:56 pm

50mA max draw for all GPIO pins combined. Assuming your relay draws around 3mA to latch then the RPi can operate 8 relays no problem. If your relay draws 10mA each then you can only drive 5. There are ways to get around this limitation using additional circuitry.

blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Re: Raspberry Pi Relay Board and Light Bulb

Sun Dec 21, 2014 3:48 am

Ok thats good to know, thanks for that. What if I were to plug in multiple relay boards into the pi, would I be able to do that or would I need to get another raspberry pi for that?

User avatar
rpdom
Posts: 18140
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Pi Relay Board and Light Bulb

Sun Dec 21, 2014 8:35 am

You can connect as many relays as you have available GPIO pins. By default on the model A/B there are 8 pins configured for general use and 9 configured for other uses that could be changed. That gives you 17 pins. On the model A+/B+ there are an additional 9 general use pins giving you up to 25 pins available. You still have to be careful of that max current limit.

You can instead connect some GPIO extender chips which could give you hundreds of inputs/outputs to use. If you run the chips from a separate power supply they will be able to drive loads of relays without worrying about the current limit on the Pi.

blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Re: Raspberry Pi Relay Board and Light Bulb

Sun Dec 21, 2014 5:00 pm

Ok thank you so much. Now I don't mean to be a pain in the neck with all these questions but how would I use a seperate power source?

UrosRaspberry
Posts: 40
Joined: Thu Mar 27, 2014 6:36 pm

Re: Raspberry Pi Relay Board and Light Bulb

Sun Dec 21, 2014 5:19 pm

Here is what i would sugest you to do , if you dont want more than 17 relays ( model A & B ) or 25 (A+ & B+) just get the amount of relay boards you want , but instead of connecting VCC and GND to the pi , connect them to a phone charger or any 5v supply . if you are not using more than 5-8 relays ( depends on the relay ) you can power them directly from the pi.

blenderednelb
Posts: 9
Joined: Thu Dec 18, 2014 6:28 am

Re: Raspberry Pi Relay Board and Light Bulb

Sun Dec 21, 2014 9:53 pm

Ok thats good to know, thanks for that!

Return to “Automation, sensing and robotics”