1 Digital Output, multiple relays

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

1 Digital Output, multiple relays

Post by eros »

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?

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 1 Digital Output, multiple relays

Post by adafruit_support_bill »

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)
Image

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: 1 Digital Output, multiple relays

Post by eros »

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)
Image
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?

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 1 Digital Output, multiple relays

Post by adafruit_support_bill »

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.

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: 1 Digital Output, multiple relays

Post by eros »

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.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 1 Digital Output, multiple relays

Post by adafruit_support_bill »

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.

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: 1 Digital Output, multiple relays

Post by eros »

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?

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 1 Digital Output, multiple relays

Post by adafruit_support_bill »

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

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: 1 Digital Output, multiple relays

Post by eros »

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
relay.png (111.68 KiB) Viewed 1114 times

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: 1 Digital Output, multiple relays

Post by adafruit_support_bill »

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.

eros
 
Posts: 31
Joined: Wed Jun 04, 2014 1:58 am

Re: 1 Digital Output, multiple relays

Post by eros »

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.
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?

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: 1 Digital Output, multiple relays

Post by zener »

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%.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”