DEV Community

lamp nex
lamp nex

Posted on

Same "Fade In / Fade Out" Claim, Three Behaviors: What Actually Happens on the Driver

A contractor handed me a phone video last October: a downlight turning off, brightness walking down halfway, then black in one frame. Is that a fade?

I put a current probe on the driver output. At shutdown the current steps down. It does not ramp. A buyer's post that week drew dozens of replies with the identical symptom; the answer was "that's normal." It is not. Two things were left unfinished: the power-on default state, and the curve.

Three behaviors behind one slogan

What the buyer sees What slow motion shows Where it comes from
Genuine fade Follows a curve, tail closes cleanly Curve in firmware, enough bit depth, ends terminated
Flash to full, then settle Full brightness at power-up, then down to setting MCU reset leaves the IO high
Cliff at the midpoint Walks down, cuts to black The adjustable floor sits mid-range

Same phrase, different boards.

Root cause 1: the pin state at power-on

I reproduced it. Cut power, restore it, probe the MCU output: after reset and before the program runs, that line sits high. The LEDs are lit by the gap, not the code.

If main() starts a timer and configures the IO second, the interval between those steps is full brightness. The user sees a flash; the engineer sees execution order. Zeroing the duty register first costs one line.

Root cause 2: Gamma 2.2 on a shallow PWM

Perceived brightness is not linear in duty cycle — the gap is about a 2.2 power, hence γ = 2.2 in every dimming table. On that curve, 30% brightness is 7.1% duty. 10% is 0.63%. 5% is 0.14%. 1% is under four ten-thousandths of full scale.

Everything goes wrong in those last decimals. An 8-bit PWM has 256 steps; 0.63% lands on about one and a half, and 1% rounds to zero. Mathematically zero, physically off.

PWM depth Total steps Pure Gamma reaches What slow motion shows
8-bit 256 around 10% No steps below, dies when you dim
12-bit 4096 around 5% Low end works, tail acceptable
12-bit + segmented low-end map 4096 around 1% Common production approach
16-bit 65536 lower Limited by timing and chip ceiling

So "5% minimum" is not laziness; it is plain Gamma's ceiling on 12 bits. Reaching 1% needs a second, denser map for the low region; skip it and the only option is a hard floor. Two defects split here: dying on the last step is insufficient depth; cutting out at the midpoint means the floor is too high.

Root cause 3: dead band and minimum current

At 3%–5% duty the eye barely separates the level from off, but the tail still smears. A dead band fixes it: below 3%, output zero.

The other end is minimum dimming current, typically around 3% of rated — roughly 10mA on a 350mA driver. Too low and you get color shift and flicker; CCR analog dimming below 10% drifts CCT, and same-batch lamps may not strike together. Too high and the fixture "won't turn off, the lowest setting still glows."

PWM frequency matters too, typically 2k–8kHz against hearing at 20Hz–20kHz: anything in that band at low output is audible.

Why fade-out is harder than fade-in

Fade-in happens the instant power arrives and gets a free window. Fade-out does not: when the off command lands, the lamp must still be alive and the driver still running the curve. A wall switch removes the power, so fade-out needs permanent live with the switch sending only a signal — kinetic, smart, voice, automation. That is wiring topology, not brand.

The curve also has to live in the right place: frame-by-frame commands from an app or the cloud die mid-slope when the network stutters, while a ramp compiled into firmware finishes with the network down. Commercial standard drivers often spec to 5% then drop out. We build drivers and would rather hard-code the ramp.

Four checks in the field

  1. Phone on 240fps slow motion, one capture on, one off. Ramp or staircase in the playback.
  2. Set 1% and leave it. Dim, or off? Off means depth or dropout.
  3. Cut power, restore it. Any flash to full?
  4. Listen. Quiet room, lowest setting, any buzz.

Four questions before you buy

  • What is the minimum brightness percentage, and does it die there?
  • Is the ramp in the driver or in the app?
  • What is the power-on default state — does it jump to full first?
  • Wall switch, kinetic, or smart: can a wall switch fade out at all?

If none of the four gets a straight answer, nobody has built this before.

FAQ

Is fade in/out a property of the LED?

No. The LED only emits; the driver board and control channel decide how brightness travels. The same LED on different drivers gives a ramp or a cliff.

Why does the light dim, then snap to black?

Either insufficient bit depth, so the low region has no usable step, or a driver floor sitting right there with dropout below it.

Does a smart lamp need permanent live for fade-out?

Yes. The driver must keep working when the off command arrives; a wall switch that cuts power leaves no window to run the curve.

Also published at https://www.nexlamp.com/dist/blog/smart-light-fade-in-out-dimming-curve-2026.html

Top comments (0)