# Where to add Flyback diode?

I have made a relay controller module which switches a automotive relay when a ULN2003A sinks current on the separate main board. The module is in an always active state, but the requirements have changed for its functionality, it now has to handle with multiple switching cycles instead of a once off cycle. The only constraint is that it has to have three wires only: signal, GND and relay.

The circuit is this below:

simulate this circuit – Schematic created using CircuitLab

Vbatt = 12-13V from car battery

I know there are a few questions on EE.SE on the methods of flyback diodes, but I can't decide which method I should be using, I thought of using a zener, but I am unsure of that method. There is also a current reducing circuit after the NPN transistor, consisting of a resistor and capacitor in parallel Also the two answers below seem to contradict to a point.

I thus need assistance in the method in which to provide protection to the module, components within the dashed line.

• Where is the ULN2003A in this circuit? Commented Mar 30, 2015 at 13:50
• @SpehroPefhany - the driver is not on this board, this is an extension module which is connected separately from the main board. Should I edit that in ;)
– RSM
Commented Mar 30, 2015 at 13:59

Normally a diode would go directly across the relay. Since one of those points is not availale to you, you have to find another way to limit the voltage across Q1 to safe levels. There are two common solutions for this:

1. A snubber. This is a resistor and capacitor in series between the collector of Q1 and ground. When Q1 turns off, the instantaneous relay current won't change. This will then all flow thru the resistor and capacitor. The resistor needs to be sized so that this current times the resistance, plus the power supply voltage don't exceed the transistor's voltage capability. The current thru the resistor builds up reverse voltage, which will cause the relay current to decrease over time. At the same time, the integral of that current causes voltage to build up on the capacitor. You have to make sure the capacitor is large enough so that the voltage that builds up plus the power supply voltage don't exceed the transistor's voltage capability.

2. A zener or transorb. This is some kind of voltage limiter between the collector of Q1 and ground. It only conducts when the collector voltage goes some margin above the supply voltage. This means it does nothing in normal operation, but conducts to give the relay coil current a path so that it doesn't cause a high enough voltage to damage the transistor. The maximum current this must be able to handle is the same as the relay steady state current. It is legitimate to partially rely on the peak current rating instead of the steady current rating of the voltage suppressor since it only carries this current for a short time each time the relay is turned off.

On a separate topic, do you really need the additional transistor? From the values of R3 and R1, it doesn't look like Q1 is being fed much base current. If so, it would be better to just have the digital signal drive Q1 directly. That inverts it from what you show, but since the signal is being produced by a microcontroller, you can just invert the digital signal in the firmware.

This circuit would be simpler and drop less voltage in series with the relay if Q1 were driven directly. All you need then is Q1 and a single base resistor.

If you really need more current drive, then use a second transistor powered from the same supply the micro is powered from instead of trying to take the power from the switched side of the relay.

• Hi, I should edit my question, its actually coming from a ULN2003A, and this is an add-on to a separate product, so I don't have control over their firmware.
– RSM
Commented Mar 30, 2015 at 12:44

There is perhaps no need for a flyback diode at all if the ULN2003A output is clamped to a reasonable voltage through the COM line (as it would normally be).

When the output voltage exceeds the supply as the magnetic field is collapsing, the current will flow through R2, R4 and the clamp diode in the ULN2003A causing Q1/Q2 to turn off slowly enough that Q1 absorbs the energy in the relay coil. If Q1 is beefy enough, this will work, but if it is not then Q1 could be destroyed. Check the safe operating area to ensure there is plenty of margin. You'll need to know a bit about the relay you're switching and how fast the current decays, which you can easily determine with an oscilloscope.

Adding a zener or TVS will not help with this most likely as the voltage will have to be higher than the supply and tolerances will be such that the above action will take place anyway, but adding it won't hurt anything that wouldn't be hurt anyway (except perhaps parts cost). If for some reason the COM was not connected on the ULN2003A it could save the components. You could also use a cheap few-hundred-mW zener from the base of Q2 to ground.

This seems unnecessarily complex. If you use a PNP power transistor (perhaps with a small base resistor) you can do the whole thing with no other parts (except possibly a zener as above). Voltage drop will be better than your circuit but still more than the ULN2003A by another diode drop.

• Hi, the module I have put together is meant to be independent of the main board tough if it is disconnected from the module, so the extra circuit is needed.
– RSM
Commented Mar 30, 2015 at 16:39
• Then I suggest a robust PNP transistor with a small base resistor, plus 500mW zener to ground on the base. Values depend on your requirements. Commented Mar 30, 2015 at 16:53
• you think I should drop the NPN then?
– RSM
Commented Mar 30, 2015 at 17:00
• I don't think it's helping much and it introduces more drop. Commented Mar 30, 2015 at 17:44
• Okay,its quite confusing because I have the circuit running, and has been pretty stable as it still has a current limiter for the relay after the NPN, a Cap and Resistor parallel as its for automotive applications, reduce power usage.
– RSM
Commented Mar 30, 2015 at 17:53