I bought a cheap largish USB fan and plugged it in to the 5V rail on my adapted ATX bench power supply. Immediately, the ATMega328P that is present on the adapted ATX supply started to act erratically. The '328 is there to measure voltages and currents and to drive 7-segment displays and it is powered out of the same 5V rail. (picture and schematics are at the end of the post).

I checked the 5V rail with the oscilloscope (screenshot below) and, to my surprise, the fan was causing the rail voltage to spike up to 6.3V at 160Hz. That's way past the poor '328 absolute maximum 5.5V supply voltage.

Scope screenshot - 5V rail voltage spikes

I know what is causing me problems, but I don't know why or how to fix it. But I thought I should learn something from this. My questions then are:

1. What is likely the cause of those spikes?

My guess is that the problem comes from the inductance of the motor coils. When the commutators loose contact with the brushes, the current through the coils is suddenly interrupted, and according to the inductance formulae \$V = L \dfrac{di}{dt}\$, there's an increase in voltage to counter it. I hazard a guess that the frequency I measured (160Hz) is double the fan RPM (I'm guessing 4,800RPM).

Am I in the right direction? The only thing that doesn't add up is that I think the spike should be negative (same signal as \$ di \$), not positive.

2. Based only on my oscilloscope readings, can I consider that the fan design is flawed? If so, what circuitry is likely missing on the fan, that would otherwise prevent those voltage spikes from happening?

My guess is that the voltage spike is something that all brushed DC motors produce by design, but additional circuitry (possibly filters) are put in place to suppress its effects. But I don't know what these filters would be.

3. How can I improve the design of my adapted ATX bench power supply to protect it from such voltage surges?

Is this a case in which a flyback diode should be applied?

The fan is 1.5W (2.5W start up power). I have two other smallish USB fans (1W) that do not produce any spikes like that.

ATX power supply adapter schematics:

ATX power supply adapter schematics

My adapter plugged to the ATX power supply in the background (they are actually two separate units), and the fans.

Picture of the whole setup

  • 2
    \$\begingroup\$ Possibly the effect of power supply pumping. .. You may try connect the fan to the 5V thru a diode and some larger (2200uF) capacitor. The cap will capture the pumped voltage and the diode will prevent it from flowing backward into yr PSU. \$\endgroup\$ Mar 8, 2016 at 1:19

1 Answer 1


That looks like a nice resonant ring as opposed to noise. Try putting a small LC filter on the fan supply, that should stop any noise from feeding back to the supply. Also on the ATmega, you could apply an LC or small RC filter to again reduce noise entering the system. The scope looks like it is ~500kHz, so something like a 10kHz low pass filter would work well. A sensitive device like an ATmega really should have a dedicated voltage regulator instead of running right off of an ATX supply. Consider bringing 12V into a 5V linear regulator for the ATmega, this will remove any unwanted noise.

Here is a filter equation. You can replace L with R.

$$ f_c = \dfrac{1}{2 \pi \sqrt{LC}} $$

  • \$\begingroup\$ Excellent ideas, thanks for your answer!! With the 5V rail so easily available from the ATX supply, it never occurred to me that I could as well throw in a linear regulator to bring clean supply from the 12V rail. Given that the ATmega current demand is so low (~50mA), I won't even need to worry about heat dissipation, especially if I can power the 7-segments display from the 12V rail. I'll study the filters as well. That's good advice, thanks! \$\endgroup\$
    – Ricardo
    Mar 8, 2016 at 12:42
  • 1
    \$\begingroup\$ My only item of note with this method would be to have a smaller L and Larger C to help reduce any resonant ringing of the filter. Also Yes, your thermal dissipation would be ~0.35W, a T220 package should be able to support this even without a heat-sink. \$\endgroup\$
    – MadHatter
    Mar 8, 2016 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.