5
\$\begingroup\$

I'm designing a schematic for an addressable RGB LEDs array and I've chosen the WS2812B because of how common and cheap they are. Looking at the typical application circuit, I noticed there is a capacitor for each LED. From https://www.alibaba.com/product-detail/WS2812B-LED-5050-SMD-RGB-LED_1616416820.html

Can the multiple capacitors be replaced with just one single capacitor? What would the capacitance need to be for that single cap?

I'm thinking of placing 50 LEDs per array and it would be very nice if I didn't need to place 50 capacitors too.

\$\endgroup\$
9
  • 8
    \$\begingroup\$ Only if you have a cap whos ESR and ESI is as low as that of the combined caps, and the LEDs are all the same small distance to that one cap that they would be to the small ones. \$\endgroup\$
    – PlasmaHH
    Commented Aug 27, 2018 at 13:47
  • 4
    \$\begingroup\$ some people also drive without seatbelts. Are they really necessary? \$\endgroup\$
    – PlasmaHH
    Commented Aug 27, 2018 at 13:53
  • 4
    \$\begingroup\$ In this case its a decent chance of failing to communicate with the LEDs \$\endgroup\$
    – PlasmaHH
    Commented Aug 27, 2018 at 13:56
  • 3
    \$\begingroup\$ No. No. No. No. \$\endgroup\$ Commented Aug 27, 2018 at 16:18
  • 1
    \$\begingroup\$ Unrelated, but you may want to look into the APA102 which is similar but uses a much simpler and more standard SPI interface, which may make things a lot easier depending on the controller you use. \$\endgroup\$
    – jcaron
    Commented Aug 28, 2018 at 13:29

4 Answers 4

13
\$\begingroup\$

The goal of each capacitor here is to smooth out the power supply of each WS2812B. When you power an array of LEDs, there is a good chance that a transient voltage drop will occur and create a flickering effect on your LED strip and most likely on other LEDs that are currently on. If you were directly powering a LED from the power supply, you wouldn't need a bypass cap. However, The WS2812B is a LED coupled with a integrated circuit. The IC is far more sensitive to voltage variation on the supply. The flickering will be caused by the IC going haywire. As it was pointed out on the comment, you would need a far bigger variation on a power supply to see actual flickering when directly powered.

By assigning one cap per circuit, you reduce the amount of calculation required to compensate. You don't need to take into account as much information. Also, you can place the cap really close to where it is actually needed. What is important here is the close proximity of the caps to minimize trace inductance.

You can also take a look at this question for further details.

\$\endgroup\$
5
  • \$\begingroup\$ Would it acheive the same effect if I place a cap for each couple of leds (the couple is composed of one led on the top face of the pcb and the other one on the back face)? \$\endgroup\$
    – prenone
    Commented Aug 27, 2018 at 14:19
  • 2
    \$\begingroup\$ @AchilleMerendino I think it's a "diminishing returns" sort of issue. "Pairing up" your WS2812s so one capacitor serves both will probably be fine in most real world scenarios (barring electrically noisy or physically harsh environments), and if your input power is already well-conditioned you can probably get away with 3 or even 4 to a capacitor. Do not change the value (0.1uF), as this will change the filtration capabilities and characteristics... but look for the best quality 0.1uF caps you can get (low ESR and ESL; equivalent series resistance and inductance, respectively). \$\endgroup\$
    – Doktor J
    Commented Aug 27, 2018 at 16:15
  • 2
    \$\begingroup\$ @AchilleMerendino you could get creative with your PCB (depending on the sensitivity of the chips) and set up jumper pads that allow you to place every other cap and jump the post-capacitor supply line of U1 to U2, with a jumper pad from the supply to U2 as well. First, put a cap on U1, then jump U1's post-cap supply to U2 and leave the supply line and capacitor for U2 unconnected. If U2 exhibits undesired behavior, remove the U1-U2 jumper, jump in the supply line for U2, and install the cap. One board, multiple configurations (instead of making a board, finding it doesn't work, and remaking) \$\endgroup\$
    – Doktor J
    Commented Aug 27, 2018 at 16:23
  • 1
    \$\begingroup\$ I feel this answer doesn't sufficiently empathize that WS2812s aren't just LEDs, they're LEDs with integrated microcontrollers. If they were just plain old LEDs there would be no need for bypass capacitors. Flickering wouldn't be directly due to supply voltage variations (the kind of supply voltage variation that would cause an LED to visibly flicker is far greater than a 0.1uF cap can compensate for), it would be due to the microcontrollers in the LEDs freaking out (from the supply voltage variations). What is important here is the close proximity of the caps to minimize trace inductance. \$\endgroup\$ Commented Aug 28, 2018 at 9:49
  • \$\begingroup\$ @TomvanderZanden see if this update clarify a bit. I didn't want to just copy and past your good comment. \$\endgroup\$ Commented Aug 28, 2018 at 18:14
