the spec says its a 5volt coil with 178 ohm resistance, so some basic ohms law manipulation says it draws 28 mA when active.
The spec for the arduino pro-mini says it can sink or source 40mA.
I think this means I can connect the relay coil directly to the arduino without the normal need for a driving circuit (i.e. transistor) to provide the extra current required.
You can if you want to damage the output due to reverse voltage spike when the relay is turned off.
This can be reduced with a reverse connected diode.
I second that (using a driver) ... here's another reason:
The spec for the arduino pro-mini says it can sink or source 40mA.
My interpretation of the pin current specifications is this:
Maximum continuous pin current: 20mA
For continuous pin currents >20mA to 40mA (within stress rating range), device reliability decreases
Pin current >40mA: permanent damageAlso need to observe absolute maximum ratings for "DC current VCC and GND pins" 200.0 mA. Here, I wouldn't exceed continuous 100mA for the same reasons. What to do depends on how reliable you want your project or product.
Datasheet References:
28.1 Absolute Maximum Ratings Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. DC current per I/O pin: 40.0 mA
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: ATmega328P: 1] The sum of all IOL, for ports C0 - C5, should not exceed 100mA. 2] The sum of all IOL, for ports B0 - B5, D5 - D7, XTAL1, XTAL2 should not exceed 100mA. 3] The sum of all IOL, for ports D0 - D4, 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.
The spec for the arduino pro-mini says it can sink or source 40mA.
I think this means I can connect the relay coil directly to the arduino without the normal need for a driving circuit (i.e. transistor) to provide the extra current required.
Am I right?
Thanks
No, that will probably destroy part or all of the chip first time you power the pin off.
Inductive loads kick back hard, you always have to consider protection circuitry to prevent that
causing damage. Normally you would drive a relay with an external transistor and a free-wheel
diode across the relay coil to protect the transistor from large spikes.
With bare Arduino pin you could drive a coil directly if the current is low enough, but you would need
a schottky diode (must be schottky) as free-wheel diode to prevent the inductive
spike reaching 0.5V (which is the limit of the on-chip static-protection diodes).
In fact I've powered a ultra-miniature stepper motor direct from an Arduino this way, using two
pins per motor pin to double up current handling. But electromagnetic devices with that low a
current are few and far between really.
If it was me, I'd go ahead and do it since you're below the absolute maximum (with the diode, of course)... Especially if the chip isn't getting otherwise stressed.
If I was making a PC board I might throw-on the "extra" transistor (or driver chip), but otherwise I'd do whatever is easier and more convenient.