Electronic – arduino – Do I need to use a capacitor to smooth voltage when powering a microcontroller with USB

arduinodecoupling-capacitormicrocontrollerpower supplyusb

I'm trying to make a CNC machine with an Arduino Uno and 3 stepper motors. I plan on powering the Arduino with USB, but I need a 5v power supply for the 3 stepper motor microcontrollers. I couldn't find a 5v wall adaptor at any nearby store, and was hoping a USB could suffice as I don't want to wait for shipping.

Researching online it seems that there may be voltage spikes that could possibly damage the microcontrollers when powered via usb. Is this something I need to worry about? Do I really need to use a capacitor? This is my first electrical engineering project, so I apologize if this is common knowledge.

Hopefully this diagram clarifies how I'm assembling this machine:

The power would be coming from the far right (red is power, black is ground).

The specific drivers I am using are the easy stepper motor drivers, and the specs can be found here:
https://learn.sparkfun.com/tutorials/easy-driver-hook-up-guide

But it is indicated that it works in a 5v system.

Best Answer

EDIT 2:

What you are asking makes no sense. The Easy Driver already has its own 5V source which is regulated down from the voltage you provide to drive the stepper, which MUST be between 6V and 30V, and at least 2A, according to the Easy Driver page. I would recommend 20-24V: with current limited drivers, the higher the voltage, the better. However, this also renders your board vulnerable to LC voltage spikes which, if they go over the maximum 30V, can instantly destroy your board. While it has a 47uF decoupling cap across Vin and GND, I would recommend that you supplement this with an electrolytic of 100uF or more.

When the product page says it works on 3.3V or 5V, it means the logic signals from your Arduino, NOT the motors supply voltage.

All this below is useless, as the board does not have a 5V logic input, but kept for historical reasons.

My guess is you're using A4988 drivers from Pololu.

If, as I assume, you are ONLY powering the stepper motor driver logic power supplies, then you can run it off of the 5V USB line.

You are correct, though, that there are noise problems with USB's. While I doubt that the spikes are enough to harm the drivers (they don't harm other 5V gadgets you plug into them), the bigger worry is that with several stepper drivers on the same line, if you do not put a ~0.1uF ceramic cap across each logic supply, they will create noise that will interfere with each other and result in skipped steps by your steppers (this happened to me).

EDIT: Important notes

The capacitors MUST be ceramic, (often little yellow disks) NOT electrolytic (columns). Their purpose is to absorb super-fast noise spikes, and ceramics will get rid of MUCH higher frequencies. While I don't think a large filter capacitor is super-important, it can't hurt to put a 47+ uF electrolytic capacitor on the 5V line to absorb any large dips/spikes.

If they're the Pololu drivers, follow the setup info on the product page and you'll be fine (probably).