In a world where digital it is all the rage thanks to the promises of concepts such as the Internet of Things, wearables, and augmented reality it’s easy to overlook just how relevant analog technology remains for many industries. Many engineers and technicians can appreciate that from a signals perspective digital signals are but a special case of analog. Dump a high-speed square wave into an oscilloscope, and it’s easy to see the inherent artifacts attesting to their analog nature such as signal slew and ringing.
And while digital is almost always dominated by the amplitude of a voltage, with analog signals it is also common to have current based signals. Perhaps one of the better-known analog signaling protocols is the 4-20mA current loop widely used for process control in industrial applications. So how is a current-based, analog protocol still useful in a world consumed by digital dreams?
Current loops have some properties that make them advantageous to use in geographically large and potentially electrically noisy (i.e., large motors) locations such as factories. Specifically:
- When used with twisted pair conductors, 4-20mA has very robust noise immunity.
- In some applications, the sensors can be powered by the current loop itself thus eliminating the need for power wiring. Referred to as “loop powered”.
- Depending on the wiring specifications and voltage used, 4-20mA be used across very long distances without signal degradation or need for buffers. Distances measured in multiple miles/kilometers are possible.
- Due to the nature of having a “live zero” (the sensor still sends out a 4mA signal when the process being monitored is off), it is easy to detect faults such as an open circuit. Also, should the current be less than 4mA or greater than 20mA other faults would be indicated.
Understanding the utility of 4-20mA signaling is great but how does one go about implementing the technology in a real-world application?
The simplest method one might use to interface a 4-20mA sensor solution to a microcontroller platform is to use a very precise resistor, often referred to as a current sense resistor. If you have ever scoured the websites of the various component distributors and run across single resistors that are quite expensive, chances are they were current sense resistors. Pushing the 4-20mA signal through the resistor converts the signal to a voltage that an analog-to-digital converter (ADC) can then read and pass onto the microcontroller. Thus, having highly precise resistors means the translation of the current signal to the voltage signal is predictable across potentially tens of thousands or more manufactured products.
Selecting a resistor value comes back to good old Ohm’s Law.
5V R=V/I 5V/0.02A = 250Ω
In reality, 249Ω resistors are readily available. Alternatively, four 1000Ω resistors in parallel will also give approximately 250Ω.
3.3V R=V/I 3.3V/0.02A = 165Ω
165Ω are available. In either case, wire wound or metal film resistors are preferable for sensing applications.
If so desired you can bypass the need for creating your own 4-20mA interface circuit altogether. Today there are many breakout boards or even “shields” that take care of the external circuitry. Thus making 4-20mA sensors to an embedded project almost a matter of plug and play (to the chagrin of many engineers!).
Lastly, it should be noted that 4-20mA need not be entirely analog. The Highway Addressable Remote Transducer Protocol (HART) was created as a way to piggyback a two-way digital signal atop the analog 4-20mA signal. By applying a +/-0.5mA signal that is frequency shift keyed (FSK) – 1200Hz for a logical ‘1’ and 2200Hz for a logical ‘0’ – a digital signal can be transmitted atop the 4-20mA analog signal. Since the average of the +/-0.5mA signal is 0mA, the analog 4-20mA signal is not affected by the introduction of the digital signal. In 2004 a WirelessHART protocol was also created should a company eventually desire to eliminate the wires without sacrificing their investment into HART-based technologies and operational processes.