Info wanted: Relay suggestion to control 12v line from the arduino's 5v pins.

Looking for a handful of relays to control a 12v, 20watt line from the Arduino but i'm not sure which to use. (I know mosfets can do this but I want something I understand a tad more and can troubleshoot myself without begging for more help, heh)

Through-hole would be best for simplicity, but I won't turn my nose up at SMD.


What device is on the 12V 20W line?

In general you will need more than just a relay as the Arduino's output isn't really powerful enough to drive a relay reliably.

You will need a transistor (NPN is best), a resistor and a diode.

The relay is connected with the diode reverse connected across the coil (this is to absorb negative EMF spikes from the coil - without it you WILL fry the Arduino). The relay/diode combination is connected between the +5V supply and the collector of the NPN transistor. The emitter of the transistor is connected to ground. The output from the Arduino is connected to the base of the transistor through a resistor - typically no more than 10K?.

The Arduino turns on the transistor, and the transistor turns on the relay.

Hrrm, your answer is far more complex than I expected.

A friend gave me this relay (Large external type) that directly controlled the 12v line from a 5v switch side. It's crazy overkill, but it works, and I know which end is up :D

I was presuming that this same thing could be done in a smaller part.


Plugging that direct into your Arduino is liable to kill the Arduino.

Two reasons:

  1. The Arduino's IO pins can only supply a small amount of current (40mA). Relay coils take a large (comparatively) amount of current (hundreds of mA)

  2. As relays (and any inductive loads) switch on and off (or just generally operate) they generate voltage. This is because they are basically coils of wire and magnets. As coils and magnets (or plates with magnetism induced by the coil) move electricity is generated. This voltage can be considerably larger than the Arduino can cope with and will likely blow up the chip. If the relay doesn't have a built-in diode you will need to add one.

I seriously suggest you switch it through a transistor. It's hardly complicated - it's only 3 components, with a total cost of a few cents - far less than buying a new Arduino.

Our friend, lasivian, has a solid-state relay with a DC output. Anyway, it CAN be controlled by an Arduino output (directly) -- Input (Control) Specifications: Input Control Voltage Range: 4-10 VDC Output Voltage Rating: 50 VDC Input Current at 5VDC: 10 mADC Typical, 15 mADC Maximum Must Turn-On Voltage: 4 VDC Must Turn-Off Voltage: 4 VDC Maximum Isolation (Input to Output, Input to Case, Output to Case): 109 Ohms Dielectric Strength (Input to Output, Input to Case, Output to Case): 1500 VAC(RMS) 60 Hz Capacitance (Input to Output): 15 pF

Output (Load) Specifications: Load Voltage Range: 3 VDC Minimum, 50 VDC Maximum Output Current Rating (Resistive): 20 Amps Maximum Turn-On Time Delay (Td(on)) 10V­­­in­­/50V­­load­­­, R­L = 12 ?: 40 ?sec Typical, 200 ?sec Maximum Rise Time (Tr) 10V­­­in­­/50V­­load­­­, R­L = 12 ?: 1 ?sec Typical, 15 ?sec Maximum Turn-Off Time Delay (Td(off) 10V­­­in­­/50V­­load­­­, R­L = 12 ?: 10 ?sec Typical, 50 ?sec Maximum Fall Time (Tf) 10V­­­in­­/50V­­load­­­, R­L = 12 ?: 25 ?sec Typical, 100 ?sec Maximum Output Leakage Current (at 50V, 25 C): 5 mADC Power Switch Junction Temperature (T­J Max.): 150ºC Thermal Resistance Junction to Heat Sink (?­JS) (Includes ?­CS): 1.5ºC/Watt Thermal Resistance Junction to Ambient (?­JA): 6.5ºC/Watt

Yeah, that's what I'm trying to find in miniature :)

Here's a mfr. link to lower power SSRs (DC) with a much smaller footprint --

Our friend, lasivian, has a solid-state relay

Ah, sorry, didn't realise it was an SSR. You can forget pretty much everything I have said then :P