Skip to content

Arduino analogWrite PWM Frequency Too Low

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about Arduino analogWrite PWM Frequency Too Low. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

The Problem

The PWM frequency from analogWrite is too low for the application.

Quick Fix

Wrong

analogWrite(9, 128);  // Default ~490 Hz PWM
Motor hums or LED flickers at 490 Hz.
// Change Timer1 PWM frequency on pin 9,10
void setup() {
  pinMode(9, OUTPUT);
  // Set Timer1 to fast PWM, prescaler 8
  TCCR1B = (TCCR1B & 0xF8) | 0x02;  // ~3.9 kHz on pin 9,10
  analogWrite(9, 128);
}
PWM output at ~3.9 kHz — no audible hum.

Prevention

Default PWM frequency of 490/980 Hz is audible in motors. Increase the frequency by reducing the timer prescaler. Higher frequency reduces torque on motors — adjust accordingly. Use libraries like TimerOne for easy frequency control.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What frequencies are possible?

490 Hz (default), 980 Hz (pins 5,6), 3.9 kHz (prescaler 8), 31.4 kHz (prescaler 1). Higher frequency means lower PWM resolution.

Does changing frequency affect other pins?

Yes. Timer0 (pins 5,6) also affects millis() and delay(). Timer1 (pins 9,10) and Timer2 (pins 11,3) are free. Change the timer that matches your PWM pins.

What is the maximum PWM frequency on Arduino?

Up to 4 MHz with fast PWM and no prescaler, but resolution drops to ~4 bits at that speed.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro