0

I'm pretty clueless about 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-5V.

On the other side I have a PLC (programmable logic controller) with an IO card which allows to connect to a (4-20mA) current loop.

How do I convert from lets say 1-5V to the 4-20mA in a somewhat cheap and safe way (I don't want to destroy the PLC [and possibly the Arduino])?

Of course the Arduino and the PLC have separate power sources.

  • Most arduino's don't have analog outputs (DACs), only PWM outputs. – Gerben Mar 18 '15 at 14:04
  • Volts (V) and Milliamps (mA) are not units you can convert between. for an analogy using water flowing in a pipe Volts would measure the water pressure, while mA or A measures how much water is going thru the pipe. As you can see one can effect the other, but they are not measuring the same thing at all. Also be certain to bridge the grounds (or common) of the two power supplies. – Tyson Mar 18 '15 at 15:21
  • Can you link to some documentation for the particular PLC you have? – BrettAM Mar 18 '15 at 23:58
  • Usually PLC are 24v be careful with that – Martynas Mar 19 '15 at 8:43
1

If all you need is analog 4-20mA loop transmitter, then you need an op-amp, the transistors that its output drives, a sense resistor, and a few other resistors. Note that these are at least 1% resistors. This needs to be built on a printed circuit board, not a solderless breadboard. Two of my coworkers at Maxim Integrated wrote an applications note about a 4-20mA current-loop transmitter: http://www.maximintegrated.com/en/app-notes/index.mvp/id/5610 see this figure:

4-20mA circuit from Maxim Integrated app note 5610

Since you are already using a PWM (hopefully with an RC low-pass filter), you just need everything after the DAC output. (Performance will not be as good with an Arduino PWM as it would be with a 16-bit voltage-output DAC, but the general idea would still work.) For your purpose, you can also ignore all of the stuff about the HART modem -- that's an extra feature for sending digital information along the same loop. Only relevant if your PLC receiver was expecting it.

There are also numerous prebuilt 4-20mA transmitter boards available, this has been around many decades in the industrial control market. Since Maxim Integrated makes precision DAC chips, we don't make reference designs that take 0-5V (especially from a PWM!) and convert to 4-20mA -- but we do sell reference design boards that include the DAC. Such as our Monterey system board (MAXREFDES15#). http://www.maximintegrated.com/en/app-notes/index.mvp/id/5683

There's also a 4-20mA Current-Loop Transmitter from ti.com, XTR117: http://www.ti.com/lit/ds/symlink/xtr117.pdf

There's also a board from mikroElektronika, MIKROE-1296 (available through mouser.com) that uses an Analog Devices DAC (through SPI interface) to drive the 4-20mA transmit circuit. Again, this is an idea that's been around many decades, so a search for 4-20mA transmitter should yield lots of useful information.

So your best bet is probably to purchase one of these prebuilt 4-20mA transmitter boards, which most likely will include its own precision DAC. You'll have to modify your Arduino code to drive the SPI interface, specific to whichever DAC you end up using. Or, if you really want to use the PWM to drive 4-20mA (at reduced performance), be sure to at least use an RC low-pass filter to get it as close as possible to a stable DC level.

0

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/ So this is how it works in this article they are using a 4-20mA current transmitter board with arduino, You can build it by yourself as well as you can get it from it from https://store.ncd.io/shop/?fwp_product_type=4-20ma-transmitter. it has a DAC and a XTR ( its a TI part which is used to generate 4-20mA signal) and signal and power isolator. In these application it is very important that you use isolation between device and your arduino or any other master device. Once you have all the hardware setup, you can send i2c commands and it will generate 4-20mA current loop signal. Lets say you have a device which provides 0-5V and you want to control a different device which needs 4-20mA signal in that case you can use arduino analog input to read the 0-5V and you can use this 4-20mA transmitter to convert that 0-5V into 4-20mA. For more info checkout the above mentioned article.

  • 1
    Link only answer are not good, because of link rot. Please, copy the relevante information here. – user31481 Nov 20 '17 at 21:15

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.