arduino - low power relay, without transistor

Is this ok to do (digital pin straight to relay coil), as long as the switching coil needs no more than 200mW @ 5V?

Presumably a 5v diode is still necessary?

thanks

as long as the switching coil needs no more than 200mW @ 5V?

No the arduino pin can only supply safely about 35mA, so no more than that.

Grumpy_Mike:

as long as the switching coil needs no more than 200mW @ 5V?

No the arduino pin can only supply safely about 35mA, so no more than that.

Which equates to about 100mW.

There are telecom type relays that Arduino's can drive directly, and yes diode is stil needed.
I put 15 or 18 of them on a card for a '1284 chip to drive, with a 1N4148 diode across each coil.
Need to check for coil resistance - want it >= (5V/.035A) = 145, 150 ohm or so and a 5V rated coil,
an example is

There are relays with diodes included... I used one one time and forgot about the diode... You can guess the rest, made 300 of those boards and I had to "Eat" them. The relays are made by several outfits including Omron. Yes you can power a relay directly from a processor but it is better not to... for some obvious reasons and some not so obvious... My view is that it isn't a grreat idea and does have some drawbacks but as always IF it works properly and doesn't impact anything else going on then DO IT. Just be aware that some times there are.. Better methods. (engineers make mistakes too, just hundreds of the same one... at a time)

Doc

Docedison:
There are relays with diodes included... I used one one time and forgot about the diode... You can guess the rest, made 300 of those boards and I had to "Eat" them. The relays are made by several outfits including Omron. Yes you can power a relay directly from a processor but it is better not to... for some obvious reasons and some not so obvious... My view is that it isn't a grreat idea and does have some drawbacks but as always IF it works properly and doesn't impact anything else going on then DO IT. Just be aware that some times there are.. Better methods. (engineers make mistakes too, just hundreds of the same one... at a time)

Doc

Yum... the taste of crunchy pointless boards. A taste I know well. I have some that I use as trays for smaller boards in my reflow oven. The other hundred or so of them sat in the cupboard... well... I'll build something out of them - a few blobs of hot glue, some twists of wire... Might even make a garden shed with them :wink:

Docedison:
made 300 of those boards and I had to "Eat" them.

Ouch, that's got to hurt.

I found and bought one of these - http://uk.rs-online.com/web/p/solid-state-relays/5356314/

Works really well, and only draws ~8mA, straight from an arduino pin

CrossRoads:
...an example is
http://www.digikey.com/product-detail/en/TSC-105L3H,000/PB1017-ND/1095338

Better hurry, they're down to their last 32,000 odd 8)

made 300 of those boards and I had to "Eat" them.

My biggest cockup was having to scrap a days production of a set top box because a replacement linear regulator that purchasing "found" oscillated when placed in the circuit.
It was cheaper to scrap 3,000 of them than to have them reworked.

W = V*A
A = V/W
= 5V / 0.2W
= 0.025A
Right?

Well, in Ohm's law, I = V/R.

Arduino digital pins can handle that.

Right?

No.

W = V*A
A = V/W
A = W / V
= .2 / 5
= 0.04A

Arduino digital pins can handle that.

NOT I HOPE a Relay coil Direct?... Really kind of a bad Idea, regardless of the current capability of the pin. From an engineering point of view an Inductor of the size of a relay coil is hard to deal with and I know ALL about ALL the techniques to 'Fix" the back EMF pulse from the relay... but that is only one part away (the diode) from the Arduino, not too wise. the simplest and safest solution is a PNP transistor Emitter to Vcc collector to relay coil and base with 4K7 resistor to control port, pull it low to turn on the relay... place a diode across the relay coil cathode to the collector side of the coil and ground the other end (anode of the diode and the other end of the coil). Doing it that way insures that the transistor is off and an open circuit to Vcc. Much safer as now there are 3 parts to provide isolation. An NPN will work in the regular way But one end of the coil Must be connected to Vcc to operate... and then the Back EMF becomes a Lot more Serious to deal with. From an Engineering Standpoint. IMO

Doc

And yet this board worked just fine with this relay

Connects to a keyboard to allow buttons to be 'pressed' vis computer control.

That wasn't the point, I don't doubt for a minute that it does work and work well, not at all All I said was... "Not real good Engineering" my real point was that you have no "Fault engineering" as I said the only thing that protects anything is the back emf diode on the relay and that a relay coil connected to Vcc directly was more difficult to suppress than the circuit that I described, especially when the other coil lead was connected to the processor. If you are good with it then, GO WITH IT. It Works. all I say here is based on things I have done for many years... like my tag line say's "Based on Many Years of Mistakes", I learned that the easy way is often not the best way, I also learned "That if it Aint Broke Don't Fix It...". My reply wasn't a call for you to rework the project, rather to point out a safer method, usually pursued in the industry so that you might consider other methods in the future. If in any way I offered or appeared to offer criticism Please forgive me that wasn't my intent. For as much as you mighht need advice there are many others who read these posts and my advice was an offering for all, more than any implied disapproval of your work..

Doc