I have a 5 V embedded circuit where a 10 kΩ pot controls the duty cycle of an LED. I noticed that when the duty cycle is only 0.39% (or 1/255 bits), the LED is still perceptibly bright. I'm looking at the PWM signal on an oscilloscope and can see that the +5V fraction takes up only 65 us of a 16.4 ms period.

  1. What is the expected brightness of a conventional LED at duty cycles less than 1%? Feels like it should be completely off.

  2. Can anyone derive the equation relating brightness to duty cycle in this case?

Also checkout this article which gets close to the answer: https://codeinsecurity.wordpress.com/2023/07/17/the-problem-with-driving-leds-with-pwm/

"However, if you linearly sweep the duty cycle from 0-100%, you won’t see a smooth linear increase in brightness. This is because our eyes are far more sensitive to changes in brightness in the dark than in bright light; the evolutionary reasons for this are fairly obvious. If you graph the PWM duty cycle versus the normalized perceptual brightness, you’ll get a curve that looks something like this [logarithmic curve, no equation given]. At just 5% duty cycle, the perceptual brightness of the LED already exceeds 20% of the maximum."
(this leads to a gamma correction technique)

EDIT: This is a 5 V circuit, typical breadboard LED in series with a 1 kΩ resistor. The 5 V is PWM at variable duty cycle. What happens to the LED over over the full range of an 8 bit duty cycle? At what point is the LED perceptibly off? Apparently not unless the duty cycle is exactly zero.

  • 6
    \$\begingroup\$ The relationship of duty cycle to light intensity is quite linear, even down to 1%. The relationship of light intensity to perceptual brightness is complicated and dependent on the viewing environment and not exactly an electronics question :) \$\endgroup\$
    – hobbs
    Commented Sep 24, 2023 at 22:52
  • \$\begingroup\$ @hobbs I see. Did you know that LEDs are not off with <1% PWM? \$\endgroup\$
    – t3rrapin
    Commented Sep 24, 2023 at 23:15
  • 1
    \$\begingroup\$ @t3rrapin But even that brightness perception isn't simple. For example, an LED in darkness and at a distance away will look brighter if it moves back and forth slightly. It's far more noticeable than the same LED at the same intensity when it isn't moving. It's all a matter of long evolution for what works to help us survive in a complex world and removing aspects that don't matter so much. We are not measurement instrumentation. Not even close. \$\endgroup\$ Commented Sep 25, 2023 at 0:45
  • 2
    \$\begingroup\$ @t3rrapin The environment within which the display is to be used means everything to answering your question. Everything. It's one thing when discussing a darkened environment, as that relies upon a completely different visual system. It's another thing entirely when discussing open daylight where another visual system is in use and where contrast is vital and the elimination of insolation becomes yet another problem element. There is no simple answer. Everything matters. With 8-bit PWM and dim env. only 0% will be off. Orders of mag are needed. So what's the environment? \$\endgroup\$ Commented Sep 25, 2023 at 4:14
  • 1
    \$\begingroup\$ I coded most of my lighting's PWM dimmers with 10 steps of linear-ish brightness, and that means that 9/10 is 50%, while 5/10 is just 6%, and 2/10 is 0.8%, to name a few intercepts. \$\endgroup\$
    – dandavis
    Commented Sep 25, 2023 at 22:54

4 Answers 4


I'll try to give a helpful answer instead of telling you that this is a question of human perception and very difficult to answer correctly.

Gamma correction is exactly what you need and want. Basically, your LED PWM output sets the light intensity, but what you actually want to set is perceived brightness ("luma").

