# Switching 12 Volt Relay with 5 volt Arduino Output

I want to use use an Arduino that is powered by 12 V to switch this relay:

The Arduino pins only give 5 V, so I want to try to design something that will give 12 volts to the relay coil when the Arduino output is at +5 out and then drop to zero volts when Arduino gives out 0. What I had in mind is here (where I am only modeling the relay portion with the coil (not sure what the actual inductance is either)

simulate this circuit – Schematic created using CircuitLab

Will this work?

• Where does 6V come in here? – Samuel Feb 23 '16 at 21:00
• I need 6V across the coil – yankeefan11 Feb 23 '16 at 21:04
• Have you tried powering the coil from the Arduino's 5V rail (not the GPIO, so keep Q1/etc) to see if the coil still works? – Techydude Feb 23 '16 at 21:04
• "Coil voltage: 12VDC", as usual with Automotive relays. Where did you even see 6V? – Asmyldof Feb 23 '16 at 21:18
• The relay is specified to perform as advertised in every way when you put 12 volts across the coil, and that's how you should run it. With only 5.6 volts across the coil it'll be limping along and shock, vibration, ambient temperature rise and the phase of the moon can cause it to malfunction. – EM Fields Feb 23 '16 at 21:34

Note: The question was changed out from under this answer from wanting to drive a 6 V relay with a 12 V power supply, to discovering it was a 12 V relay all along. I'll leave this here since it's a good answer to the original question, which might be useful to others.

The simplest way requires no additional parts than what you would have to use anyway, just arranged differently:

This actually controlls the current thru the relay instead of the voltage across it. However, the DC resistance of relays is well controlled, so they can just as well be driven with a specific current. The relay current will be close to 4.3V / R1, which is 43 mA in this example. Look at the relay spec, find the full on current, or get it by dividing the normal coil voltage by its DC resistance. Take 4.3 V and divide it by that current to get the R1 resistance.

Note that while this method is simple, it's not very efficient. Twice the relay power will be used.

A even electrically simpler but more complicated firmware method is:

This has the advantage of being quite efficient. It will draw half the current from the 12 V supply when the relay is on as the previous circuit. The PWM should be fast enough so that the current thru the relay changes little during a half-pulse time. I'd try to run the PWM at a bit above the audio range, like 25 kHz. You don't need much PWM resolution since you want a fixed 50% duty cycle.

Of course another option is to get a 12 V relay. That is one of the common relay coil voltages. Whatever relay you have probably comes in a 12 V coil variant.

Simplest way is to use a resistor in series with the relay coil and equal to the coil's resistance.

Its power rating should be greater (twice isn't a bad number) than 6 volts times the relay coil current, and the catch diode should go from Q1 collector to +12 volts.

UPDATE:

Considering the edits to your question, it seems like that'll work, so let's find out. :)

The relay coil takes about 53 mA with 12 volts across it, so forcing a beta of around 10 (accepted engineering practice to ensure saturation) from Q1 would require its base current to be around 5 milliamperes.

If you figure a $V_{BE} (sat)$ of around 1 volt, then to get 5mA into the base R1 would have to drop 4 volts at 5 milliamperes.

Then, since $R = \frac{E}{I}$,

$$R1 = \frac{4V}{0.005A} = 800\text { ohms}$$

Your 1000 ohms would force 4 milliamperes into the base, so with a load of 50 milliamperes on the collector, R1 would have a current gain ($\beta$) of:

$$\beta = \frac{Ic}{Ib} = \frac{50mA}{4mA} = 12.5$$

Since most jellybean NPNs sport a natural beta far greater than that, at that collector current, almost any transistor you choose for Q1 will work.

And, since the Arduino should have no problem sourcing 5mA at 5 volts out, the circuit should work, no problem.