Volt spike and flyback diode

Thread Starter

MikeA

Joined Jan 20, 2013
316
I have a simple PWM circuit with a NPN transistor driving a DC fan. Exactly like in the attached schematic. The issue is I'm getting serious voltage spikes on the 5v.

This is by design, right? The flyback diode sends the current back to the 5v source?

The problem is I have other things in the circuit that get their power from the same 5v, and are not liking the voltage spike. :( Any ideas how to fix this? :D
 

Attachments

MaxHeadRoom

Joined Jul 18, 2013
26,305
Place an appropriate sized ferrite choke in series with the motor.
Also a .5μf capacitor from 5v at the motor to common.
Max.
 

Thread Starter

MikeA

Joined Jan 20, 2013
316
I think I have a few in the parts bin, small ones though. By suitable you mean it has to exceed the minimum inductance and current rating of the fan? How would I calculate the needed inductance?
 

MaxHeadRoom

Joined Jul 18, 2013
26,305
The problem is without knowing the exact nature or frequency of the offending spikes, it is a question of trial and error, I usually use a suitably sized enameled wire on a 1.5" dia toroid for a start, but I usually deal with larger motors.
Max.
 

ian field

Joined Oct 27, 2012
6,536
I have a simple PWM circuit with a NPN transistor driving a DC fan. Exactly like in the attached schematic. The issue is I'm getting serious voltage spikes on the 5v.

This is by design, right? The flyback diode sends the current back to the 5v source?

The problem is I have other things in the circuit that get their power from the same 5v, and are not liking the voltage spike. :( Any ideas how to fix this? :D
You could feed the motor via a diode to stop the spikes getting back to the main Vcc, a hefty electrolytic for the motor only part of the Vcc should soak up the worst of it. A Shottky-barrier diode has much smaller Vf drop than regular silicon, but you have to watch the PIV - SB diodes start at araund 20V, the spikes could easily be more than that.

As others have suggested; a choke might help, but its not that simple - a choke is inductance that could produce spikes all by itself, you'd probably be looking at something like a "Pi" type filter with a couple of capacitors as the "uprights".
 

MikeML

Joined Oct 2, 2009
5,444
I have a simple PWM circuit with a NPN transistor driving a DC fan. Exactly like in the attached schematic. The issue is I'm getting serious voltage spikes on the 5v.

This is by design, right? The flyback diode sends the current back to the 5v source?
...
No it does not. The fault lies elsewhere, possibly a ground loop.

Look at this sim. which shows what happens when 2A flowing in an inductor is abruptly turned off. At the instant the NPN turns off (100ms), I(R1), the current that was formerly flowing in R1 just goes to zero. There is no current flowing backwards toward the power supply V1.

V(b), the voltage at node B jumps up just a bit which happens because the former IR drop across R1 ceases. The voltage at node B never goes above 5V.

Note how the diode steers the current back into the coil. V(c), the voltage at the bottom of the inductor is clamped one diode drop above 5V, but there is no corresponding current in R1.
 

Attachments

Last edited:

crutschow

Joined Mar 14, 2008
31,139
It may be the stray inductance of the 5V line. The rapid turn-off of the current causes an inductive spike from that inductance that is not suppressed by the diode across the fan (or by any diode placed in series). You might try running the cathode of the diode back to the 5V source rather then just across the fan motor. That way the current in the line stops less abruptly, minimizing the spike.
 

wpri268

Joined Feb 18, 2012
30
As is with any switched inductor whether it be a motor, flyback transformer or straight piece of wire it is the leakage inductance creating the spike. V= L di/dt. However there is probably no chance of reducing the leakage L of a small motor. RC snubbers are often used in SMPS to accomplish this task. Though I cant offer any information about their design there is lots to be learned online. Oh, as an afterthought....if you could increase your swithching time the problem wont be as bad.
 

t_n_k

Joined Mar 6, 2009
5,455
No it does not. The fault lies elsewhere, possibly a ground loop.

Look at this sim. which shows what happens when 2A flowing in an inductor is abruptly turned off. At the instant the switch opens (10ms), I(R1), the current that was formerly flowing in R1 just stops. V(b), the voltage at node B jumps up just a bit which happens because the former IR drop across R1 ceases. The voltage at node B never goes above 5V.

Note how the diode steers the current back into the coil. V(c), the voltage at the bottom of the inductor is clamped one diode drop above 5V, but there is no corresponding current in R1.
Are you sure you attached the right sim?
 
Top