I am trying to control the speed of motor through VFD using 4-20mA signal.

I generate the 4-20mA signal using Arduino.I use low pas filter to obtain the voltages from Arduino PWM pins as shown in the circuit.

Their is continuous deviation at the output.But the deviation is very small.

Example: when Input is 1V(from 20% PWM in Arduino Code)--> Then output continuous to vary between 3mA to 4mA.

when Input is 5V(from 100% PWM in Arduino Code)--> Then output continuous to vary between 19mA to 20mA

Can I implement this circuit practically with VFD?

Will this deviation create problem for VFD to control the speed?

Will this very fast continuous deviation is dangerous for


The sawtooth pattern you're showing looks like what I would expect from incomplete filtering of the PWM signal from the Arduino.

I don't know if the variation is going to affect your motor controller or not.

I suggest using a different low pass filter with a much lower pass frequency. That will slow down the response to changes in speed slightly, but produce smoother output. I'd suggest lowering the pass frequency of your filter by 10X or more.

(The good news is that you want to filter the hell out of your PWM signal. You want it to only pass like 10Hz or so. Using a very low cut-off frequency for your filter will get rid of that sawtooth. The result of that would be an output voltage that would be slower to respond, but that should be fine. If your motor takes 1/10th of a second to adjust speeds, is that a problem in your application?)

  • No its not the problem.I used a low cutt-off frequency and get rid off saw-tooth wave.But their is still very very minor variations! Is their is any 8-bit ADC module which would give 100% pure DC. Although I achieved almost 95% accuracy.Thanks for Help! – user66555 May 28 '20 at 13:53
  • A DAC, not a ADC (digital to analog converter, not analog to digital converter) would probably give better results, but then you'd either need 8 digital pins, or a DAC that uses a serial interface like I2C. A quick search on "I2C DAC" does show a number of options. It looks like there is even an Adafruit breakout ready-made for use in Arduino projects. – Duncan C May 28 '20 at 14:41
  • Yes, I got it.Thanks – user66555 May 28 '20 at 14:51
  • The fact is that the low-speed PWM from an Arduino is noisy as hell, and needs a lot of filtering. That's what you're facing. By lowering the cutoff frequency of your filter you should be fine. You aren't trying to create a complex waveform. You just need to vary the speed of a motor, so the fairly slow-changing signal you get out of a heavily filtered PWM output should be fine for this application. – Duncan C May 28 '20 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy