Adding Capacitors to DC motors

I’ve seen many motors having capacitors attached in parallel in bots. Apparently, this is for the “safety” of the motor. As I understand it, all these will do is smoothen any fluctuations–and I doubt that fluctuations can have any adverse effects on a motor. Apparently these protect the motor if the shaft is being slowed/blocked, but I fail to see how.
What exactly is the function of such a capacitor? What does it prevent, and how?

I have order this DC motor to build my own line following robot:

How can I calculate the capacitor value needed for this motor?

Thank you,

Hello, Alex.

Where were you learning this? I think the main reason to add capacitors to a motor is to smooth out the electrical noise it creates. The noise from a motor can be harmful to other parts of your system, and the capacitors can help reduce it. Please see the “Dealing with Motor Noise” section of our Application Note: Using the Motor Driver on the 3pi Robot and Orangutan Robot Controllers. Typically you will want to use 0.1 uF capacitors.


Hi Alex,
I’m brand new here! this is my first post, but I have to agree with David that the caps across the motor have nothing to do with saving the motor, they are there to suppress the electronic noise they they produce, which can produce spikes, etc, that could interfere with micro-controllers and the like, causing funny things to happen…

Suppose I’ll have to go and introduce myself somewhere on this forum??


Pololu has a guide on this :stuck_out_tongue:

To understand the noise, remember as you move the brushes across the motor rotor in a DC motor you are changing contact with an inductor, the brushes make a lot of electrical noise. The capacitor soaks these very low power high voltage impulses (though I don’t fully understand how the brushes make electrical noise…I think it the reverse voltage when you disconnect from an inductor, but it’s clearly not the exact same thing.)

If you are going to PWM the motor, the capacitor will cause the current to be very large at the beginning of the pwm period. This is undesirable. So, if you keep the wires short, I’d say: try it without a capacitor. If you run into trouble, try the capacitor.

But: you are dealing with effects where connection wires are no longer electrical connections. The capacitor needs to be close to the motor, and the wires from the controller to the motor help keep the peak current low enough not to blow up your motor controller.

Advice for a typical value of the capacitor would vary a lot too. My advice would go against that of david and say: start out with 1nF. When you’re ordering components, just get 10pf, 100pf, 1nF, 10nF, 100nF and 1uF. Get at least ten of each, so that you can experiment with different values.

The reason I’d start out with a much lower value is that in theory (if the wires WERE ideal electrical connections) and if the capacitor were ideal, you’ll exceed the maximum current of the motor driver for a short period. Guaranteed. Luckily both the wire and the capacitor won’t be ideal… (which means you have to put the capacitor away from the motor driver, near the motor!)

On the other hand, you can do some mathematical calculations for the capacitor. If you are PWM-ing at 10kHz, you’ll have to charge and discharge the capacitor each cycle. the energy in a capacitor is .5 C.U.U, At 6V that becomes 18C. With a .1 uF capacitor, that would become 1.8uJ. at 20,000 switching moments per second (once on, once off for each period), that comes to 36mW. All this goes into your motor driver. This 36mW is probably not a problem. I was honestly expecting a bit more…

But as you see, it depends on the switching frequency. If you chose 20 or 30kHz, the number goes up.