These follow a power law; but the actual exponent is somewhat subjective (see https://en.wikipedia.org/wiki/Gamma_correction#Power_law_for_video_display).

The good thing is you can just keep things simple and use 2 as gamma factor, which is in the right ballpark and makes everything easy to calculate, so:

led_PWM = brightness ^ 2 = brightness * brightness

Answering your question with this:

  1. A PWM value of 1% will still give you 10% perceived brightness! (1% = 10% * 10%)

  2. If you want to do this well, decent PWM resolution is required (e.g. 16bit). Because if you have only 8bit PWM resolution, your very smallest "not-off" value is already going to be ~6% "bright" (with 16bit PWM, you get a ~0.4% first increment, which is MUCH better). Here is how to calculate a 16bit PWM output from a 8bit brightness value using integer arithmetic (in C):

    uint16_t gammaCorrectU8ToU16(uint8_t desiredBrightness)
        // 66051 is (0xffff / (0xff * 0xff) << 16), rounded up
        return (uint32_t)desiredBrightness * (uint32_t)desiredBrightness * 66051 >> 16;

You will have no trouble seeing that LED going at 0.01% duty cycle in a dark-ish room. To turn the LED off, the PWM setting must be zero. That’s all there’s to it.

Many LEDs, if pulsed at say 50% of continuous current rating, will be visible with pulses as short as 50ns. Microcontrollers don’t normally have enough resolution to go that low :)

The LED itself is quite linear. Our eyes on the other hand have a dynamic range of what. 6 orders of magnitude or more? So yeah, 8-bit PWM is not gonna make a LED appear dark. Maybe in sunlight :)


Human vision has a logarithmic response, and will be more sensitive to low intensities. PWM type drive also triggers another vision path: persistence. So the eye will see the LED pulses and stretch them out, making the perceived light brighter.

  • \$\begingroup\$ The biggest reason why human vision is logarithmic is the iris adjusting. If you have only one LED as the only light source you see, this holds true. If you have one LED at very low intensity among many other brighter ones which your iris will adopt to, it's far more linear. \$\endgroup\$
    – winny
    Commented Sep 25, 2023 at 14:03
  • \$\begingroup\$ That’s not entirely true. Gamma response over an image would not see changes due to pupil size. \$\endgroup\$ Commented Sep 25, 2023 at 14:13
  • \$\begingroup\$ That is what I tried to say but didn't make well. When teachers explain to the pupils that the eyes are logarithmic, the example is going from say 100 lux classroom to 100,000 lux sunlight outside without issues, that's iris response, not gamma curve. There are two response curves, the gamma curve on an image that you mention and on top of that the global iris regulation. \$\endgroup\$
    – winny
    Commented Sep 25, 2023 at 14:19

LEDs are linear with duty cycle so long as your on time is relatively long relative to the rise time of the driver/LED combination. This will depend to some extent on how you switch it, but probably you will get good linearity down to tens of microseconds, perhaps further.

At very low duty cycles you will find that it starts to deviate from linear because the diode will take time to turn on each cycle.

  • 4
    \$\begingroup\$ The LED might be linear, but not the human eye that's observing the LED. The on time and off time and persistence of vision certainly affect how you perceive a PWMed LED. It is of course somewhat subjective too, some people have higher flicker fusion threshold than others. \$\endgroup\$
    – Justme
    Commented Sep 25, 2023 at 0:02
  • \$\begingroup\$ Yes that's true that vision will not appear linear, although since the diode is linear, you can apply a gamma curve to to the PWM to make it appear linear by eye. \$\endgroup\$ Commented Sep 25, 2023 at 0:13
  • \$\begingroup\$ The temporal response of the diode is not a significant factor in the average. It may take awhile for a pulse of injected charge carriers to make photons, but it's the amount of injected charge per second that matters. Of course, if the driver's temporal response is such that it injects less instantaneous current for a short pulse, there will be nonlinearity. \$\endgroup\$
    – John Doty
    Commented Sep 26, 2023 at 15:09
  • \$\begingroup\$ @JohnDoty I don't think that is right. A diode junction is a capacitor, so at high frequencies, most of the current is reactive and real power dissipated in the junction drops. Essentially you'll just charge/discharge the diode capacitance over and over while spending less and less time sufficiently forward biased for current to flow. \$\endgroup\$ Commented Sep 26, 2023 at 19:44
  • \$\begingroup\$ @user1850479 Usually when I drive a LED, I use a transistor that only conducts in one direction. It can't discharge the diode. \$\endgroup\$
    – John Doty
    Commented Sep 26, 2023 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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