Arduino – 4-20 mA Output for VFD Control

4-20maspeedvfd

I'm a beginner with electronics, so everything has to be explained in simple terms to me.

I have an Arduino with a program which provides a value via the Analog output, so that is anything from 0-5 V.

On the other side, I have a VFD with an IO card which allows it to connect to a 4-20 mA current loop, to vary the speed of the motor accordingly.

How do I convert from, let's say, 0-5 V output (PWM) from Arduino, to the 4-20 mA in a somewhat cheap and safe way (I don't want to destroy the VFD [and possibly the Arduino])?

Currently, I am using the circuit below:

The problem is that the simulation on "Multisim" is giving accurate results. However practically, the circuit did not give the accurate results.

For example:

  • When V = 5 V output (from Arduino analog), I = 20 mA (V=IR) –> which is correct
  • But, when V = 3.3 V output (from Arduino analog), I = 16 mA (V=IR)–> which is incorrect, as it should be 13 mA

Will this circuit work practically

Best Answer

It will only work practically if the supply ground is isolated and an op-amp is used that is "single supply" such as an LM358. You could use the LM741 if you added a negative supply, such as -5V but that would be a lot of trouble to use an obsolete part. Using a more negative supply than -6V or so would expose Q2 to damage if the inverse Vbe rating is not high enough.

So you feed 5V from the PWM for 20mA (100% PWM) and 20% PWM (1V) for 4mA.

Maximum load resistance is about (12V-5.2V)/0.02A = 340 ohms to allow a full 20mA out.

Related Topic