Page 1 of 1
automation - light control
Posted: Fri Feb 12, 2016 5:02 am
by malini
Hi!
I'm trying to control an LED(5 mm LED) from the relay using raspberry pi 2 board. I have an 8 channel 5V relay. I also have a 9V dc battery for the LED. I'm a little confused with the connections regarding the relay because i don't want to damage my Pi.
So one side of the relay will be the raspberry pi and the other side will be 9V battery and the led?
I have attached an image file showing the connections. Is it alright?
Re: automation - light control
Posted: Fri Feb 12, 2016 5:42 pm
by Burngate
malini wrote:Is it alright?
Looks good - apart from the LED needing a series resistor (it controls the current through the LED, and without one, your Pi won't mind, but you'll go through a lot of LEDs while you're playing)
Re: automation - light control
Posted: Fri Feb 12, 2016 5:46 pm
by Laurens-wuyts
What realy are you planning to use (link)?
You'll probably also need a flyback diode across the relay.
Laurens
Re: automation - light control
Posted: Fri Feb 12, 2016 7:09 pm
by Burngate
Laurens-wuyts wrote:... a flyback diode across the relay.
It looked to me that since the "relay" has 3 connections - Vcc, Gnd, In1 - it includes a driver circuit, which would have a fly-back diode built in?
Re: automation - light control
Posted: Fri Feb 12, 2016 8:08 pm
by Laurens-wuyts
Burngate wrote:It looked to me that since the "relay" has 3 connections - Vcc, Gnd, In1 - it includes a driver circuit, which would have a fly-back diode built in?
Well, it could be, but as long as we don't know the specific relay, we're not sure

(better safe than sorry

)
Laurens
Re: automation - light control
Posted: Sat Feb 13, 2016 9:41 am
by Burngate
True
Re: automation - light control
Posted: Sat Feb 13, 2016 10:15 am
by malini
https://www.google.co.in/search?q=8+cha ... auDqY6M%3A
this is the link.
I guess the diode and everything is built in right?
Re: automation - light control
Posted: Sat Feb 13, 2016 10:17 am
by malini
and yes.. I am using a resistor with the led.
Re: automation - light control
Posted: Mon Feb 15, 2016 7:15 am
by malini
the relay is just clicking but the led isn't lighting up! And sometimes when i terminate the program, the relay still keeps clicking. Why so? can someone please help?