11
\$\begingroup\$

Those caps are small bypass capacitors, use to filter or buffer the voltage input to an IC. They are cheap and useful and you will find them as close as possible to any IC on any manufactured pcb anywhere.

They should not be ommited without expecting funny operation. The speed that WS2812B are already driven at and the current draw of the leds already cause issues, ommiting the bypass caps would make it worse.

\$\endgroup\$
10
\$\begingroup\$

These are "decoupling" or "bypass" capacitors. Their purpose is to stabilize the local supply voltage against fluctuations caused by the interaction of varying current consumption in the circuit with the impedance of the power supply network. "Local" in this case means the supply voltage at each individual LED, which is really an integrated circuit copackaged with red, green, and blue LEDs.

Essentially, every element of the power supply network has some amount of impedance, even down to the individual PCB tracks used to go from one side of the board to the other. The principle aspects of concern here are the resistance and inductance. Assuming that the LED and it's integrated IC consumes a constant amount of current at all times, the local voltage will be perfectly stable, and the only concern is that the resistance of the power supply network is sufficiently low that not too much voltage is lost.

However, real world circuits don't have perfectly stable current consumption--the current consumed will depend on what the device is doing, what sort of signals it's sending or receiving, etc. Digital devices in particular tend to take big gulps of current at every state change. For something like a microcontroller that runs from an internal clock, every clock edge means a very fast current spike.

These spikes in current draw are a problem, because now the inductance of the power supply comes into effect. Inductance is defined, in effect, as a resistance to changes in current, so it makes the power supply network sluggish to respond to the increased current demand. The result is that the voltage at the load (the IC) drops substantially, and in the worst case can "ring", which is when the voltage rapidly fluctuates up and down, which can disrupt or damage the IC. Ringing is a result of overall structure of the power supply network and the position and magnitude of the various parasitic impedances that are an unavoidable fact of electronics in the real world. In extremely fast/sensitive circuits, even the leadframe of the integrated circuit can introduce a measurably significant set of parasitic terms.

Anyway, the solution to the power supply issue is to put capacitors as close as possible to each IC on the board. The key is that there must be as little impedance (most importantly, as little inductance) as possible between the capacitor and the IC's supply pins. Ideally, you would in fact lay out the board so that the power supply current flows 'through' the capacitor's pads and then into the IC, and would not have any vias between the IC and the capacitor. In practice, it's often not possible or feasible to lay out boards that way, and it usually isn't that big of a deal, as long as the capacitor is very close to the IC. Keeping the inductance down means that the capacitor is able to supply the fast gulps of current that the IC needs to operate, and hence stabilizes the supply voltage right at the IC.

So, the short answer to "can I replace a bunch of small bypass capacitors with one larger one?" is "maybe". The longer answer is, it depends on the specific layout of the board (constituent parasitics of the power distribution network, layout of loads), the AC characteristics of the IC in question and other loads on the board, etc. Unless you're prepared to do a lot of analysis on the system, it's easier to simply place several small capacitors. Even if you are prepared to do the analysis, unless your device will be manufactured in the ~millions the cost savings of using one capacitor instead of, say, five, isn't going to outweigh to the cost of the time you spend on that analysis.

\$\endgroup\$
3
\$\begingroup\$

Q: I'm making a bed-of-nails, and N is just so large. Can I use fewer, larger nails instead?

A: Probably, yes. To a point. Then bad things start to happen. N=1 (a sword) is clearly too far.

The capacitors are there to compensate for imperfections in the physical realization of the circuitry, ultimately driven by basic physics. How much can one reduce this compensation before things go wrong? Unpredictable, without knowing exactly how sensitive to bounce the IC's are (usually not a specified quantity) and a whole lot of other details.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Be careful about the tone of your message Jim, it is not really constructive. \$\endgroup\$ Commented Aug 28, 2018 at 2:05
  • 4
    \$\begingroup\$ @Sparky256 I'm not a big fan of analogies, but I can hardly see what's offensive about it. \$\endgroup\$ Commented Aug 28, 2018 at 9:05
  • 1
    \$\begingroup\$ I don't know what @SimonMarcoux and Sparky256 write about. I see it as a quite good analogy. What should be insulting here? \$\endgroup\$
    – glglgl
    Commented Aug 28, 2018 at 12:43
  • \$\begingroup\$ @DmitryGrigoryev My apologies for poor judgement. My down vote is locked in place. \$\endgroup\$
    – user105652
    Commented Aug 28, 2018 at 17:44
  • \$\begingroup\$ @DmitryGrigoryev while you are right, on my first read I had a strong sarcasm and irony perception of the answer. While the example illustrate this properly, the first impression was weird. I can retract my down vote too if the author of the answer modify it slightly. \$\endgroup\$ Commented Aug 28, 2018 at 18:34

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.