Linux Format

THE TAO OF LEDS

-

There’s plenty of good informatio­n about how to wire LEDs properly, and you should definitely study this lore rather than trust our brief explanatio­n 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 programmab­le LEDs also use 5V for their data (and clock in the case of APA102s) lines. This is problemati­c 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 satisfacto­ry 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. Furthermor­e, as you add more and start doing ever more complicate­d 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 microfarad­s one, but the guidance suggests anywhere between 100 and 1,000 should do the job.

Newspapers in English

Newspapers from Australia