Electronic – Arduino PWM to analog: RC filter vs DAC

arduinodacmotor controllerpwmvoltage

I want to use an Arduino to control the throttle signal going to a high power motor ESC. The problem I have is as the Arduino outputs a PWM, the ESC reacts by pulsing the power to the motor. So I searched a bit and I understand that to convert the PWM output of the arduino to an analog signal I can use a RC filter. Also I was wondering whether DAC ICs actually convert PWMs to analog. Knowing that the Arduino has a PWM frequency of 490Hz, which of the two methods would you recommend?
Thanks for your help!

Best Answer

If your motor driver (AKA electronic speed control) is of the type used in radio controlled models, the expected speed control signal isn't just a voltage level. It listens for the RC servo "protocol": A constant frequency (usually 50 Hz) square wave with a high time between 1 ms (motor stopped on an aircraft, full reverse on car/boat ESCs) and 2 ms (full forward). While this is often called PWM, you can't just feed any PWM signal to it and expect it to work.

A servo control signal with the correct timing is easily generated by an arduino with the included servo library.


If the motor driver does actually expect a signal in the form of a voltage level (like some E-bike motor drivers, for example), you need an actual digital to analog converter (DAC) to set the speed.

  • As you already suggested, the easiest way is probably to use the PWM output library function analogWrite() and low pass filter the waveform. This is an actual, rudimentary form of a digital-to-analog converter, and should be more than good enough for your application.

  • You can use a dedicated DAC chip. While I have never seen a DAC chip which takes a PWM input (A PWM signal is actually not digital even though it only has two voltage levels, as pulse width is a continous analog property), you can buy DACs with either a serial (e.g. I2C or SPI) or a parallel(one input pin dedicated for every bit) interface.