Bench note

PWM frequency you'll hear before your motor does

The whine is not ambient

If your motor driver emits a pitch that matches the room's anxiety level, you've chosen a PWM frequency humans can hear. Typical Arduino defaults sit at 490 Hz or 980 Hz—comfortably inside the audible band. Your motor doesn't care about the tone, but everyone within three meters will.

Push the carrier frequency above 20 kHz. Most H-bridges and motor controllers tolerate it; your ears will thank you. The trade-off is slightly higher switching losses and a need to verify your gate drive can handle the edge rates, but silent operation in a home lab is worth the extra 200 milliwatts.

Check your timer prescaler

On AVR microcontrollers, analogWrite() defaults live in the hundreds of hertz because the timer prescaler is set for slow, predictable behavior. Reconfigure TCCR1B or the equivalent on your platform to divide the system clock less aggressively. For a 16 MHz AVR, a prescaler of 1 with an 8-bit TOP value yields 62.5 kHz—silent and still easy to filter.

If you're using a 32-bit ARM core, your timer peripherals often start at higher frequencies by default, but double-check the configuration. Many HAL libraries still ship with conservative settings that assume you want maximum compatibility, not maximum comfort.

Mind your inductor saturation

Once you're above 20 kHz, inductor selection matters more. Higher frequency allows smaller inductance values for the same ripple current, but if your core saturates, you'll get a new whine—this time from magnetic stress, not the fundamental. Use a current probe or at least check the datasheet's saturation curves before you call it done.

For a basic DC motor driver, 47 µH with a ferrite core rated for your peak current is a safe starting point. If you're running a stepper or a BLDC, match the inductance to your commutation strategy; mismatched values will show up as torque ripple before they show up as noise.

Verify with a scope and a microphone

Set your PWM frequency, then confirm with an oscilloscope that your edges are clean and your duty cycle range behaves as expected. A phone's FFT app or a cheap USB microphone can confirm you're above the audible threshold—if you see a spike below 18 kHz, you're not done.

Some motor drivers include a frequency-setting resistor or a configuration pin; others require you to generate the PWM externally. Read the datasheet. If the IC's internal oscillator tops out at 15 kHz, you'll need a different part or an external gate driver you can clock faster.

Document the choice

Log the final frequency in your build notes alongside your UART baud rates and other peripheral settings. When you clone the project six months later, you won't remember why the motor is silent—you'll just appreciate that it is. If you're writing firmware docs, mention the prescaler register values and the rationale; future you will debug faster.

Silent motor control isn't about chasing specs—it's about not wanting to wear earplugs in your own workshop. Set your PWM frequency once, verify it with instruments, and move on to the next closed-loop problem.

← Full log