Which Arduino Pins support analogWrite() PWM?

After spending a few long minutes debugging a sketch and a breadboard, wondering why my analogWrite wasn’t dimming a LED as expected, I recently discovered that the Arduino board does not support analogWrite() on all it’s pins. Only pins 3, 5, 6, 9, 10, and 11 provide PWM output with the analogWrite function.

Then, (another discovery!) I realized that the Arduino board doesn’t really provide a analog voltage output in the strict sense, It fakes it using Pulse Width Modulation (PWM). This works great for LEDs, but probably not in application that require a steady 2.5 volts. The full explanation is on the Arduino PWM tutorial.

Reassuringly all 14 pins of the Arduino (pin 0 to pin 13) provide digitalRead() and digitalWrite() depending on your call to pinMode().

Leave a Reply

Your email address will not be published. Required fields are marked *