4-20mA Output

Are there any relatively simple methods for generating a 4-20 mA output with an Arduino? Many motor controllers use a 4-20 mA single input to control a setpoint. There are many discussions regarding measuring a 4-20 mA signal with Arduino, but I've found virtually no information on generating such a signal.

You cannot generate 4-20 direct from the arduino but you can use the 0-5volt pwm output (after suitable smoothing) to drive a suitable generator such as here

jackrae, that may work in some cases, but 5 V is not always an adequate signal to send to the device.

But you never stated what drive voltage you required. If you want exact answers you should specify exact operating conditions. The maximum output from the arduino is 5 volts - it's the OPamp which controls the 4-20 drive current/voltage. For a typical 250ohm 4-20mA load you develop 1-5volts across the load.

The whole point of a 4-20mA system design was that the receiver - a central data gathering point - supplied a highish voltage (typically 48) over many long ( resistance unknown) pairs of wires to many trnasmitters/sensors- eg temperature or pressure transducers .

The sensor used the 4mA to power it's transducer electronics, and then sank a higher current proportional to the transducer value. The receiver measured this current

The sensor derived all it's power from the pair, and so needed no seperate power supply supply and generally had a bridge rectifier as it's input/output , which made polarity unimportant. This avoided loads of little power supplies, and ground problems. Neat idea.... and cost effective.

Often they had to be 'intrinsically safe' - which meant that any two components could fail in any way without any component having enough energy to cause a spark in a flammable atmosphere - eg a coal mine, oil platform or refinery . This makes things a LOT more complicated! I've designed such gadgets......

Making an arduino do this is possible - but not entirely trivial - and would never be intrinsically safe.

You could use an opto-coupled 4-20mA interface -AD make them - if you need a seperately powered sensor

regards

Allan

If the OP would simply state exactly what he wanted then he might get a complete answer. But like so many questions on forums, he has only asked half a question and fails to provide explanation on what exactly it is he/she is endeavouring to accomplish. Classic 4-20mA measurement method is a 250ohm resistor producing 1-5volts. The OP hasn't stated what power limitation requirements are - just that he wants 4-20 out of an arduino, so any circuit capable of producing 1-5 volts would appear to fit the bill.

Remember that the standard 4-20mA signal is called a current loop. That means that the current has to stay the same as set by the output no matter what the resistance is in the loop.

This of course is limited by the maximum voltage the circuit can apply but as mentioned earlier this is often 40V or greater. I have even seen them with 180V top ( open circuit ) voltage.

Does the OP want a 4-20mA transmitter or receiver? ie a current sink or source ? - it can't be both......

Given that info we could help a bit more

regards

Allan

Well the first line of the post did say:-

Are there any relatively simple methods for generating a 4-20 mA output with an Arduino?

So that would be a transmitter then I guess.

In which case he needs a controllable current sink... a possible approach is attached..

if it needs to be powered by the pair the arduino's fixed load - such as the power LED - would have to be removed and a constant == 4mA +5v supply designed - as I said - not quite trivial.

but I await the OP's detailed requirements....

regards

Allan

4_20 loop tx.pdf (21.9 KB)

And there's the 'magic' 250ohm resistor acting as the 1-5volt feedback for the OPamp.
If only the post originator would advise what he actually wants to drive he might get a full answer to his question.

In which case he needs a controllable current sink

No. A current loop interface is not a current sink, it is a current source.

semantics... maybe .. you could also say the +48 at the receiver end sources the current and the transmitter end sinks a variable amount...

it's not worth a lot of arguing..

regards Allan.

semantics... maybe .

NO!
Nothing to do with semantics. The way of reading a 4-20mA current loop is to put a resistance across it and measure the voltage. Try that with a current sink and you get absolutely nothing.

But the supply ie source of the current is a battery/psu at the receiver end....

regards

Allan

allanhurst:
But the supply ie source of the current is a battery/psu at the receiver end....

No, what makes you think that?

1 Like

In many 4-20mA devices the transmitter has no power supply except for the 4mA it's allowed to use for it's signal conditioning - obtained from the loop. The power comes from the receiver at the other end..

I use transmitter to mean the device which sends the data, and the receiver as the device which uses it - in this case the data is represented by an analog current.

regards

Allan

It was all an awful lot easier when it was simply 3-15psi :slight_smile:

1 Like

Boy, you boys are a little edgy. I think the original question was clear, and I have the same question. No PWM, no voltage, just a normal industry standard 4-20mA current output. Either a transmitter (2 wire) or a source (4 wire) would be acceptable. Don't obfuscate the simple question. Either yes or no. We all know how to 'make' one ourselves, but before that it would be nice to know if it already exists for sale or trade.

1 Like

Afaik, you supply the sensor with voltage and it out puts 4 - 20 ma. The receiver turns that into a voltage to be measured by the system. It seems what the OP is doing is backwards, unless he is using the arduino as a sensor.