if zener diode in series with the 1N400x works for faster release, what zener voltage does it have to be? Does it need to be higher than the supply voltage or would lower voltage work. Sorry stupid guestion as I don't really understand how it helps faster release..
Why faster release?
Let's see what happens.
Let relay coil inductance L_coil = 1mH, coil resistance R_coil = 100 ohms, Vcc=10V and diode Vf_diode = 1V, nice round numbers.
When transistor is ON, current is limited by R_coil; I_coil = 10V/100ohms = 0.1A.
When transistor is suddenly switched off, the coil tries to keep the same 0.1A flowing. The voltage over the coil reverses and increases until the diode starts conducting. This is why you need quick turn-on time ("forward recovery")! OK, diode conducts now, and you have 1V over the diode. Now the equivalent circuit is the inductance supplying 0.1A to the diode. Diode dissipates 1V*0.1A = 100mW. Coil dissipates (0.1A)^2*100ohms = 1W; just like before turn-off. Most importantly, by having 0.1A still running through the coil, it provides exactly the same mechanical force as before turn-off!
But the energy stored in inductance is not infinite; it's 1/2*L*I^2. So current will ramp down as energy is consumed by the coil, and by the diode. But mostly by the coil. Diode only drops a little bit of voltage; most energy is consumed by the relay coil itself. If this was a motor controller, it would be
good; not much energy wasted, motor would use the stored energy to do the
motor thing, creating torque.
In the relay coil, current will decay by rate of dI/dt = V / L = 1V / 1mH = 1000 A/s = 1A/ms. From 0.1A to zero in 100µs! At 0.1A, the relay is holding with full strength, not a problem for contacts, just a delay. But think about what happens when the current reaches, say, 0.05A. Holding strength is halved, and you still have 50µs to go. Maybe at 0.03A, the returning spring has equal force to the electromagnet, contacts barely touch, and you have still 30µs to go. At 0.02A, contacts are separated, but the electromagnet still pulls enough against the spring so that the gap is only fractions of millimeters, sustaining an arc.
But what if we had a diode with Vf=10V? Initially, current is still 0.1A. But now the relay coil will generate a voltage of 10V, instead of just 1V. Dissipation in the diode will be 10V*0.1A=1W, instead of 0.1W. Current will decay at 10V / 1mH = 10000 A/s. From 0.1A to zero in 10µs!
Theoretically, inductance is capable of creating infinite voltage to make the current flow. So we provide a circuit which always has a path for current to flow; diode conveniently switches on automatically when it detects voltage exceeding Vf. If we make that path ideal (Vf=0), with zero voltage drop (short circuit), then the inductive load (relay coil in this case) uses its own stored energy fully, to do whatever it's normally doing. But we can choose to increase voltage loss in this path, forcing the inductance to create higher voltage. Just enough to make the relay open faster, by consuming the stored energy externally, but not too much to damage the transistor by overvoltage, the very reason we added this diode to begin with.
A simple way to increase the Vf of the diode is to add a zener/TVS in series. The exact value is not important; something around the rated relay voltage makes it quick enough. Even just a few volts of extra drop already makes a 12V relay turn off more quickly. And of course, the largest voltage the transistor sees is the maximum zener clamp voltage plus diode Vf, so don't use excessively large clamp voltage; you don't want a large voltage spike generator, after all.
If you use a bidirectional TVS, the one-component solution I suggest for simplicity, then the breakdown voltage has to be higher than Vcc so that it does not conduct all the time. Something just above the Vcc works well.
Finally, if you find struggling with the concepts of inductors and energy storage, just force yourself to think with the capacitor analogy:
* Capacitor stored energy is by voltage squared; with inductors, stored energy is current squared.
* Capacitors keep their stored energy when open-circuit; inductors when shorted.
* Ideal capacitor creates whatever current is required (up to +/- infinite) to keep their voltage
* Ideal inductor creates whatever voltage is required (up to +/- infinite) to keep their current
* For the same reason you don't want to short-circuit a capacitor (big current ensues), you don't want to open-circuit an inductor (big voltage ensues).