malini
Posts: 14
Joined: Thu Feb 11, 2016 11:18 am

automation - light control

Fri Feb 12, 2016 5:02 am

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?
Attachments
image.jpg
image.jpg (56.51 KiB) Viewed 1300 times

User avatar
Burngate
Posts: 6303
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: automation - light control

Fri Feb 12, 2016 5:42 pm

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)

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: automation - light control

Fri Feb 12, 2016 5:46 pm

What realy are you planning to use (link)?
You'll probably also need a flyback diode across the relay. ;)

Laurens

User avatar
Burngate
Posts: 6303
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: automation - light control

Fri Feb 12, 2016 7:09 pm

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?

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: automation - light control

Fri Feb 12, 2016 8:08 pm

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 :lol: )

Laurens

User avatar
Burngate
Posts: 6303
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: automation - light control

Sat Feb 13, 2016 9:41 am

True

malini
Posts: 14
Joined: Thu Feb 11, 2016 11:18 am

Re: automation - light control

Sat Feb 13, 2016 10:15 am

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?

malini
Posts: 14
Joined: Thu Feb 11, 2016 11:18 am

Re: automation - light control

Sat Feb 13, 2016 10:17 am

and yes.. I am using a resistor with the led.

malini
Posts: 14
Joined: Thu Feb 11, 2016 11:18 am

Re: automation - light control

Mon Feb 15, 2016 7:15 am

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?

Return to “Automation, sensing and robotics”