I am using an arduino board to controll a led strip. 3 transistor and 3 resistors are between the board and the leds. 1 for each color (RGB). I am using analogWrite to change the brightness.

But I wanted to make the leds even less bright, without adding another resistor. I figured out that when i turn them on and off very fast they will not flicker but they will appear to be less bright.

Will this harm the leds? Or is this ok to do? Do other people also use this trick?

  • 1
    \$\begingroup\$ LEDs can be turned on and off without damage at any frequency An Arduino can produce port pin changes down to perios around 1 uS and LEDs camn be switched at rates far above 1 MHz before you encounter any issues. Even at rates where phosphor output decay starts to matter you will not damage the LED. \$\endgroup\$ – Russell McMahon Mar 19 '17 at 10:47
  • \$\begingroup\$ When designing an induction cooker, with high frequencies and high currents then you need special components and a good design. But not for leds. Is analogWrite(1) to a PWM capable pin still too bright ? Then you need extra resistors. Some RGB leds have a controller inside, they require a digital control signal and they have often more steps than 255, thus allowing smoother and more dimmed brightness. \$\endgroup\$ – Jot Mar 19 '17 at 10:49
  • \$\begingroup\$ If it did the whole fibre-optic business would be out of work... \$\endgroup\$ – Trevor_G Mar 19 '17 at 16:58

That's what the analogWrite function is already doing: turning the LED on and off rapidly is called pulse-width modulation (PWM), and it's the standard way of dimming LEDs. It's perfectly safe at any reasonable frequency.

|improve this answer|||||
  • \$\begingroup\$ Thanks, so when i use analogwrite to controll a transistor, the transistor also turns on and off very quickly? \$\endgroup\$ – abanana Mar 19 '17 at 9:01
  • \$\begingroup\$ @abanana Yes, this is documented in the Arduino reference guide at arduino.cc/en/Reference/AnalogWrite \$\endgroup\$ – Abe Karplus Mar 19 '17 at 9:02
  • \$\begingroup\$ The ripple current factors in a bit. Turning on and off an LED with no inductance is not a good thing. It will not kill it, it will dim faster over time than a well regulated current. \$\endgroup\$ – Misunderstood Mar 20 '17 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.