Implementing A 4-mA to 20-mA Sensor Interface

Sensors Insights by Alberto I. Leibovich & Pablo E. Leibovich

Analog 4–20 mA current loops are one of the most used communication buses in industrial environments, where environmental variables, process sensing, and control is required. This bus type is named after its maximum and minimum current values across the line; 4mA and 20mA. Current loops are used not only for receiving information from sensors and field instrumentation, they are also used for transmitting control signals to actuators or other devices to regulate a controlled action.

Current loops, such as 4-20 mA, have been used since the 1950s in many industrial applications. The bus is appealing due to the low implementation cost, high noise immunity due to the non-voltage dependence, and the ability to be used effectively over long distances.

These characteristics are the main reasons for using a 4-20 mA loop for signaling and control. Because of this, there are several industrial sensors which implement a 4-20 mA output to indicate their measurements. Field instrumentation sensors such as pressure sensors, temperature sensors, level or flow sensors, pH sensors, and gas sensors implement a 4-20 mA connection to their outputs. Also, there are several actuators, such as valves, which can be controlled via a 4-20 mA loop.

There are several different brands of commercial IC’s that implement a 4-20 mA bus receiver. In this application, a GreenPAK is designed as an oxygen sensor with a 4-20 mA output, and is used to detect dangerous concentrations of oxygen for human beings in industrial environments. The app note implements the analog measurement and digital logic required to implement an integrated concentration-level alarm. This application also has a configurable limit value to detect out-of-level concentrations. To implement this 4-20 mA bus receiver, a SLG46621V is used.

 

4-20mA Output General Characteristics

As described before, in industrial and noisy environments, analog 4–20 mA current loops are one of the most used buses for electronic measurement and control. These buses are used not only for controlling valves or other actuators, they are also used for transmitting sensor information from field instrumentation to the control center.

The main advantages of the 4-20 mA current loop are:

  • The data transmission is not affected by the voltage drop over the interconnecting wiring, meaning it can be used over long distances with much less degradation of the signal.
  • It allows the system to implement a self-monitoring routine, because currents less than 4 mA and higher than 20 mA can indicate a fault in the circuit
  • The 4-20 mA current loop, often, is used also to power the remote device.
  • The "live" or "elevated" zero of 4 mA allows powering of the device even with no process signal output from the field transmitter.

The 4-20 mA communication bus is based on the principles of the Kirchhoff’s current law, which states that the sum of currents flowing toward a point is equal to the sum of currents flowing away from that point. With this principle, all current present at the beginning of a loop must reach the end.

This law is the basic principle to explain the behavior of the 4-20 mA loop. The current at any position of the system can be measured and found to be the same result. This is also the main reason for using current loops with low impedance within industrial applications; they provide the benefit of obtaining a longer data path with better noise immunity. A scheme of a 4-20 mA loop can be seen in figure 1.

Fig.1: 4-20 mA loop schematic
Fig.1: 4-20 mA loop schematic

One of the most commonly used and simple circuits for measuring signals of a 4-20 mA current loop is the shunt resistor circuit. This circuit is based on Ohm’s Law. The selection of the sense resistor value is made by considering the maximum voltage that our reception device can deal with, if the sense resistor is much lower than 200kΩ. With the maximum voltage known, the resistor is then calculated by the following expression:

Formula 1

To not load the interface circuit, it’s recommended to implement an electronic buffer based on an operation amplifier. An electronic circuit that is commonly used for 4-20 mA interface to digital devices with analog inputs is shown in figure 2.

Fig. 2: Schematic diagram of electronic circuit interface
Fig. 2: Schematic diagram of electronic circuit interface

The shunt resistor is divided in two half-sections. This allows the circuit to prevent the voltage becoming higher than the desired values by fixing the intermediate voltage of the shunt resistor to a local ground. The differential shunt resistor voltage is converted to a single ended voltage with the operational amplifier having a differential amplifier configuration at unity gain. Resistor values of the operational amplifier circuit are selected to not load the current loop.

 

