Hi All,
I have an Arduino and have a question on a circuit I'm building. I would like to turn on 4 relays at the same time when 1 digital pin is turned on. So if pin 5 is set to high, I want 4 relays to activate 4 lights. The relays I have are below, I'll need to turn on 48 lights and don't have enough output pins, and there will be 4 lights in each zone.
http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... OC:US:3160
Is there a chip or device I can use to accomplish this?
1 Digital Output, multiple relays
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1 Digital Output, multiple relays
https://www.adafruit.com/product/355
That should handle 4 relays in parallel easily. Just be sure to use diodes to protect the MOSFET from the inductive kickback from the relays.
(R1 and R2 are not required for the device linked above. You can connect the gate directly to the Arduino pin)
That should handle 4 relays in parallel easily. Just be sure to use diodes to protect the MOSFET from the inductive kickback from the relays.
(R1 and R2 are not required for the device linked above. You can connect the gate directly to the Arduino pin)
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: 1 Digital Output, multiple relays
I see a 12v in, and a total of 3 leads. There is a 5v out from the Arduino, will this suffice? And I can wire 4 relays to the 2 remaining leads?adafruit_support_bill wrote:https://www.adafruit.com/product/355
That should handle 4 relays in parallel easily. Just be sure to use diodes to protect the MOSFET from the inductive kickback from the relays.
(R1 and R2 are not required for the device linked above. You can connect the gate directly to the Arduino pin)
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1 Digital Output, multiple relays
The relays are connected in parallel with the diode (the box labeled "Electric Strike".)
As for the voltage required, that depends on the relays you are using. You haven't provided specs for those.
As for the voltage required, that depends on the relays you are using. You haven't provided specs for those.
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: 1 Digital Output, multiple relays
The relays I'll be using was in my first post - http://cgi.ebay.com/ws/eBayISAPI.dll?Vi ... OC:US:3160
This will turn on mains voltage at 120V. The way I understand it is, 5V and ground from the Arduino to power on the relay, and digital output pins to control the individual relays.
This will turn on mains voltage at 120V. The way I understand it is, 5V and ground from the Arduino to power on the relay, and digital output pins to control the individual relays.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1 Digital Output, multiple relays
The specs are pretty minimal and there is no pinout., but it looks like it will work with 5v. You probably don't need anything as powerful as the MOSFET, but you might need a smaller transistor if you want to drive all the inputs from one pin. I'd ask the seller for details.
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: 1 Digital Output, multiple relays
Is there a transistor you can recommend? Also I'm still a little confused on how the wiring will go, I'm new to the game so bear with me. I googled the transistor and there's an emitter, a base, and a collector, but what wires to where? Also, you mentioned diodes to protect from kickback, I've heard this before but can you provide additional insight on this?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1 Digital Output, multiple relays
It looks like the relay board probably has diodes on it. The seller should be able to confirm that, and give you a pinout for the wiring.
They should also be able to tell you what the current requirements are to drive each relay.
The digital pins of the Arduino can source 40mA max, but it is best to try to keep it under 20mA. If the inputs require more than 2.5A per relay, then you should use a transistor to drive all 8. Something like this should work: https://www.adafruit.com/product/756
They should also be able to tell you what the current requirements are to drive each relay.
The digital pins of the Arduino can source 40mA max, but it is best to try to keep it under 20mA. If the inputs require more than 2.5A per relay, then you should use a transistor to drive all 8. Something like this should work: https://www.adafruit.com/product/756
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: 1 Digital Output, multiple relays
I was able to acquire this from the supplier. I'm a little rusty in my schematic readings, but it seems theres a diode in place. Does this mean I'm safe from kickback from the relays?
- Attachments
-
- relay.png (111.68 KiB) Viewed 1123 times
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: 1 Digital Output, multiple relays
Looks like it has kickback diodes, drive transistors and optical isolation. You are doubly safe from any relay kickback.
You will need 4-5mA per channel to drive the opto-isolator inputs. 8 x 5 = 40mA which is the absolute maximum for an Arduino pin. I don't recommend driving things at the absolute max - other than possibly for very brief periods. If you can spare a second pin to drive half the load that would be an easy solution. Otherwise, I'd suggest using a buffer like this: https://www.adafruit.com/products/1787
You can drive four input pins on the buffer chip with one Arduino pin. Then you can drive two channels of your relay board from each of the 4 buffer output pins.
You will need 4-5mA per channel to drive the opto-isolator inputs. 8 x 5 = 40mA which is the absolute maximum for an Arduino pin. I don't recommend driving things at the absolute max - other than possibly for very brief periods. If you can spare a second pin to drive half the load that would be an easy solution. Otherwise, I'd suggest using a buffer like this: https://www.adafruit.com/products/1787
You can drive four input pins on the buffer chip with one Arduino pin. Then you can drive two channels of your relay board from each of the 4 buffer output pins.
-
- Posts: 31
- Joined: Wed Jun 04, 2014 1:58 am
Re: 1 Digital Output, multiple relays
My sketch shouldn't have on all relays at once so I should be fine. Worst case with what you've described I'll need 4 of these chips to drive all the relays on the board?adafruit_support_bill wrote:Looks like it has kickback diodes, drive transistors and optical isolation. You are doubly safe from any relay kickback.
You will need 4-5mA per channel to drive the opto-isolator inputs. 8 x 5 = 40mA which is the absolute maximum for an Arduino pin. I don't recommend driving things at the absolute max - other than possibly for very brief periods. If you can spare a second pin to drive half the load that would be an easy solution. Otherwise, I'd suggest using a buffer like this: https://www.adafruit.com/products/1787
You can drive four input pins on the buffer chip with one Arduino pin. Then you can drive two channels of your relay board from each of the 4 buffer output pins.
- zener
- Posts: 4567
- Joined: Sat Feb 21, 2009 2:38 am
Re: 1 Digital Output, multiple relays
I can't argue with anything said here, except I think the opto drives will only take about 2mA max: (5-2-1.2)/1000=.0018 And that would make sense if you assume the drive transistor needs 1mA base current and the min Opto CTR is 50%.
Please be positive and constructive with your questions and comments.