1
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ If V = 3.3 volts then Iout should be 14.56 mA. I don't know how you got 13 mA. OK you assumed that 1 volts = 4 mA rather than 0 volts is 4 mA. You need to decide this. \$\endgroup\$ – Andy aka May 25 at 11:29
  • \$\begingroup\$ How it is 14.56mA? Plz Explain \$\endgroup\$ – usman shah May 25 at 12:26
  • \$\begingroup\$ 0 volts maps to 4 mA and 5 volts maps to 20 mA plus a straight-line graph. \$\endgroup\$ – Andy aka May 25 at 12:29
  • \$\begingroup\$ Oh! I got it.Thanks \$\endgroup\$ – usman shah May 25 at 12:34
  • \$\begingroup\$ FOR 1-5V to 0-20mA: I am very confused! When I use 3.3V ouput from Arduino Nano Power Pin--> Iout=13mA (which is ok). But,When I use 3.3V ouput from Arduino Nano Analog pin(PWM)--> Iout=16mA (I can't understand this value). At 2.5V output from Arduino Nano Analog Pin--> Iout=13.7mA. Is seems their is a problem using Analog pins of arduino nano.?? \$\endgroup\$ – usman shah May 25 at 13:19
1
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Obviously you need to low-pass filter the PWM to be sure it will work properly. \$\endgroup\$ – Spehro Pefhany May 25 at 12:18
  • \$\begingroup\$ what value of C and R should be used? \$\endgroup\$ – usman shah May 25 at 12:21
  • \$\begingroup\$ That sounds like a different (new) question and it will depend on your PWM frequency and allowable ripple. \$\endgroup\$ – Spehro Pefhany May 25 at 12:29
  • \$\begingroup\$ 0 FOR 1-5V to 0-20mA: I am very confused! When I use 3.3V ouput from Arduino Nano Power Pin--> Iout=13mA (which is ok). Similarly, with 3.3V Battery -> Iout=13mA (which is ok). But,When I use 3.3V ouput from Arduino Nano Analog pin(PWM)--> Iout=16mA (I can't understand this value). At 2.5V output from Arduino Nano Analog Pin--> Iout=13.7mA. Is seems their is a problem using Analog pins of arduino nano.?? \$\endgroup\$ – usman shah May 25 at 13:49
  • \$\begingroup\$ 3.3V = 13.2mA with 250 ohms. \$\endgroup\$ – Spehro Pefhany May 25 at 13:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.