In electrical signaling, an analog current loop is used where a device must be monitored or controlled remotely over a pair of conductors. Only one current level can be present at any time. Although introduced more than 60 years ago, the 4-20mA current loop is still in use today, as it’s easy to implement, has good immunity to noise, and can work over great distances.
In this blog post, I will show how to use the 4-20mA T and 4-20mA R click boards from MikroElektronika to implement a current loop communication on Arduino UNO boards, focusing on the hardware aspects and on computing the maximum length of the current loop.
4-20mA T – transmitter
The transmitter used in this tutorial is the 4-20mA T click board from MikroElektronika, the key element of this click board being the XTR116 current loop transmitter from Texas Instruments. The XTR116 is controlled by the output of an MCP4921 12-bit DAC from Microchip.
The 4-20mA click board also provides galvanic separation from the current loop via one ADuM1411 quad-channel digital isolator from Analog Devices. The digital isolator also performs level translation, based on the position of J1 shunt. As such, the 4-20mA T click can be used both in 3.3V and 5V systems, depending on the position of J1. The factory setting is 3.3V, so I had to move the jumper to the 5V position to make it work in this tutorial.
The current loop side is powered from the current loop itself. The XTR116 can work with a wide loop supply range: 7.5V to 36V. In its turn, the on-chip voltage regulator provides 5V power for the MCP4291 DAC and for the loop side of the ADuM 1411. XTR116 also generates a 4.096V reference voltage needed by the MCP4291 DAC.
The current loop is connected via a set of four diodes in a bridge configuration, so the 4-20mA click will work regardless of the polarity of the supply. An SMBJ33A TVS diode with a clamping voltage of 53.3V provides protection against voltage transients. The current through the loop is set by a BCP56 (80V, 1A NPN) medium power transistor driven by the XTR116.
It might look complicated, but the only thing to care about using the 4-20mA T click with an Arduino board is to perform SPI communication with the MCP4291 DAC. Calibration also has to be performed within the transmitter software, but it’s easy to implement.
4-20mA R – receiver
The receiver used in this tutorial is the 4-20mA R click also from MikroElektronika, a perfect match for the 4-20mA T click transmitter. The receiver performs two main functions: it provides power for the current loop and it reads the current through the loop.
Powering the loop is done using a step-up converter implemented with a TPS61401 DC-DC boost converter from Texas Instruments. The output voltage is determined by the R5 to R6 ratio:
In the 4-20mA R click board the values are R5 = 1.2MΩ and R6 = 100kΩ. So, the output voltage is:
One might raise an eyebrow, as in many industrial applications the current loop is powered from 24V. This is mainly because in such industrial systems the 24V power is already available. In fact, the only issue is that with a lower voltage the length of the current loop is reduced.
Receiving data over the current loop
The receiver uses one INA196 current shunt monitor to pick up the voltage drop over a 4.99Ohm shunt. Its output voltage is fed into an MCP3201ADC, with 12-bit resolution. The 2.048V reference for the ADC conversion is given by a MAX6106 voltage reference from Maxim Integrated.
Once again, the software is much simpler than the hardware side: all we have to do is read the ADC output and convert it to a useful range.
The maximum length of the current loop
To determine the maximum length we need to determine the resistance of the cables in the loop. To do this we have to consider that the loop side of the transmitter is powered from the loop, we have to take into account the forward voltage of the rectifier diodes and we have to consider the voltage drop over the transmission line.
XTR116 needs at least 7.5V from the transmission line to work correctly, The typical forward voltage of a 1N4007 diode is 1.1V, and we have two diodes.
The maximum voltage we can afford to lose over the 4-20mA bus is:
The worst situation is when the current through the loop is 20mA. Using Ohm’s law we determine the resistance of the wires:
We assume we use standard Cat5 UTP cable, which is widely available. Depending on the manufacturer and cable quality we shall expect some 0.19 Ohm/meter. We also have to consider that we have a pair of cables, so this value doubles. Thus, we can transmit data over a distance of over 750m using standard UTP cable. Not bad.
A word of caution: there is some UTP cable on the market made from copper-clad aluminum. This type of cable doesn’t perform as well as the full-core copper cables.
I’ve also encountered some very cheap copper-clad iron cable. Don’t ask me how this went into the market, but it’s totally crap. Avoid it at all costs.