How To Bring 4-20mA Loop Powered Sensors to the IoT World

How To Bring 4-20mA Loop Powered Sensors to the IoT World

4-20mA Sensors and IoT

4-20mA is one of the oldest and most used wired communication protocols out there. These types of sensors are easy to use, easy to set up, reliable, and noise immune. Almost every manufacturing facility will have numerous sensors that output a 4-20mA signal. Generally, these sensors connect to a PLC and from there users have to jump through a few hoops in order to take it to the cloud. There are two ways users can push data to the cloud:

  1. Install new sensors which can connect to the cloud directly 
  2. Retrofit old sensors with IoT technology 

Types Of 4-20mA Sensors

There are two types of 4-20mA signal output devices:

  1. 4-20mA Current Loop Type ( Active )
  2. 4-20mA Current Output ( Passive)

In this article we will be covering the first type, 4-20mA Current Loop ( Active )

4-20mA Current Loop Type ( Active )

4-20mA Current Loop devices are the oldest type of 4-20mA devices. In this type of device, there are two wires. These two wires carry voltage as well as signal. These kinds of devices are also known as 2-wire devices. 

These types of devices do not need any external power supply.  The NCD transmitter supplies 16V/20mA power. 

Product Link: Industrial IoT Long Range Wireless 4-20mA Current Loop Receiver

Wireless 4-20mA Current Loop Receiver

Hardware Setup

One of the main reasons behind the popularity of 4-20mA devices is that the hardware setup is extremely simple. Sensors will have two wires. One will be +ve and another one will be Ground.

4-20mA devices hardware Setup

Power Switch – The switch position should be towards the enclosure wall if it’s powered by internal batteries and it should be away from the enclosure wall if its powered by an external power supply

Radio Module – The antenna cable should be plugged into the radio module. Make sure your modem/gateway radio module looks exactly like the device radio module( same frequency). 

Antenna — Antenna should be installed all the time.  It should be pointing towards the sky. If possible mount the device away from walls.

M12 connector — This connector contains signal and power wires 

R” Button — Reset Button. When this button is pressed and released devices will send a welcome message followed by a data message 

C‘ Button — It is a configuration Button. 

How to put into Configuration Mode

  1. Press and release R button
  2. Immediately hold “C” button
  3. Keep holding the “C” Button for 6-7 sec

Hardware M12 Cable Connection

  1. White — Power -ve
  2. Brown — Power +ve
  3. Blue — 4-20mA +Ve
  4. Black — 4-20mA -Ve
  5. Gray — DNC
Hardware M12 Cable Connection

M12 Connector Connection

  1. VIN-
  2. VIN+
  3. 4-20mA+
  4. 4-20mA-
  5. DNC

There are a large number of sensor types that come with 4-20mA output. For example:

  1. Pressure sensor
  2. Temperature sensor
  3. Flow sensor
  4. Tank level sensor
  5. pH Sensor
  6. Vibration sensor
  7. Limit Sensors
  8. Light Sensor

All of these sensors can be hooked directly to the 4-20mA Current Loop Transmitter Data Acquisition Device.

How it Works

The 4-20mA Current Loop transmitter comes with a high-resolution 16bit ADC and onboard 16V power supply which powers the loop device.

This device is designed to work in low power mode. Here is how it works in the background

  1. After a fixed interval the on-Board MCU will wakeup
  2. It will turn on the Loop Supply
  3. It will wait for sensor data
  4. Turn off the Loop power to save power
  5. Turn on the radio module
  6. Send data over wireless
  7. Turn off the radio module
  8. Go back to sleep
  9. Repeat 1-8

The sensor will then send the following data in the Wireless Packet:

  1. Devices MAC address
  2. Device node id
  3. Device Type
  4. Firmware version
  5. Battery Level
  6. Transmission Counter
  7. Raw ADC value
  8. 4-20mA Value

Once the hardware is connected, turn on the device and it will send a welcome message followed by a Data message.  As an example, let’s say a pressure sensor is connected to the 4-20mA loop transmitter. This pressure sensor can measure pressure between 0-100psi. When the pressure is 0psi the sensor will output 4mA and when the pressure is 100psi it will output 20mA.

Sample Raw Packet

7E 00 19 90 00 13 A2 00 41 EE 26 5A FF FE C2 7F 00 03 03 CE 01 00 30 00 32 E4 03 7F 30

Sample Processed Packet

4-20mA-data-out Sample Processed Packet

How To Convert mA Data into Real-World Data

Result = ((measured mA – 4mA)/16)* full scale range

As an example, let’s say there is a pressure sensor that can measure 0-50psi and currently outputting is 8mA.

psi = ((8-4)/16)*50

psi = 12.5psi


NCD has built a node-red library for this device. The library can be downloaded using the GitHub page.

NodeRed Flow

Advanced Features Supported by New Gen 4-20mA Transmitter

ncd is always working on improving and enchaining the devices and user experience. Here are the few new features which have been added recently 

  1. 4-20mA calibration
  2. User Selectable Gain Settings 
  3. Status LED



Share this on: