Go Down

Topic: MEGA 2560 with 48 relays (Read 2454 times) previous topic - next topic

FW51

Dear forumers,
I am a "neophyte" in hardware. It mans that my question could be stupid  :smiley-roll-sweat:
I want to connect 48 relays ( 6 eight channel relay modules) on my MEGA. Each relay via its optocoupler needs 30mA. Thus the controller has to deliver 48 x 0.030A = 1.44A.
Wat's the solution? :smiley-mr-green:

Best regards

FW51

cyclegadget


You will almost certainly need a separate power supply for your loads that the relays control. You need to provide a link or data sheet for the ( 6 eight channel relay modules) and/or optocoupler you plan to use.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

JoeN

Many of the GPIO driven 8 relay controllers that I see out there already are opto-isolated, you just have to drive the input and provide a separate power supply for the relay board itself.  Do you have a link for the boards you want to use?

http://www.sainsmart.com/8-channel-dc-5v-relay-module-for-arduino-pic-arm-dsp-avr-msp430-ttl-logic.html?___store=en&___store=en
I have only come here seeking knowledge. Things they would not teach me of in college.

FW51

The 8 relay module described in the previous message is exactly the one I use.
It means that each input needs 25 mA.
Thus each MEGA digital output must deliver 25 mA.
Is it true ? Or am I wrong in my mind?

Best regards

CrossRoads

"5V 8-Channel Relay interface board, and each one needs 15-20mA Driver Current "

Yes, channels can be driven from Arduino pins. Low will drive the relay.
Channels have current limit resistors built in already.

Mega can sink a max of 800mA at one time, therefor 40 relays max on at one time.
Read the 2560 data sheet, pg 368-369, to understand how to spread out the loads. Section 3 below applies to you:

3. Although each I/O port can sink more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state
conditions (non-transient), the following must be observed:
ATmega1281/2561:
1.)The sum of all IOL, for ports A0-A7, G2, C4-C7 should not exceed 100mA.
2.)The sum of all IOL, for ports C0-C3, G0-G1, D0-D7 should not exceed 100mA.
3.)The sum of all IOL, for ports G3-G5, B0-B7, E0-E7 should not exceed 100mA.
4.)The sum of all IOL, for ports F0-F7 should not exceed 100mA.
ATmega640/1280/2560:
1.)The sum of all IOL, for ports J0-J7, A0-A7, G2 should not exceed 200mA.
2.)The sum of all IOL, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3.)The sum of all IOL, for ports G3-G4, B0-B7, H0-B7 should not exceed 200mA.
4.)The sum of all IOL, for ports E0-E7, G5 should not exceed 100mA.
5.)The sum of all IOL, for ports F0-F7, K0-K7 should not exceed 100mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
than the listed test condition.

4.  Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady
state conditions (non-transient), the following must be observed:
ATmega1281/2561:
1)The sum of all IOH, for ports A0-A7, G2, C4-C7 should not exceed 100mA.
2)The sum of all IOH, for ports C0-C3, G0-G1, D0-D7 should not exceed 100mA.
3)The sum of all IOH, for ports G3-G5, B0-B7, E0-E7 should not exceed 100mA.
4)The sum of all IOH, for ports F0-F7 should not exceed 100mA.
ATmega640/1280/2560:
1)The sum of all IOH, for ports J0-J7, G2, A0-A7 should not exceed 200mA.
2)The sum of all IOH, for ports C0-C7, G0-G1, D0-D7, L0-L7 should not exceed 200mA.
3)The sum of all IOH, for ports G3-G4, B0-B7, H0-H7 should not exceed 200mA.
4)The sum of all IOH, for ports E0-E7, G5 should not exceed 100mA.
5)The sum of all IOH, for ports F0-F7, K0-K7 should not exceed 100mA.
If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current
greater than the listed test condition.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

terryking228

Hi, The relay boards I am familiar with use MUCH less current for the optoisolator signal inputs.

