3
\$\begingroup\$

I want to control an industrial motor rate valve that accepts a 4-20mA input.

I want to use Arduino Uno as the controller of such a device but I do not know how to generate such signal from Arduino.

I have done some research and found out that there is no definite way to do this. Instead, some analog circuitry must be done.

Can anyone help me on how to start with this? Thank you so much.

\$\endgroup\$
  • \$\begingroup\$ Do you have to generate a digital signal (either 4 or 20 mA), or an analog one? \$\endgroup\$ – CL. May 26 '17 at 9:45
  • \$\begingroup\$ @Rohat Arduino can generate PWM. Low-pass filtering the PWM can be used as a "poor man's DAC". \$\endgroup\$ – Nick Alexeev May 26 '17 at 18:00
  • \$\begingroup\$ Hi, I found out that the transmitter can accept analog and digital inputs. \$\endgroup\$ – J. A. De la Peña May 30 '17 at 8:39
13
\$\begingroup\$

Here is a schematic snippet from one of my current projects that requires 8 channels of computer-controlled 4-20 mA current output:

V0 is a analog voltage that controls the current going out CURR0+ and coming back to CURR0-. In this case, 20 mA results from V0 = 3.0 V. V0 can go to 3.3 V, so there is 10% overrange capability.

Q7 controls the current sourced onto CURR0+. That is controlled by Q9, which is in turn controlled by the opamp. The opamp adjusts the current thru Q7 to whatever it takes for the voltage V0 to appear across R34. By Ohm's law, that regulates the current thru R34.

The various resistors around Q9 and Q7 are to provide a reasonable voltage adjust range out of the opamp, and have the mapping from opamp output voltage to CURR0+ current be reasonably linear and independent of the gains of Q9 and Q7. C35 adds stability, and R31 provides the impedance for C35 to work against.

V0 is coming from a MCP4728 12 bit D/A driven by a microcontroller via a IIC bus. However, you can create that any way you like. Low pass filtering a PWM output, for example, might work for you.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Whoever downvoted this, what exactly do you think is wrong? \$\endgroup\$ – Olin Lathrop May 26 '17 at 16:20
2
\$\begingroup\$

There is no definite way of using 4-20 mA current loop. The loop is mostly used in industrial environments where we have long wire loops and voltage usually decimates before the end device, which in turn makes difficult to read Logic High and Logic Low of the communication data.

Here is a further read from Analog Devices on using opamps for this purpose. You can also use current loop transmitter and receiver for 4-20ma systems. And can control with motor with 5.0V. Little more insight on current loops ca be found here .

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

As mentionned by AKR, 4 to 20mA loop are define by multiple international standards. ISA-50 specifies 3 classes L, H and U with U being the more generic and specifiying that the transmitter need to be able to source 20mA in up to 800 ohms with supply voltage up to 32.7V. Other standard (NAMUR NE 43) will have slightly different values

Now very often the load resistance is typically 250 ohms. So if you are only trying to get a prototype to work with a short cable you might be able with a 5V supply to generate the required 20mA (20mA * 250R = 5V). Since Arduino pins are 3V, you need to have a 5V supply for your full scale. A simple passive voltage doubler here, would be an option. By fine tuning the duty cycle you'll be able to control your valve.

Note: this asssumes that your valve is a 3 or 4 wire one otherwise the 5V is most likely below the compliance voltage of your valve.

Alternatively if you want a robust solution, you'll need to generate a 24V supply (boost IC) from the 5V on board, generate a voltage with PWM, select the gain resistor so your full-scale volage is the full-scale current and use an industrial voltage to current convertor like this one.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Here's a very simple approach if you do not need high accuracy or precision:

schematic

simulate this circuit – Schematic created using CircuitLab

R1 acts as a "voltage to current converter", and the op-amp provides the necessary bias to M1 to make sure the voltage across R1 equals Vin.

Since the gate current through M1, and the input bias current to U1 are negligible, all the current flowing through the load (your motor controller, in this case) must also flow through R1. So you can use Ohm's law to convert between voltage at Vin and current through the load.

With R1 = 100 ohms, you need Vin from 0.4 to 2 volts. You might get that from a DAC output or by low pass filtering a PWM digital output.

You will need an op-amp that will function with a common-mode input voltage as low as 0.4V. A common TL072 for example does not meet these requirements, but a modern rail-to-rail type like OPA342 does. Alternately you can connect the negative supply of U1 to a negative voltage.

Be mindful of the load resistance, which should be specified by your motor controller. You must be sure V2 is high enough such that the combined voltage drop across the load, M1, and R1 aren't greater than V2 at 20mA.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Here is an article which explain how you can use arduino and a 4-20mA current loop transmitter to generate 4-20mA signal. Its using a DAC and 4-20mA current generator. https://ncd.io/interfacing-isolated-4-20ma-current-loop-transmitter-arduino/ enter image description here This Board has a DAC, XTR(current signal gen), power isolator, signal isolator. You can send i2c commands to generate the desired 4-20mA output. For any real world application its highly recommended that you use isoltators between current transmitter/receiver and the arduino or any other device.

| improve this answer | |
\$\endgroup\$
-1
\$\begingroup\$

Depending on the valve, you can fake it with PWM. From experience, a lot of PLC's don't provide analog outputs, but do provide PWM; that combined with the right resistors and source voltage is usually good enough. (not precise). (at all). (but it works). (usually).

As oberonn said, 4-20mA devices tend to follow one of a few circuits. If you can measure the resistance (or, alternatively, find a datasheet with the information), you can calculate out what you need to make a psuedo 4-20mA output.

schematic

simulate this circuit – Schematic created using CircuitLab

For basic resistance based 4-20mA input, take your source voltage (12V in above), divide by max current (12V / .02A) = 600 ohm, subtract your input resistance (say, 250 ohm), and you get 350 ohm to limit 12V down to at most 20mA. Use that to limit current, so a 0-100% PWM will be a 0-20mA output. In practice, due to voltage loss at MOSFET, you wouldn't get a full 100%/20mA, so you can drop the limit value a bit.

Other Notes:

  • If the load is literally 250ohm, you can drive it direct from an Arduino PWM, as 5V/.02A = 250ohm; no additional circuitry or voltage sources required. If it's less then 250 ohm you can do an inline resistor from Arduino.
  • For PWM frequency, you probably want more then 100Hz. I think by default the Arduino runs PWM at 1khz, so that'll be fine.
  • The MOSFET could be replaced with a transistor, but the calculations get hairy due to the addition of gate->source current, and needing to account for the current amplification parameter (h_FE). You'd do fine to calibrate that out though.
  • It's important that your supply voltage is relatively stable- if it swings from 11V to 13V, the signal will also swing from 18.3mA to 21.6mA,
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Do not connect an Arduino GPIO directly to Q1 base as implied in the schematic. You will get over 11 V on the base and this will destroy the GPIO and probably the chip. \$\endgroup\$ – Transistor Nov 20 '17 at 22:46
  • \$\begingroup\$ @Transistor You make an excellent point. I was adapting this from what I've done in the past with PLC's but not an arduino- the PLCs would use a solid state relay to the source voltage, and I mistakenly replaced it with an unprotected transistor, when a MOSFET is much closer to what was intended. \$\endgroup\$ – CoderTao Nov 24 '17 at 5:26
  • \$\begingroup\$ ... and when I say MOSFET I meant a more complicated circuit :( \$\endgroup\$ – CoderTao Nov 24 '17 at 5:44

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.