Reduce voltage spike on relay coil

crutschow

Joined Mar 14, 2008
29,519
Add a small diode (e.g. 1N4148) across the relay coil (diode cathode to plus).
That will suppress any inductive spikes that could otherwise zap the Arduino output driver transistors.
 

DickCappels

Joined Aug 21, 2008
8,686
Same advice, different detail
1642127541211.png
50 ma is probably enough to cause SCR latchup, which, with good enough power supply, will kill the chip. According to the ATMEG328 datasheet I have before me (Atmel-8271J-AVR-ATmega-Datasheet_11/20/15) the maximum current on the I/O pin is 40 ma. Please check the specifications for the chip on your Arduino boar to make sure you are not exceeding the maximum I/O current.

Because the 1N4148 is so small, with 50 ma from the relay it can drive the output pin beyond 0.8V and that would be likely to case some of that 50 ma to flow through the output pin.
1642127898939.png Above: 1N4148 I/V curve

Because the 1N4148 is so small, with 50 ma from the relay it can drive the output pin beyond 0.8V and that would probably result in some of coil current passing through the protection diodes on the I/O pin. That might kill you Arduino board.

1642128699935.png
Above: 1N5817 V/I curve.

Using a Schottky diode such as 1N5877 through 1N5819 with a higher current rating would keep the voltage on the pin low enough to make sure that the protection diodes don't conduct much if at all. Notice that 50 ma only 0.2 volts is developed.
1642128976829.png 1642128953205.png

If it turns out that your relay draws more than the output pin is capable of reliably driving, you can use a MOSFET or bipolar transistor as a relay driver. In that case 1N4148 would be fine.
 

LowQCab

Joined Nov 6, 2012
1,931
If You add a ~10uf Capacitor from the MOSFET-Gate to Ground, ( in the above Circuit ),
You won't need to worry about Diodes and Voltage-Spikes.
The Capacitor will slow-down the FET so that the Magnetic-Field in the Coil
can collapse smoothly, without creating a Spike.
It's also easier on your Power-Supply-Regulator.
.
.
.
 

crutschow

Joined Mar 14, 2008
29,519
If You add a ~10uf Capacitor from the MOSFET-Gate to Ground, ( in the above Circuit ),
You won't need to worry about Diodes and Voltage-Spikes.
I still do. ;)
As shown by the simulation below, the capacitor to ground may not sufficiently reduce the inductive spikes (yellow trace) below the worry point.
This is due to the high gain of the MOSFET giving a relatively fast turn-off, even with a slow gate fall-time.

Note that if you low-side drive the relay as shown, then you don't have to worry about the negative voltage from the diode suppression across the coil.
The small diode drop just adds to the supply voltage the low-side switch sees when it turns off (blue trace).
And a diode may be cheaper than a capacitor.

1642173103800.png
 

sagor

Joined Mar 10, 2019
677
I have a small PCB mounted relay that I want to control with an Arduino. The coil spec is 5V, 125 ohms, 40mA. That's the max current an Arduino output can handle. Should I put a something across the coil to reduce voltage spikes? Snubber, fly back diode, etc? If so, what?

The relay I'm using is V23105A5301A201
https://www.digikey.com/en/products...otter-brumfield-relays/V23105A5301A201/291022

Thanks,
Scott
Absolute maximum for an Arduino pin is 40mA, and you should never use that maximum on a steady basis. In other words, you should not be driving a 40mA relay directly from an Arduino pin. The relay may actually draw a bit more, like 41mA, as there are tolerances to all ratings.
Use a buffer/driver between the Arduino and the relay, such as a transistor or MOSFET.
 

Thread Starter

Scott216

