ESP32 PWM Frequency Too Low Causes Flicker
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 PWM Frequency Too Low Causes Flicker. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 PWM output at low frequency causes visible flicker in LEDs or audible noise from motors.
Quick Fix
Wrong
ledcSetup(0, 50, 10); // 50 Hz for LEDs - visible flicker
LED visibly flickers. Camera recordings show rolling bands.
Right
ledcSetup(0, 5000, 10); // 5 kHz - no visible flicker
// Or use 20000 (20 kHz) to avoid audible coil whine
ledcAttachPin(2, 0);
ledcWrite(0, 200);
LED appears steady. No flicker visible. No audible noise.
Prevention
Use 1-5 kHz for LEDs. Use 20 kHz+ for motor drivers (above human hearing). Check camera shutter speed compatibility (use 10 kHz+ for video). Higher frequency reduces efficiency but eliminates flicker.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro