I am planning to interface an Arduino Uno with a garage door opener. The wall switch for the opener operates on low voltage DC, and to open / close the garage door you briefly interrupt a 12VDC signal. I have purchased a relay for this:
It looks like the digital pins on the 328 can supply up to 40ma , and if I'm reading the specs correctly, the relay only draws 10ma. Most of the schematics I see interfacing relays to Arduinos require a transistor as well as some diodes, but for something this small can I just leave off the transistor?
Yes, you do.
The mentioned current is the current that is needed to keep the relay on.
The relay needs a much higher current to actually switch on.
Even though that rush-in current will only last for a short time, you need to take that in account.
So to stay on the safe side, use a small transistor, and DO NOT FORGET to use a diode to get rid of the back-EMF you'll get from a relay switching off.
The mentioned current is the current that is needed to keep the relay on.
The relay needs a much higher current to actually switch on.
Nonsense!
Please explain how a relay with 500 ohms coil resistance can draw a higher current than 10mA. (I=E/R)
You do NOT need a transistor to switch 10mA with an Arduino. You DO however need the flyback diode, even a 1N4148 or 1N914 will suffice. Connect the anode to GND and the cathode to your output.
For future consideration, many manufacturers offer the diode already built into the relay which is neater. The one you purchased does not.
I more or less just ended up following this schematic:
Certainly nothing wrong with the schematic, and had you selected a relay with a higher powered coil, you would certainly need it. You just don't need it with this relay. The relay you chose is great for switching logic level signals. Though you have 24V to switch, it's doubtful you will have more than 50mA.
Obviously if you were trying to switch a motor directly, you would need a relay with at least 10A contacts which in turn takes more current in the coil to drive the heavier contacts.