Power notes

Daniel Garcia edited this page Nov 11, 2015 · 2 revisions

Power: tips, troubleshooting, and measurement.

Troubleshooting

Often when an LED strip is acting odd, or randomly, there's a power problem. Here are some things to check and try:

  • See if your animation works properly at a very low setBrightness level (e.g., "32", which is 1/8th brightness), but then goes nuts at higher brightnesses. If so: you're out of power.
  • See if your animation works properly on a very small number of LEDs, but then starts going nuts when you step up to a larger number. If so, you're out of power (or you have an out-of-RAM problem).
  • If your setup is USB-powered and having trouble, try powering your LED strips from an external (5v) power supply. Make sure to connect the Ground from the external power supply to the USB-based Ground. If your animation flickers and goes nuts when exclusively USB powered, but works fine with an external power supply, you were out of power.

Tips

Some of these are just good engineering. Some are just plain voodoo. Use whichever ones that work for you.

  • At the 'far' end of long LED strips, connect the Data line to Ground.
  • Insert a 200 ohm resistor between the output pins on the microcontroller and the inputs (data, clock) on the LED strip.
  • Use a level-shifter to raise the voltage of the output pins' 3.3 volts to a full 5 volts before sending it into the LED strip's data (and/or clock) inputs.

Measuring USB power

Here are a few devices that can be used to measure the current drawn from a USB port; all are easy to use, none deliver NASA-grade accuracy -- to say the least.

Managing power in FastLED

(introduced in FastLED3.1.1)

FastLED allows you to cap the power usage of your leds. There's two ways to set the max power draw you want. The first is by specifying the voltage your leds will be running at and the maximum milliamps you want to draw:

   // limit my draw to 1A at 5v of power draw
   FastLED.setMaxPowerInVoltsAndMilliamps(5,1000); 

The other is to specify the maximum draw you want in watts:

   // limit my draw to 5W
   FastLED.setMaxPowerInMilliWatts(5000);

Note that at the moment the power management functions are assuming standard(ish) 5v LEDs. We will be looking to extend this in the future to account for 12v leds, or 5v leds that may have different power draws than the 5050 based stuff that most folks are using today.