Faster PWM

This is an exotic procedure! The standard PWM frequency on the Arduino is around 490 Hz. While it can get most jobs done, it is not really that fast. However, we can change that.

Faster PWM is especially useful when controlling motors. At low PWM, the torque is greatly affected, and it can also create audible noise. The best way to test this is to implement the Controlling speed with PWM recipe from Chapter 5, Motor Control, and increase the PWM frequency.

Note

A note to remember: this might interfere with other functions, such as delay(). We have to be extra careful when this happens.

Getting ready

Following are the ingredients required to implement this recipe:

  • An Arduino board connected to a computer via USB
  • A DC motor
  • A resistor between ...

Get Arduino Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.