THE TAO OF LEDS
There’s plenty of good information about how to wire LEDs properly, and you should definitely study this lore rather than trust our brief explanation here. But there are also some important pointers that we must impart. LEDs can use a lot of power (up to 60mA each at full brightness), so if you have more than a couple of them you’ll need an external power source (we used a 5A power supply for our 144 APA102s, commonly marketed as “DotStars”). As well as a 5V power source, most programmable LEDs also use 5V for their data (and clock in the case of APA102s) lines. This is problematic because the Pi uses 3.3V logic. There are a few solutions here, including doing nothing (some LEDs will manage with the lower voltage), or using a diode or pair of resistors (to make a potential divider).
Neither of these are quite satisfactory though, and since we already have an external 5V supply, we may as well use that with a level shifter. We used the popular 74AHCT125 chip, which can boost not one but four inputs. This is good because both the clock and data lines need shifting on our DotStars. Furthermore, as you add more and start doing ever more complicated effects with LEDs, residual currents will start to flow up and down the cable, causing unwanted effects (and possibly damage). A capacitor placed across the power source acts as a reservoir for this current, and was definitely needed for our 144 LEDs. We used a 330 microfarads one, but the guidance suggests anywhere between 100 and 1,000 should do the job.