Flyback diodes and why you need them

Any component that relies on an electromagnet or coil of wire for its operation will be inductive, that is the nature of coils of wire. Common examples are relays, solenoid and most types of motor.

It is standard practice to put a 'flyback' diode across any inductive load in order to catch the back emf from the inductor when the current is interrupted. This requirement is usually taken at face value without being backed up by any kind of test results or evidence. This tutorial provides the evidence.

This is the test circuit without a a flyback diode. The 2 test points are where an oscilloscope was attached, the voltage test point (yellow trace) measures the voltage at the top of the inductor. The current test point (blue trace) measures the voltage across the resistor and therefore give an indication of the current through the inductor.

This is what happens when the current through the inductor is interrupted. This oscilloscope trace has the time base at 4ms per division for comparison to the trace in reply #1 with a diode in circuit.

This is when the current is being interrupted but this time the oscilloscope timebase is set to 80μs per division to make it clearer. Note that the voltage (yellow) is off the scale, which means it is well in excess of 200V.

You might ask why the current trace (blue) is also off the scale. First note that the input for the blue trace is set at 200mV per division, not 50V per division, so the blue trace being off the scale does not represent anything like what the yellow trace represents. That said I think it is because of the parasitic inductance in the test circuit allowing a high voltage to develop across the test resistance at the high frequencies that are present.

Note that not only is this circuit producing high voltages, it is also producing a lot of high frequency electrical noise.

Here's a better trace of just the high voltages and electrical noise, note that the voltage peaks are in excess of -300V.

6 Likes

This is the test circuit with a diode across the inductor:

This is the resulting oscilloscope trace:

Note there are no high voltages or electrical noise, just the exponential decay of the current to zero. Also note that the voltage at the voltage test point (yellow) dips below 0V because of the forward voltage drop of the diode.

A note on terminology
When I first created this tutorial I had the word 'flyback' in mind as the correct term for the diode. After I created it I started to wonder if I had used the wrong term, so I did some research. One person on this forum, who I have a great deal of respect for, said 'flyback' was OK. Some searching on the internet revealed that 'flyback' is used elsewhere to mean the diode across an inductor. However, there are other terms used such as 'kickback diode' and 'free-wheeling diode'. It has since been pointed out to me that 'flyback' also refers to the electron beam in a cathode ray tube returning to its start point to scan a new line.

6 Likes

Occasionally I see comments in the forum suggesting that because some MOSFETs have a body diode between source and drain there is no need to put a diode across the inductive load they are driving. This schematic illustrates the situation, with the switch taking the place of the MOSFET and the 1N4004 taking the place of the body diode.

Here is the result of opening the switch, equivalent to turning off the MOSFET quickly.

Note
The trace is not exactly comparable with previous traces as I was not able to find the exact same inductor I used before, I just don't know for sure what I used, other than it was a winding of a mains transformer. However, the voltage spike clearly goes well below -200V.

1 Like

Comments and feedback

I have locked this and separated the comments into a separate topic. Please put your comments in Flyback diodes and why you need them (comments here please)

Introduction:

The topic of flyback diodes came up in another thread (in which I had been trying to find out the specific reasons why the conventional wisdom is to not power a DC motor from Arduino 5V PIN — like this, for example).

@PerryBebbington had pointed to this tutorial, and suggested that oscilloscope measurements may yield some insight into the inductive voltage spikes that are generated when switching off a brushed DC motor.

I was interested in exploring the extent to which inductive voltage spikes originating in a small hobby motor could damage an Arduino microprocessor or a MOSFET used as a switch, so I went ahead and performed some experiments, the results of which are reported here.

Methods & Materials:

The test circuit is shown below (no MOSFETs or Arduinos were harmed in these experiments!).

The motor used was a Dagu DG01D brushed DC motor. The motor datasheet claims a no-load current of 190 mA and a maximum rated current of 250 mA; ammeter measurements showed that the actual no-load current was closer to 80 mA, and the stall current was approximately 800 mA. The terminal resistance was on the order of 5 Ω.

The switch was a momentary push-button switch. The diode (a 1N5819G Schottky) was removed from the circuit for half of the test conditions, as described below. The power source was a 3×AA (Li/FeS2) battery pack.

Testing consisted of running the motor for a few seconds (by closing the push-button switch), and then opening the switch by releasing the push-button. Each test was performed twice, with the diode either removed or present. In the oscilloscope screenshots that follow, Channel 1 is generally the lower trace (annotated with red labels), while Channel 2 is generally the upper trace (annotated with blue labels).

Results for Time Base 100 ms/div:

Nothing too untoward, but a bit unexpected that the pushbutton switch takes almost 700 ms to fully disengage when released. My best guess is that this is due to mechanical bounce, and not arcing (as it is also observed with the flyback diode in place). The feared inductive spikes are nowhere to be seen — but this is an illusion due to aliasing in the digital oscilloscope. We'll zoom in (by a factor of 20,000×) to get a better view...

Results for Time Base 5 µs/div:

Here, we do see the voltage spike across the switch, when it is opened in the absence of a flyback diode. The switch voltage in this trace peaked at around 16V, but the peak height was variable from trial to trial (although generally on the order 15–20V). I was relieved not to see a 300-V spike, as I had feared based on @PerryBebbington's results above. Without the flyback diode, the initial voltage spike lasted about 10 µs, and there appeared to be some damped oscillation at a frequency on the order 60 kHz. As expected, when the flyback diode is introduced, the voltage across the switch is reduced to something on the order of the supply voltage (5V).

What about the effects of motor inductance on the power source? With or without a diode, there is nothing there that resembles the voltage spike that is experienced by the switch. Nonetheless, we do see some kind of fast spike right when the switch is initially opened, and this spike seems to be present both with and without the flyback diode. Let's zoom in further (by a factor of 100×)...

Results for Time Base 50 ns/div:

Now it gets interesting (and confusing!). Those initial fast spikes seen in the previous set of traces were evidently manifestations of transient oscillatory responses, which appear to have major frequency components on the order of 10 MHz and 100 MHz, respectively. The presence or absence of the diode seemed to mostly affect the frequency content of these voltage traces, while the peak height seemed relatively unaffected by the diode when it came to the voltage acting on the power source — and only slightly reduced when it came to the voltage across the switch. Per the 1N5819G datasheet, "rectification efficiency measurements show that operation will be satisfactory up to several megahertz", so >10 MHz is likely a frequency range in which the Schottky diode is ineffective due to its parasitic capacitance (which is on the order of 100 pF).

Overall, the presence of various oscillatory behaviors indicates that capacitative effects in the system are important on short time scales, and that this is the case both with and without the diode. The rotor's angular momentum, when coupled to the circuit (via back-EMF and magnetic torque generation), is expected to act as an effective capacitor. Beyond that, I imagine that some parasitic capacitance (perhaps in the switch or in the leads) is emerging as a dominant component when the switch first opens, as the in-rush of charge from the motor inductor must get stored somewhere.

Discussion and Conclusions:

You decide....