What I measured is on the schematic here: http://goo.gl/cIrjN  (Scroll down): 2 ma

So the Mega should not have a problem...

You DO need to provide a separate 5V supply for the relays themselves and their driver transistors.
NOTE: Each relay draws about .08A (80 Ma) when on, so if all 8 relays are actuated the board needs about 8*80 or 640 Ma (.64 amps).

But unless you are are going to activate more than 1/2 the relays at once, this should do it:
http://goo.gl/kfn5K 

To keep from going crazy with all the wires, I suggest you use a MEGA Sensor Shield
http://arduino-info.wikispaces.com/SensorShield   (Scroll down)

...and cables made up from strippable flat cables like the ones shown here:
http://arduino-info.wikispaces.com/ArduinoPower#4-8


DISCLAIMER: Mentioned stuff from my own shop...


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

JoeN

If you read one of the reviews on the board at that site:

Quote
I just received an 8 channel and a 2 channel relay module today. It took me a while to figure out that the pins have to be driven low, not high, to cause the relay to activate. Not only that, but the current sink is less than 3 mA. I don't know what the "15-20mA Driver Current" is all about.


Maybe that current is the amount of current required to switch the relay because it does seem high for an optoisolator.  I think you are good to go with this board.
I have only come here seeking knowledge. Things they would not teach me of in college.

terryking228

#7
Sep 22, 2012, 01:04 am Last Edit: Sep 22, 2012, 01:06 am by terryking228 Reason: 1
Quote
I just received an 8 channel and a 2 channel relay module today. It took me a while to figure out that the pins have to be driven low, not high, to cause the relay to activate.


There is actually a VERY good reason for that: to be able to guarantee that at powerup and Arduino Reset that no relays will actuate, even momentarily, until activated on purpose by your software.

See the explanation and sample code on the  ArduinoInfo WIKI http://arduinoinfo.info    Here:   http://arduino-info.wikispaces.com/ArduinoPower#4-8

See "Important Note"...

Years ago, we had to sequence and time power supplies to guarantee this on Chip Manufacturing equipment.
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

retrolefty


If you read one of the reviews on the board at that site:

Quote
I just received an 8 channel and a 2 channel relay module today. It took me a while to figure out that the pins have to be driven low, not high, to cause the relay to activate. Not only that, but the current sink is less than 3 mA. I don't know what the "15-20mA Driver Current" is all about.


Maybe that current is the amount of current required to switch the relay because it does seem high for an optoisolator.  I think you are good to go with this board.


No, the input section of a opto is an LED, and 15-20 ma is the nominal maximum forward current spec for most leds. However just like most LEDs there is significant light generated even at 3ma and in this case enough to activate the opto's output stage. What we probably have there is a board that they can sell in either a 5vdc, 12vdc, or 24vdc versions just by stuffing it with the proper coil voltage relays. So they probably sized the external LED series limiting resistor such that one resistor value would work no matter what voltage relay version they sold it as. At least that's my theory as it fits how many solid state AC relays work with their wide 3-32vdc input operating spec, as that voltage feeds an internal current limiting resistor and optoisolator to activate the thyristor device.

http://www.google.com/imgres?imgurl=http://www.futurlec.com/Pictures/Solid_State_Relay_300.jpg&imgrefurl=http://www.futurlec.com/Relays/SSR25A.shtml&h=321&w=300&sz=29&tbnid=91uFUCp2XWwEEM:&tbnh=90&tbnw=84&prev=/search%3Fq%3Dsolid%2Bstate%2Brelay%26tbm%3Disch%26tbo%3Du&zoom=1&q=solid+state+relay&usg=__At8peG3U0UeLJA0Zl72Y7HgyO3E=&docid=7FX9V3bVssvUHM&hl=en&sa=X&ei=ffZcUMO6Nob89QSBmICgAQ&ved=0CFsQ9QEwBQ&dur=3146

Lefty

FW51

Thanks for your answers

FW   :)

Go Up