The eye integrates flicker above roughly 100-200 Hz, but a camera doesn't integrate continuously, it samples the scene during a short exposure (shutter/integration) window per frame. If the PWM period is comparable to or longer than the exposure window, different frames (or different rows, with a rolling shutter) catch the LED in different parts of its on/off cycle, so brightness varies frame-to-frame or you get dark bands rolling through the image, even though the average over a full period is constant and the eye sees it as steady. This is a beat between the PWM frequency and the camera's frame/line rate. The fix is to raise the PWM frequency well above the camera's sampling rate, hundreds of hertz that satisfy the eye aren't enough; pushing to several kHz or tens of kHz means many full PWM periods fall inside each exposure window, so every frame integrates the same average and the flicker disappears. (If you can't raise the frequency, an alternative is switching to analog/current dimming so the LED never fully turns off.) The lesson is that "no visible flicker" is a weaker requirement than "no flicker to a camera", the sampler's integration time, not human perception, sets the real minimum frequency.
Embedded Systems Fundamentals · Interview question
Your PWM-controlled LED looks steady to the eye but flickers badly on camera video. What's going on and how do you fix it?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
PWM
Fake an analog level with a digital pin: a fixed-frequency square wave whose duty cycle sets the average voltage, built on a timer and used for LEDs, motors, and servos.
More PWM questions
What is PWM and how does it produce an "analog" output from a digital pin?How is PWM generated using a timer?What's the tradeoff between PWM frequency and duty-cycle resolution?Why can't you drive a motor directly from a PWM-capable GPIO pin?How does PWM control a hobby servo, and how is that different from LED dimming?What is dead-time in a complementary PWM pair, and why does an H-bridge need it?
Browse all 472 interview questions