Schematic Diagram

To show how a GreenPAK can be used for interfacing a 4-20 mA bus, this app note implements an oxygen concentration level alarm useful for industrial applications. In some environments, detecting dangerous oxygen concentrations for human beings is an important safety task.

As everyone knows, oxygen is a vital gas and a typical oxygen concentration is 20.9% v/v. If an environment has an oxygen concentration lower than 19.5% v/v, it can be considered as an environment with oxygen deficiency. Oxygen concentrations lower than 16 % v/v is unsafe for human beings.

Additionally, higher concentrations of oxygen can also be a risk for humans. If the oxygen concentration rises, material and gas inflammability increase. As an example, if the oxygen concentration is higher than 24% v/v, some elements such as clothes can start burning spontaneously.

To implement an oxygen concentration alarm, a sensor from Honeywell is used. The MF020-2-LC3 sensor has a measuring range from 0.1% v/v to 25% v/v with a 4-20 mA analog output and a power supply of 24 VDC. To measure the sensor output with a Silego SLG46621 CMIC, the Programmable Gain Amplifier (PGA) and Analog to Digital Converter (ADC) of the IC are used. To do this, the maximum input voltage of the analog converter must be considered.

If the ADC is used with an internal voltage reference of 1.2V, and with unity gain, the maximum input voltage for the converter is 1V. By applying the Rsense expression shown in previous section, the resistor value needed for the shunt is:

Formula 2

With the selected Rsense, the output voltages that will be obtained when the current loop has 4mA and 20 mA are 200mV and 1V respectively. The minimum voltage level is compliant with the minimum input voltage to the SLG46621 ADC, which is 30mV.

In figure 3, the electronic circuit that must be used for interfacing the MF020-2-LC3 sensor to the SLG46621 is shown. The operational amplifier used for this application is the SLG88103 from Silego. The Vout signal of the 4-20 mA output is connected to the Analog input of the SLG46621 chip, as seen in figure 4.

Fig. 3: Schematic diagram of Sensor interface
Fig. 3: Schematic diagram of Sensor interface
Fig. 4: Schematic diagram of Sensor interface
Fig. 4: Schematic diagram of Sensor interface

 

Implementation

The implementation of the 4-20 mA interface for an oxygen concentration level alarm is made with a SLG46621V GreenPAK. This CMIC has one Analog to Digital Converter, and several Digital Comparators that can be used for analyzing the voltage at the input of the ADC. To configure the comparison levels, the internal comparator registers are used. A block diagram of the implementation can be seen in figure 5.

Fig: 5: Oxygen Concentration level block diagram
Fig: 5: Oxygen Concentration level block diagram

The allowed upper and lower oxygen concentrations are configured in the registers. This is done by considering that the ADC has an 8-bit resolution. The maximum input voltage (1V) is converted to 255, which corresponds to an oxygen concentration of 25% v/v. With this consideration, the comparison value that must be configured for the desired concentration can be calculated as follows.

Formula 3

In this case, the minimum concentration that is required is 16%, so the corresponding register must be configured to 163. The maximum concentration allowed is 22%, so the corresponding register must be configured to 225. To implement the analog to digital conversion, the ADC and PGA of the SLG46621V must be configured. Figure 6 shows the PGA configuration and it is configured as single-end ADC with unity gain.

Fig. 6: PGA Configuration
Fig. 6: PGA Configuration

The PGA defines the analog input to be PIN 8 of the GreenPAK. The ADC complementary configuration defines the internal RC oscillator as the clock source and the internal 1.2V regulator as the voltage reference. This can be seen in figure 7.

Fig. 7: ADC Configuration
Fig. 7: ADC Configuration

The ADC output is compared with the configured values in the DCMP0 and DCMP1. In figures 8 and 9 the configuration of the DCMP’s can be seen. They are configured to compare the ADC output value with the internal registers.

