Current (mA) control for WS2812 RGB LEDs through FastLED?

You understood correctly that your digital pins have a max max at 40mA and to be safe you should stay well below that, so 20mA is recommended and the µC can indeed deal with about 200mA (that's a bit of a shortcut, it depends on ports your use etc) but the 5V pin is not a digital I/O pin coming from the µC, it's managed through on board circuitry

if you power through USB, you are feeding 5V, so it goes (almost) straight to your 5V pin. As USB provides 500mA, that's the max you can draw from the 5V pin, but some current is needed as well for your Arduino so if you want to save 200mA for the Arduino, don't draw more than 300mA from the 5V pin for example (simplified but good enough probably for your needs)

if you power through Vin, then you have a some circuitry and a regulator that will give you the 5V. if the power supply that's plugged on Vin can deliver more Amps, then you can get more power out of the 5V pin but as you go through the regulator and other components, you have some other limitations that come to play.

1 Like