Joined Jun 16, 2011
27
Absolute maximum for an Arduino pin is 40mA, and you should never use that maximum on a steady basis. In other words, you should not be driving a 40mA relay directly from an Arduino pin. The relay may actually draw a bit more, like 41mA, as there are tolerances to all ratings.
Use a buffer/driver between the Arduino and the relay, such as a transistor or MOSFET.
Thanks. The coil activates at 3.5 volts, I was considering adding a resistor in series so the coil would get 4 volts and the resistor 1 volt. This would reduce the current a bit. But I decided to just go with a MOSFET since I have some laying around and it's easy to do. I'll put a diode across the coil and I should be good. I appreciate everyone's help.
 

LowQCab

Joined Nov 6, 2012
1,931
The Capacitor didn't work as expected because of the very low impedance drive, (1K),
replace the 1K with a 10K, and replace the 10K with a 100K.
And, where did the "100mh" number come from ?, that's some serious Inductance for a 5V Coil.
 

MisterBill2

Joined Jan 23, 2018
11,621
I was going to comment that it did not seem that the cap had slowed the transition at all. And it had to be the zero source resistance in series with the 1K resistor. Another way to reduce the spike is to put a pilot size light bulb across the relay coil. That will absorb the energy and also provide a useful indication of relay off or on.
 

eetech00

Joined Jun 8, 2013
3,110
I was going to comment that it did not seem that the cap had slowed the transition at all. And it had to be the zero source resistance in series with the 1K resistor. Another way to reduce the spike is to put a pilot size light bulb across the relay coil. That will absorb the energy and also provide a useful indication of relay off or on.
Yes...a thing to watch out for is the "perfect" voltage source used in the simulation on post #7. The voltage source is completely pulled to 0v (zero volts) when off, pulling the mosfet gate resistor to 0v.
 

MisterBill2

Joined Jan 23, 2018
11,621
So try changing R1 to a 47K ohm resistor. If the change is not apparent, then put a diode in series with the resistor to charge the capacitor.The diode will disconnect the perfect voltage source when it's output is zero.00.
 

crutschow

Joined Mar 14, 2008
29,519
The Capacitor didn't work as expected because of the very low impedance drive, (1K),
replace the 1K with a 10K, and replace the 10K with a 100K.
I fail to see any good reason to use the capacitor and resistors instead of a diode across the coil, for spike suppression.
where did the "100mh" number come from ?, that's some serious Inductance for a 5V Coil.
From an Omron 2A relay data sheet:
1642283456405.png

100mH is the median between the OFF and ON values.
I guess that small relays have "serious" inductance. :rolleyes:
 

MisterBill2

Joined Jan 23, 2018
11,621
The concept is to reduce the rate of change of current because that will greatly reduce the voltage generated. It is a valid approach and a quite interesting experiment. Extending the dropout time to 2 milliseconds should make a big difference.
 

LowQCab

Joined Nov 6, 2012
1,931
The "TE Connectivity, Potter & Brumfield Relay" p/n V23105A5301A201, Data-Sheet,
proposed by the thread-Starter for his project,
does not provide Inductance-Specifications.

3- competing major manufacturers of similar Relays
also do not include Inductance-Specs in their Data-Sheets.

Extend the time constant to 10ms,
then add a 1K Resistor across the Coil,
and there's virtually zero Spike.

Better yet, don't use a Relay at all.

There's more than one way to skin a Cat.
.
.
.
 

crutschow

Joined Mar 14, 2008
29,519
3- competing major manufacturers of similar Relays
also do not include Inductance-Specs in their Data-Sheets.
I've noticed that.
But I would think that relays of similar contact current and coil voltage rating would likely have similar coil inductance.
There's more than one way to skin a Cat.
Yes.
But I would think we are looking for the best way, not just any way.
 

LowQCab

Joined Nov 6, 2012
1,931
Using a Relay and a Diode may well be expedient,
but it is arguably not the "best" way to accomplish the desired end result
if a Solid-State solution is .....
readily available, cheaper, uses less board-space, less power, and never wears-out.

We still don't have any idea of what the whole project is supposed to accomplish as an end-result.
.
.
.
 
Top