Fig. 8: DCMP0 Configuration
Fig. 8: DCMP0 Configuration
Fig: 9: DCMP1 Configuration
Fig: 9: DCMP1 Configuration

The OUT+ output of each digital comparator will be high when the IN+ input of the comparator is higher than the IN- input. In this case, the DCMP0 OUT+ output will be high when the ADC is higher than the configured value. This comparator is used as the high-level detector, so this OUT+ signal is connected directly to PIN 19 and the Register 0 is configured to 225.

The DCMP1 OUT+ output will be high when the ADC is higher than the configured value. Because this DCMP is used as the low-level detector, the OUT+ output must be inverted to be connected to PIN 18. This is done with 2-bit LUT4, whose configuration is shown on figure 10. This DCMP compares the ADC conversion with the value configured on Register 3.

Fig. 10: LUT4 Configuration
Fig. 10: LUT4 Configuration

Pins 18 and 19 are the level detector outputs, representing the low-level detector and the high-level detector respectively. Pin 8 is the analog input. On figures 11, 12 and 13, their configuration is shown.

Fig. 11: PIN8 Configuration
Fig. 11: PIN8 Configuration
Fig: 12: PIN18 Configuration
Fig: 12: PIN18 Configuration
Fig. 13: PIN19 Configuration
Fig. 13: PIN19 Configuration

The entire Oxygen Level Concentration alarm implementation is shown in figures 14 and 15, where Matrix 0 and Matrix 1 of the Silego SLG46621V GreenPAK are shown.

Fig. 14: Matrix 0 block diagram
Fig. 14: Matrix 0 block diagram
Fig. 15: Matrix 1 block diagram
Fig. 15: Matrix 1 block diagram

 

Testing

To test the implementation, a simulated 4-20 mA output of the oxygen sensor was made. This output has the full range of the sensor output and it’s represented as a triangular wave. The current is linearly increased and decreased to show the change in oxygen concentration.

The simulated signal was connected to the interface circuit so it can be measured with the SLG46621V. To analyze the results, pins 18 and 19 were logged with an oscilloscope.

In figure 16, the simulated sensor output can be seen with the low-level indication of the SLG46621V. It shows how the output of pin 18 holds low when the sensor output is lower than the configured value.

Fig. 16: Pin 18 Oxygen Concentration low level detection
Fig. 16: Pin 18 Oxygen Concentration low level detection

In figure 17, the simulated sensor output can be seen with the high-level indication of the SLG46621V. It shows how the output of pin 19 holds high when the sensor output is higher than the configured value.

Fig 17: Pin 19 Oxygen Concentration high level detection
Fig 17: Pin 19 Oxygen Concentration high level detection

 

Conclusion

In this application note, we implemented a 4-20 mA interface for measuring the output of an oxygen sensor to detect out-of-range oxygen concentrations. 4-20 mA current loops are used in most industrial sensors and actuators because of the buses’ high noise immunity and compatibility with long distance wiring.

There are several methods of interfacing to a 4-20 mA output. In this application note, one of the simplest and most commonly used methods of interpreting a 4-20mA line is shown. It is also described how the signal can be conditioned to be measured with a Silego GreenPAK by using the integrated Analog to Digital Converter.

The size of the Op-amp and GreenPAK measurement system is smaller than many other implementations, and it can be further reduced by incorporating more of the logic for the specific application into the SLG46621V.

 

About the authors

Alberto I. Leibovich graduated from National University of La Plata (UNLP) in Argentina and is currently working at ADOM Ingenieria as the Director of the Development Department. ADOM Ingenieria specializes in professional design, development, support and consulting in analog and digital electronic requirements.

Pablo E. Leibovich graduated from National University of La Plata (UNLP) in Argentina. He is currently working in the Development Department of ADOM Ingenieria as a development engineer.