Pages: [1]   Go Down
Author Topic: What is the best way for controlling array of 8-16 relays?  (Read 2143 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello

There are several ways of controlling relays from atrduino:
-Using transistor, diode and resistor (and having a common ground)
-Using Optoisolator (I have found 4 channels IC, may be there are 8 channels)
-Using relay driver, like ULN2803A
-Using SSR and connecting it directly to arduino's pin without. This looks like the simplest solution, but  SSRs are not cheap and usually SPST. The also require heatsinks
-Using relay module

If I understand correctly, I need external power supply since all 8 relays could be activate at the same time.
If this is the case I will probably use some 12V LED driver. I'm not sure do I really need a complete isolation in this case?
Further, I'm planning to control relays using I2C port expander, so I *probably* will need to take into account input line power requirement.

So, my question is how do I choose the right option?
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 50
Posts: 2207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of relay. How much power to control the relay?

Mark
Logged

Toronto, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I2C port expander to a pair of ULN2803As to your relays should be enough. The relays don't require regulated power and their current needs are in their datasheet. Get a supply that has at least 50% more current then you need.

What are you switching and which relays are you planning on using?
Logged

Bill

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can easily control 16 relays ( or as many as you like ) directly with 2 TPIC6B595 serial latches, with  3 wires to the Arduino chip. it only needs  2 components - plus a 100nF capacitor on each chips +5v pin of course  ( the chips have inductive protection diodes built in ) :-

« Last Edit: October 06, 2012, 01:29:06 pm by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all for your replays.

I'm planning to build 8-sockets power strip, AC 220V. Two of them should be capable of 10A, the rest can be 5A.
My plan is to run i2c over regular usb wire. This way I will have an option to add the second power strip to USB hub.

I'm planning to use the following relay (or similar)
http://www.ebay.com/itm/5p-JQC-3F-T73-DC-12V-5PIN-125-250VAC-28VDC-Power-Relay-NEW-PB1-/170713872646?pt=LH_DefaultDomain_0&hash=item27bf56f906
with coil power 0.36W  (http://www.langir.com/htm/pcb-relay.htm)

TPIC6B595 looks very interesting. Pros: no need in port expander and lower voltage drop than with ULN. Cons: slower, but not sure how slow compared to relay's response time. Anything else?
Do I understand correctly that instead of using hub for connecting the second strip I will need to have a cascading port on the first one?
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The circuit I showed will handle those relays easily, the chip is a lot faster than the relays.

I use the Shiftout function to drive the outputs ( I have strips of LEDs, but it could be relays)

The serial data through the first chip ( which is a shift register ) pin 18, feeds the serial in to the next pin3 input, and so on.

You can have as many chips as you like.
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your help.

I have a several questions about using TPIC6B595

1. If relays are powered from external power supply, should the grounds be connected?
2. Where to put capacitor and why it is needed?
3. May I use arbitrary pins for data/latch/clock?
4. What will be the state of output pins on power on/restart?

Thanks again,
Yakov
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1. If relays are powered from external power supply, should the grounds be connected?

definately, thats the common reference for both the logic and the driver parts of the chip.

Quote
2. Where to put capacitor and why it is needed?

You will always need a 100nF capacitor near to any chip, between the 5v and ground for decoupling,  and you will also need a 1000 MFd electrolytic close to the relays 12v supply, to smooth any surges as the relays open and close .

Quote
3. May I use arbitrary pins for data/latch/clock?
 

If you are using shiftout to switch the relays then you can choose the pins.  (  shiftout is easily fast enough for switching relays )

Quote
4. What will be the state of output pins on power on/restart?

You can  set up the state of the all the  pins during start- up.  (  or there is a simple way to store the states in eeprom at power-down, to reload at power up again )

« Last Edit: October 08, 2012, 10:47:28 am by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
4. What will be the state of output pins on power on/restart?

This is an issue you need to deal with. See this on the http://ArduinoInfo.Info  WIKI:

http://arduino-info.wikispaces.com/ArduinoPower#4-8
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I usually want to start with everything off, so in my example I would shift out  B00000000  twice in the setup of the sketch,  but you could choose which relays you want to come on at power up, say number 3 relay, you could shift out  B00100000 then  B00000000.
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Texas, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 53
Arduino rocks!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I2C port expander to a pair of ULN2803As to your relays should be enough. The relays don't require regulated power and their current needs are in their datasheet. Get a supply that has at least 50% more current then you need.

What are you switching and which relays are you planning on using?

What he said. Use a PCF8574N 8-bit IO expander. Its the easiest to work with.
Logged

Working on a Smart Home Management System. Visit my blog: http://tae09.blogspot.com/ to find out more, and to keep track with the project.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thats 3 chips when its all in the 2 TPICs...  although the specs say the PCF can drive an LED , and the total output is 100mA, so it might be OK for 8 x  5v relays drawing less than 12mA ? 

The TPIC can sink 150mA per latch, and handle up to 50v relays, and uses just 3 pins of the micro.
« Last Edit: October 12, 2012, 02:01:44 am by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Pages: [1]   Go Up
Jump to: