A question about relays

I specifically chose relays that required very little current. But after posting my code in the exhibition section someone said to make sure I properly drive my relays. after looking through the forum I have found various suggestions on how to properly drive a relay and I am looking for a definite answer on how to properly drive my 2 types of relays. they are: P# D3009 DPDT 5V 2A non-latching data sheet http://ecommas.tycoelectronics.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Specification+Or+Standard%7F108-98005%7FE%7Fpdf%7FEnglish%7FENG_SS_108-98005_E.pdf

and P# DIP05-1A72-11L SPST 200V 1A data sheet http://www.meder.com/fileadmin/meder/pdf/en/Products/Reed_Relays/Relay_DIP_Series_E.pdf

any help would be appreciated

For the DIP05-1A72-11L relay, that is the 5 volt coil with a 500 ohm resistance. That should give "about" 10 mA current draw which "should" allow you to drive it direct with Arduino. You have the "L" which is with no options, if you will order the "F" option it will have diodes across the coil to protect from voltage spikes. "IF" you already have the "L" relay, you should put a diode across the coil. google "relay diode protection" or something like that for a full explaination.

For the D3009, it draws about 30 mA which is pushing the limits too much on the Arduino, "IF" you use the D3023 the current draw is only 16 mA and you should be able to "get away" with that since you will only have two relays.... on different ports of the Arduino? Don't forget about the diodes across the coil.

The "proper" relay driver circuit is using a transistor (or MOSFET) to drive the relay - most relays take more current for the coil than the Arduino is able to provide, and it's a good idea to use a driver circuit.

BUT Arduino chips (m168 or m328) only cost $4 or $5 each so even if you do damage one, it's not end of the world! know better next time :P

I hope this helps some.

Ken H>

The basic circuit Richard posted is what you'll want to use, but if you are looking for more information on the diode, another term for it I have seen used is "snubber diode"...

thanks ken, if the chip is only $4-5 then F-it. it only draws about 30ma the max for an I/O is 40ma I'll risk the $$. it isn't being used for any vital operation. But I will put a diode in parallel.

Well looking at the coil specs for both relays, I see no reason you should not drive them directly from an Arduino output pin. The first relay you posted draws the most coil current, 28ma which is not much more then driving a simple LED with current limiting resistor set to 20 ma. You would be advised to wire a backwards connected diode right across the relay coil terminals for counter EMF protection. That second relay link shows that you can buy that relay with an internal protection diode already wired internal in the relay.

So relay drivers using transistors are pretty common, but if a +5vdc relay coil current load is well under the AVR I/O pins maximum current value, 40ma, why go to the added expense and complexity if it's not required?

Lefty

why go to the added expense and complexity if it's not required?

Because you don't want to end up like Ford and the Pinto?

I feel old...

;D

But seriously (and since this is a hobbyist things and not a life-or-death matter, this is more a what-if discussion), what happens if the relay shorts to ground? Bye-bye ATMega...?

With a transistor driver of some sort, you at least have that to fall back on; it isn't a big deal for hobby usage (as noted), but if you were doing this for a commercially sold product or such, it might be better if for some reason you had a bad batch of relays that failed prematurely in that manner (that you weren't aware of until you shipped). Rework on returned units would be cheaper with the transistor buffer (because it would save the higher cost microcontroller).

Then again, once again, the Pinto would catch on fire in a collision for the want of a 10 cent part (not that Ford learned their lesson; not too long back there was nearly the same issue with Crown Vics, especially those used by police)...

:)

On a similar subject, I will be interfacing my Arduino Mega to about 50 relays - as many as the Mega has outputs available.

50 (or so) transistors is a way to do this, but is there a chip of some sort that I can use a number of to make an interface that will be 'smaller'?

50 (or so) transistors is a way to do this, but is there a chip of some sort that I can use a number of to make an interface that will be 'smaller'?

Do a forum search for multiplex to see a lot of recent post on the subject.

Yes, we use a Darlington array in a 14pin dip package to drive our relays.

So try searching for Darlington pkgs. Ours are latching, you may have to think thru your total power draw if you are using non-latching relays.

Just a comment on the 40mA per pin on the Arduino - from what I read that is to be considered the MAX drop dead. From my reading (datasheet I think) 20mA should be considered the max to be used per pin. That is why I was suggesting an alternate relay in your same package.

VERY seldom will you destroy an Arduino due to high current demands, pop a chip maybe, but NOT the expensive Arduino itself. Those chips are not "that" expensive and easy to replace. I keep several m168 chips as spares to use in projects.

On the relay driver - I use a ULN2803 chip to drive small relays when I have several to drive. Usually along with a a BCD driver like the MC4028 to drive the ULN - that way with only 3 or 4 output pins I can drive a BUNCH of relays.

Ken H>