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?
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
-
- Posts: 40
- Joined: Thu Mar 27, 2014 6:36 pm
Re: Raspberry Pi Relay Board and Light Bulb
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!
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!
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
Re: Raspberry Pi Relay Board and Light Bulb
Thanks so much, certainly did help!
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
Re: Raspberry Pi Relay Board and Light Bulb
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?
Re: Raspberry Pi Relay Board and Light Bulb
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.
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
Re: Raspberry Pi Relay Board and Light Bulb
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?
Re: Raspberry Pi Relay Board and Light Bulb
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.
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.
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
Re: Raspberry Pi Relay Board and Light Bulb
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?
-
- Posts: 40
- Joined: Thu Mar 27, 2014 6:36 pm
Re: Raspberry Pi Relay Board and Light Bulb
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.
-
- Posts: 9
- Joined: Thu Dec 18, 2014 6:28 am
Re: Raspberry Pi Relay Board and Light Bulb
Ok thats good to know, thanks for that!