Can someone help me with decoupling capacitors?

Can someone help me with decoupling capacitors? I get my ws2812b and APA102’s by themselves and I’ve used different types of .1uf to 10uf ceramic, smt, and electrolytic capacitors and I feel that I just don’t really get what im doing with them because im getting mixed results. I know that I need to solder the capacitor between the LED drivers IC ground and VCC as close as possible to the IC, but does it matter if im using electrolytic or ceramic or whatever? And what is the ideal microfarad rating for this specific use of let’s say specifically for APA102 since that’s what im currently wanting to move forward with. Should I use just one larger decoupling cap at the start of a strand of 6-12 leds…? Or should I just be using 10uf or less per IC…? So confused :confused:
Also im trying to keep the form factor as small as possible so please let me know if an smt sized cap can work here and perhaps my soldering is just too shoddy.

This doesn’t specifically answer your question but still might be of interest. https://learn.adafruit.com/adafruit-neopixel-uberguide/power

Typically you need a single 0.1uF capacitor for each chip, as close to the chip as possible. You usually want to use ceramic SMD capacitors for this because they are small and have minimal lead length so the capacitance is close to the chip. Take a peek at any WS28xx strip and you’ll see them: http://www.gree-leds.com/PIC/PIC/201316214980.jpg

Interestingly, it seems that APA102 doesn’t need external bypass caps. None of the strips I’ve seen have them: http://www.gree-leds.com/PIC/PIC/2014102293230.jpg
(from: http://www.gree-leds.com/productshow.asp?ArticleID=Q8U5UYV57U )

And the datasheet doesn’t make any mention of them either in their application circuit (see pg 5):
http://www.element14.com/community/servlet/JiveServlet/download/129515-156653/APA102%20Datssheet%20GREELED.pdf

So I would say: If you’re using APA102, you don’t need external caps.

In a circuit with many distributed fast switching components, (like in an LED strip for example) it is highly recommended to have distributed ‘decoupling’ capacitors as close as possible to the power inputs of each component.

A 0.1uf per LED is recommended by the manufacturer of WS2812. They are typically installed on the strips.

If you are assembling the devices in strips or arrays in a homemade way, I would try to also have 1 decoupling 0.1uf cap per LED.

@Tod_Kurt I don’t know much about the APA102s but they would have the same fast current demands as a WS2812, probably even more as they are said to be much faster.
Unless they have integrated the cap within the device, I would definitely add one just the same as with the WS2812.

Thank you all!

@JP_Roy yeah that’s what I would expect too. But I could find no examples of extant APA102 strips in the wild with caps and the datasheets don’t mention it. (while datasheets for other “smart pixels” do)
Very odd. There’s no obvious capacitor visible inside an APA102 and it seems like a pretty big manufacturing change to mold it internal to the plastic package.

I realize these are a good idea, in general, but what does the circuit do if you don’t have them and you need them? Like what happens to the LEDs or other components? I’ve read some theory on this, but what happens practically?

Generally you’ll see the chip with no decoupling capacitor “reset” in some way as its local power supply dips below the chip’s brown-out threshold and the chip acts as if its power was cut off and then re-applied. (That’s what decoupling caps do: act as tiny charge reservoirs to help smooth out voltage droops)

For these LED driver chips, what you’ll probably see is a bunch of things like: flickering, not passing along data to the next LED in the strip, forgetting colors or wrong colors, or even just not working.

For microcontroller chips like the ATmegas in Arduinos, you’ll see the chip restart the its program sketch. And then keep restarting as it draws enough power to cause a brown-out, restarts, draws enough power to brown-out, and so on.

@Alex_Wayne In the worse case scenarios, you get so much switching noise on the power lines that it affects device operations. I have seen cases (nothing to do with LEDS but still…) where the local supply voltage drops below specified tolerances during some of these current spikes. Distributing decoupling caps within the circuit fixed the problem completely.

You have to see the wires, or traces on a PCB or on a strip as being very low resistances and not perfect conductors.

When a circuit (or an LED) switches state, the instantaneous current draw is surprisingly high even though it is also very short in duration. That amount of current will cause a local voltage drop. The adjacent capacitors act as little batteries that are able to quickly supply that current locally instead of it coming all the way from the actual DC PSU.

Decoupling capacitors of 0.1uF hold very little charge, they will do nothing regarding the voltage drop. 0.1uF is about 1.25x10^-6 J at 5v, pretty much nothing.

The purpose of a decoupling capacitor at each component is only to assist in the matching of the component power supply tracking and to reduce ‘ringing’ which echoes around the circuit. When a chip changes state, a blip occurs on the supply, so steep it looks pretty much like a square wave edge, either rising or falling, depending on the state change occurring - on or off. And this ‘ring’ injected onto the supply will be proportional to the characteristics of the load being driven - resistances, inductances and capacitances and the drive ability of the output. These reflect back into the supply rails. The decoupling capacitor works with the characteristics of the supply track to remove the ring which will reflect up and down the track for a short while, until it is absorbed naturally. The more components you have changing state, with the more components on the same supply, and the faster you change states, the worse this becomes. Until things start to appear to die operationally randomly.

If you look on old TTL boards you will notice the chips and the supply arranged into a grid. Each chip will normally have the decoupling capacitor at the north end (pin 1) with one leg attached to the 5v supply and the supply pin of the chip. The other leg will either go to the ground plane or the ground pin of the same chip. The supply rail(s) are then routed in straight lines left/right or up/down on the PCB, and at the end you will probably find either tantalum or electrolytic (or both) to isolate that row/column from the other rows/columns.

With your LED driver chips, these are switching really fast on each of Red, Green and Blue. Using PWM drives for each colour to give the intensity you program each chip with. So basically each chip is switching 3 high current channels at 3 different frequencies. And the decoupling for this may or may not have been built in to some extent. No harm in adding additional decoupling.

Use ceramic capacitors where a fast response to charge/discharge is needed. These are cheap to manufacture in small capacitances and are ideal to remove ‘ring’ edges from power supplies. Place them near to any component that changes state(s) rapidly.

Tantalums are too expensive for this purpose. There are also very fast reacting and are available in higher capacitances, so are better suited to removal of high frequency noise from supplies. You will often see then strapped around voltage regulators (to remove high frequency switching noise from the regulator output), groups of chips, or where power enters smaller PCBs. Also use them near components that switch larger currents.

Electrolytics are the power reserves, but are bulky and slow to respond (compared to other technologies). Their job is the smooth out power dips when switching larger currents while the supply recovers. Used with faster tantulums (and local decoupling) and you can remove most forms of power noise and dipping.

SMD makes very little difference to the decoupling ‘feature’. SMD are choosen mostly to reduce board real estate. You still have to span the chips own power pins with the distance they are apart and the supply track distance too. These define the actual decoupling component size. Inductance and resistance play a part, but that is another story.

Track/wire performance on the supplies are your biggest enemy. The resistance, capacitance and inductance all play an important part. Minimise all of them and decoupling is not needed. But obtaining perfection comes with costs. Either financial, or physical. So decoupling is a cheap fix.

@Adam_Sharp You’re completely right. I was simplifying things for explanatory purposes. (In my Arduino classes I’ve found that describing bypass caps as “little batteries” is more useful than getting into the rather complex issue of power bus noise. Same with lead length minimization to minimize parasitic inductance instead of going into how everything is an RLC circuit) Apologies if I offended for not being completely accurate.

@Tod_Kurt No offence taken. It is very difficult to pitch explanations at the correct level. Do you go engineer or young hobby student? Generally found that both is the best. And maybe a layer in between. I hope I was expanding on your words. The original query was which capacitor is best and that is no simple answer…

Thanks for these thoughts and good bits of info. I appreciate your knowledge and explanations all.

@Adam_Sharp Well, sorry to disagree about your statement " …they will do nothing regarding voltage drop" but that is exactly what the decoupling capacitors will do.

However, you describe the effect of ‘ringing’ accurately but ringing is actually a variation in voltage. Ringing is a cyclic bouncing around of a voltage spike that will get attenuated over time. Local decoupling caps attenuate that initial voltage spike that may have otherwise resulted in ringing.