100nF

4–20 mA calculator: loop current to engineering units and back

Scale a 4–20 mA loop current to a process value and a percentage of span, or a value to the current that represents it, for any range, reversed ranges included. It gives the voltage across the sense resistor (250 Ω turns 4–20 mA into 1–5 V) and the code an ADC reads, flags under- and over-range currents, and checks the loop voltage budget: the transmitter's minimum voltage plus every I·R drop in the loop against the supply, with the longest cable the supply allows. A fourth mode sizes the transmitter end, reproducing TI's SLAA866 design.

underovermA48121620% span0.0025.050.075.0100bar0.002.505.007.5010.0V, 250 Ω1.002.003.004.005.0012.00 mA = 5.000 bar+−V_S24.0 VR_sense250 ΩR_wire/251.6 Ω totalI_max 20.0 mA →TX18.0 VV_SV_TX(min) 12.0 VI·R_sense 5.00 VI·R_wire 1.03 Vheadroom 5.97 Vmin V_S 18.0 V
Fig 1 — Top: the live-zero scale, 0.000 bar at 4 mA and 10.00 bar at 20 mA, with 1.00 V to 5.00 V across 250 Ω; 12.00 mA is 50.0 % of the span. Bottom: the loop at 20.0 mA. The 24.0 V supply has to cover the transmitter's 12.0 V minimum plus 5.00 V across the sense resistor and 1.03 V in 1.00 km of AWG 22 copper: 5.97 V to spare.
Value at 12.00 mA
5.000 bar
Share of the 16 mA span (4 mA = 0 %, 20 mA = 100 %)
50.00 %
Loop status
in range
Voltage across R_sense = 250 Ω · at 4 mA and 20 mA
3.00 V · 1.00 V to 5.00 V
Slope: change in value per 1 mA of loop current
0.6250 bar per mA
Ideal 12-bit ADC over 5.00 V: code at this current
2457 of 4095
ADC codes from 4 mA to 20 mA · value per code
819 to 4095: 3276 codes · 0.00305 bar
Highest loop current the ADC can read, FSR / R_sense
20.00 mA
Cable: 2 × 500 m of AWG 22 at 51.6 mΩ/m
51.6 Ω
Loop resistance R_sense + R_wire + R_other
302 Ω
Least supply, V_TX(min) + I_max·R_loop, at 20.0 mA · headroom
18.0 V · 5.97 V
Voltage across the transmitter at I_max · at 4 mA
18.0 V · 22.8 V
Largest loop resistance on 24.0 V · longest cable of AWG 22, one way
600 Ω · 3.39 km
Sense resistor dissipation at I_max, I²R
100 mW

The ADC's full scale is 20.00 mA of loop current, so it cannot see over-range: anything above that reads as the top code. Choose a lower R_sense or a higher FSR to keep some headroom above 20 mA.

Scaled as if 0 mA were the bottom of the range, 12.00 mA would read 6.000 bar instead of 5.000 bar, an error of 10.0 % of the span.

How this is calculated

Standard: TI SLAA866A, Loop-Powered 4mA to 20mA Transmitter Circuit, pages 1–2; TI SLYT847, Designing 4mA to 20mA loop-powered transmitters, pages 1–3; TI SLAA013 for the ADC step

I=4 mA+16 mA×x−xloxhi−xlo,x=xlo+(xhi−xlo)×I−4 mA16 mAI = 4\,\text{mA} + 16\,\text{mA} \times \frac{x - x_{lo}}{x_{hi} - x_{lo}}, \qquad x = x_{lo} + \left(x_{hi} - x_{lo}\right) \times \frac{I - 4\,\text{mA}}{16\,\text{mA}}
The scaling, both ways: a straight line from x_lo at 4 mA to x_hi at 20 mA. SLAA866 sizes its circuit from "the zero-scale current (4mA)" and the "current span of 16mA". Nothing requires x_hi > x_lo, so a reversed range is the same line with a negative slope. A current outside 4–20 mA is scaled along the same line and flagged, not clamped.
% span=100×I−4 mA16 mA,V=I×Rsense,code=round⁡ ⁣(VFSR/(2n−1))\%\,\text{span} = 100 \times \frac{I - 4\,\text{mA}}{16\,\text{mA}}, \qquad V = I \times R_{sense}, \qquad \text{code} = \operatorname{round}\!\left(\frac{V}{\text{FSR}/(2^{n} - 1)}\right)
The percentage of span, the voltage across the receiver's sense resistor, and the code an ideal n-bit ADC returns, with 1 LSB = FSR/(2ⁿ − 1) as TI's SLAA013 defines it (the ADC resolution calculator uses the same module). 250 Ω gives 1 V at 4 mA and 5 V at 20 mA. The ADC is ideal here: no offset, gain or linearity error.
VS≥VTX(min)+Imax(Rsense+Rwire+Rother),Rwire=2L×ρCuAAWGV_{S} \ge V_{TX(min)} + I_{max}\left(R_{sense} + R_{wire} + R_{other}\right), \qquad R_{wire} = 2L \times \frac{\rho_{Cu}}{A_{AWG}}
The loop budget, by Kirchhoff's voltage law; it is not printed in either TI document. The supply has to cover the transmitter's minimum operating voltage plus every drop in series at the largest current the loop will carry. SLYT847 defines the loop compliance voltage as "the range of the loop voltage at which the transmitter is functioning" and gives "12V to 36V" as the typical range. R_wire is both conductors, from the AWG definition and ρ = 1.68 × 10⁻⁸ Ω·m at 20 °C, as on the wire gauge calculator.
Rloop,max=VS−VTX(min)Imax,Lmax=Rloop,max−Rsense−Rother2 ρCu/AAWGR_{loop,max} = \frac{V_{S} - V_{TX(min)}}{I_{max}}, \qquad L_{max} = \frac{R_{loop,max} - R_{sense} - R_{other}}{2\,\rho_{Cu}/A_{AWG}}
The same inequality solved for the most resistance the loop may have, and for the longest one-way cable of a given gauge that leaves room for it. Derived here.
IOUT=(VDACR1+VREGR2)(R3R4+1)I_{OUT} = \left(\frac{V_{DAC}}{R1} + \frac{V_{REG}}{R2}\right)\left(\frac{R3}{R4} + 1\right)
SLAA866's output current transfer function, page 2, as printed. The op amp holds the node where R1, R2 and R3 meet at the circuit's ground; the current into that node flows through R3, the same voltage appears across R4, and R4 carries R3/R4 times as much. So the loop sees R3 ∥ R4, and at 20 mA that is 531 mV (derived).
R2=VREGIOUT,ZS(R3R4+1),R1=VDAC,FSIOUT,SPAN(R3R4+1)R2 = \frac{V_{REG}}{I_{OUT,ZS}}\left(\frac{R3}{R4} + 1\right), \qquad R1 = \frac{V_{DAC,FS}}{I_{OUT,SPAN}}\left(\frac{R3}{R4} + 1\right)
SLAA866's design steps 2 and 3. With R3/R4 = 4.32 kΩ/26.7 Ω, V_REG = 3 V, V_DAC,FS = 3 V, 4 mA and 16 mA, TI prints R2 = 122.10 kΩ and R1 = 30.524 kΩ; the module gives 122.10 kΩ and 30.5246 kΩ. With the fitted 122.15 kΩ and 30.542 kΩ, TI prints 3.9983 mA and 19.9891 mA; the module gives 3.99831 mA and 19.98918 mA.

Assumptions

Why 4–20 mA, and why the zero is 4 mA

A 4–20 mA loop carries a measurement as a current. The field transmitter, a pressure, level, flow or temperature sensor, sits in series with a DC supply and the receiver's input, and sets the current that flows around the whole loop. TI's article on loop-powered transmitters, SLYT847, puts it in one line: "The transmitter transmits the signal by regulating current within the loop, acting as a voltage-controlled current source." Because it is one series circuit, the same current flows through every part of it. The resistance of a long cable changes the voltage the loop needs, not the reading, as long as the supply has enough voltage to cover it. That is the property SLYT847 opens with: "4mA to 20mA offers resiliency over long distances, reliability, immunity to noise, and universal compatibility with every PLC system."

The bottom of the range is 4 mA, not 0 mA, and that offset is doing two jobs. The first is power. In a two-wire transmitter the loop is both the signal and the only supply, so the electronics have to run on less than the smallest current the loop ever carries. TI's SLAA866 circuit note says it directly: "The active circuitry in the transmitter derives power from the loop current, meaning the current consumption of all devices must be less than the zero-scale current, which can be as low as 3.5mA in some applications." Its design notes ask for "a total sensor-transmitter quiescent current of less than 4mA". A zero at 0 mA would leave the transmitter nothing to run on at the bottom of its range.

The second job is diagnosis, and it follows from the arithmetic. With a live zero, every valid reading is at least 4 mA, so a loop reading 0 mA is not the bottom of the range: it is a broken wire, a dead supply or a failed transmitter. A 0–20 mA signal cannot tell an open circuit from a process sitting at zero. Transmitters use the room below 4 mA on purpose, too: SLYT847 says the DAC161S997 loop DAC "signals an error-low current below 4mA". The calculator scales a current outside 4–20 mA along the same line, so the value it would represent is visible, and flags it as under- or over-range rather than clamping it.

The 4–20 mA formula: scaling to engineering units and back

The transmitter is calibrated to a range: a value xlo it reports as 4 mA and a value xhi it reports as 20 mA. Between them the current is a straight line with a span of 16 mA, SLAA866's "current span of 16mA". The percentage of span is 100 × (I − 4 mA)/16 mA, and the value is x = xlo + (xhi − xlo) × (I − 4 mA)/16 mA. Run the other way, the current for a value is I = 4 mA + 16 mA × (x − xlo)/(xhi − xlo). The reference note below typesets both.

Each 4 mA step is a quarter of the span: 8 mA is 25 %, 12 mA is 50 %, 16 mA is 75 %. Nothing in the formula requires xhi to be the larger value. A level transmitter set up so that 4 mA means full, a range of 100 % to 0 %, is the same line with a negative slope, and 8 mA reads 75.0 %. The calculator accepts a reversed range as it is: enter the value at 4 mA and the value at 20 mA, whichever is larger.

4–20 mA scaling table: percent, pressure and temperature

Three ranges at each 4 mA step, one of them reversed, with the voltage across a 250 Ω sense resistor and the code an ideal 12-bit ADC with a 5 V full scale returns for it. Every entry comes from the calculator's own functions.

Loop current% of span100–0 %, reversed0–10 bar−50 to 150 °CV across 250 Ω12-bit code, 5 V
4 mA0.00 %100 %0.00 bar−50.0 °C1.00 V819
8 mA25.0 %75.0 %2.50 bar0.00 °C2.00 V1638
12 mA50.0 %50.0 %5.00 bar50.0 °C3.00 V2457
16 mA75.0 %25.0 %7.50 bar100 °C4.00 V3276
20 mA100 %0.00 %10.0 bar150 °C5.00 V4095

The temperature range shows why the offset matters: 0 °C is not at 4 mA but at 8.00 mA, a quarter of the way up, and each 4 mA step is 50.0 °C. The code column shows what a live zero costs a receiver that measures from 0 V: no valid reading uses a code below 819, so the span gets 3276 of the ADC's 4095 steps, 80.0 %.

4–20 mA to voltage: the sense resistor and the ADC

A receiver that measures voltage reads the loop across a sense resistor, V = I × R. 250 Ω is the value that turns 4–20 mA into exactly 1.00 V to 5.00 V, which is why it is so common. At 20 mA it dissipates I²R = 100 mW, and it takes 5.00 V of the loop's voltage budget at full scale: the larger the sense resistor, the less is left for the cable and the transmitter.

The ADC's full scale decides whether the receiver can see over-range at all. With 250 Ω into a 5 V ADC, 20 mA lands on the top code, so anything above it reads the same; a transmitter driving 21 mA to report a fault looks like full scale. With a 3.3 V ADC, 250 Ω would clip at 13.2 mA; a 150 Ω resistor gives 600 mV to 3.00 V, reaches the ADC's full scale at 22.0 mA, and still leaves 2978 codes across the span. The calculator reports the highest current the ADC can read and warns when it is at or below 20 mA.

Compare that with the transmitter end. SLYT847 gives the range for commercial transmitters: "Commercial 4mA to 20mA transmitters have resolutions between 12 bits and 16 bits." A 12-bit DAC across 16 mA steps the loop by 3.91 µA; a 16-bit one by 244 nA. A 12-bit receiver across 250 Ω with a 5 V full scale resolves 4.88 µA of loop current per code. The receiver's resolution is set by its own ADC, its sense resistor and the share of its range the live span uses, not by the transmitter's. TheADC resolution calculator takes on the ADC's own errors.

Worked example: TI's loop-powered transmitter, SLAA866

TI's SLAA866 is a complete two-wire transmitter: an LDO that runs the electronics from the loop, a DAC, an op amp and a transistor that together set the loop current. Its design goals are a loop supply of 12 V to 36 V, a DAC output of 0 V to 3 V, an output current of 4 mA to 20 mA and an error of "<1% FSR". Its output current transfer function is IOUT = (VDAC/R1 + VREG/R2)(R3/R4 + 1). SLYT847 describes the principle of the same topology: "hold both inputs of the operational amplifier at virtual local ground. Whatever voltage R1 holds, Rsense also holds." R2 from the 3 V regulator sets the zero scale with the DAC at 0 V, and R1 from the DAC adds the span. The left column is the calculator's arithmetic; the right is what TI prints on page 2.

gain      R3/R4 + 1 = 4.32 kΩ / 26.7 Ω + 1         = 162.798     
R2        3 V / 4 mA × gain                        = 122.098 kΩ   TI: 122.10 kΩ
R1        3 V / 16 mA × gain                       = 30.5246 kΩ   TI: 30.524 kΩ
fitted    R2 = 122.15 kΩ, R1 = 30.542 kΩ
I_ZS      3 V / 122.15 kΩ × gain                   = 3.99831 mA   TI: 3.9983 mA
I_FS      (3 V / 30.542 kΩ + 3 V / 122.15 kΩ) × gain = 19.98918 mA  TI: 19.9891 mA
errors    I_ZS − 4 mA, I_FS − 20 mA, of 16 mA      = −0.0106 %, −0.0676 % TI: < 1 % FSR goal

Every value agrees with TI's to the digits printed, with one convention to note: TI cuts its figures off rather than rounding them. R1 is 30.5246 kΩ, which rounds to 30.525 kΩ and cuts to 30.524 kΩ, TI's figure; the full-scale current is 19.98918 mA, which rounds to 19.9892 mA and cuts to TI's 19.9891 mA.

The fitted R1, 30.542 kΩ, is 17.4 Ω above the computed 30.524 kΩ, the same digits in a different order; the schematic and step 5 both use it, and the note does not say why it was chosen. Its effect is small: the full-scale current falls 10.8 µA short of 20 mA, 0.068 % of the span, and the zero-scale current, with R2 at 122.15 kΩ rather than 122.10 kΩ, sits 1.69 µA under 4 mA. Both are well inside the 1 % design goal, taking the full-scale range as the 16 mA span. The DC transfer characteristic on the same page, a simulation of the whole circuit, marks 4.0014 mA and 19.9922 mA at the ends; those include the real parts and are not what the equation gives.

Two derived figures the note does not print. With the DAC at 1.5 V the loop carries 11.994 mA, and only 73.7 µA of it flows through R1, R2 and R3; the rest flows through R4. That is what design note 3 asks for: "Minimize current flow through R1, R2, and R3 by selecting a large ratio of R3/R4 to minimize thermal drift of the resistors." And the loop current returns through R3 and R4 in parallel, 26.5 Ω, so at full scale 531 mV of the loop's voltage is dropped inside the transmitter before its regulator sees anything. That drop is part of what sets the transmitter's minimum operating voltage. The calculator's transmitter mode reproduces this design with its defaults.

Worked example: reading a 0–10 bar transmitter

The receiver end, with round numbers: a pressure transmitter calibrated 0 bar at 4 mA to 10 bar at 20 mA, read across 250 Ω by a 12-bit ADC with a 5 V full scale. The receiver measures 3.10 V.

current   I = 3.10 V / 250 Ω                       = 12.40 mA    
span      (12.40 − 4) / 16                         = 52.50 %     
value     0 + 10 bar × 0.5250                      = 5.250 bar   
ADC       3.10 V / (5 V / 4095)                    = code 2539   
span      codes 819 (4 mA) to 4095 (20 mA)         = 3276 codes  
step      10 bar / 3276                            = 0.00305 bar 

Scaled as if the range began at 0 mA, the same 12.40 mA would read 6.200 bar, 9.50 % of the span high. The error is not a constant offset: it is zero at full scale and largest at the bottom, where 4 mA would read 2.00 bar instead of 0. A scaling error that looks like a sensor fault at low pressure and disappears at high pressure is usually this.

Loop supply voltage and maximum cable length

The transmitter needs a minimum voltage across its own terminals to regulate the current, its compliance voltage. SLYT847 defines it: "Loop Compliance Voltage is the range of the loop voltage at which the transmitter is functioning. It is mainly determined by LDO limits and affected by series elements within the loop, including protection devices. The typical loop compliance voltage range is 12V to 36V." Everything else in the loop drops I × R at the loop current, so the supply must cover VS ≥ VTX(min) + Imax(Rsense + Rwire + Rother). That inequality is Kirchhoff's voltage law, not a formula from either TI document. It has to hold at the largest current the loop carries, because that is where the drops are largest; at 4 mA the transmitter has more voltage than it needs.

The calculator's default loop is SLYT847's 24 V field supply, a transmitter needing 12 V, 250 Ω and 500 m of AWG 22 pair. The cable is two conductors, 51.6 Ω in all, and the budget at 20 mA is 12 V for the transmitter, 5.00 V across the sense resistor and 1.03 V in the cable: a minimum supply of 18.0 V and 5.97 V to spare. Solved for resistance, the 24 V supply allows (24 V − 12 V)/20 mA = 600 Ω of loop, of which the sense resistor takes 250 Ω. The rest is cable. The longest one-way run for each gauge, with the same 24 V and 12 V:

AWGΩ per km, one conductor250 Ω, 20 mA250 Ω, 24 mA2 × 250 Ω, 20 mA
1612.8 Ω13.6 km9.74 km3.89 km
1820.4 Ω8.57 km6.12 km2.45 km
2032.5 Ω5.39 km3.85 km1.54 km
2251.6 Ω3.39 km2.42 km969 m
2482.1 Ω2.13 km1.52 km609 m
26130 Ω1.34 km958 m383 m

The middle column budgets for a transmitter that can drive 24 mA, the top of the "0-24mA Loop" label on SLYT847's DAC161S997 schematic: the allowed loop resistance falls to 500 Ω. The last column adds a second 250 Ω receiver in series, a local indicator for instance, which leaves 100 Ω for the cable instead of 350 Ω. On a 24 V supply this loop is limited less by the cable than by what else is in series. At an 18 V supply the AWG 22 run shrinks from 3.39 km to 484 m.

The compliance figure is the transmitter's own, and protection moves it. SLYT847 on the protection section: "These protection elements require some headroom during operation, and increase the minimum compliance voltage." A 1 km run of AWG 22 with 250 Ω at 20 mA needs 19.1 V; a transmitter whose protection adds a couple of volts to its minimum turns a comfortable loop into a marginal one. The table's lengths are at 20 °C: warm copper at 60 °C has 15.7 % more resistance, and the AWG 22 run shrinks to 2.93 km.

Where this model stops being valid

The transmitter is an ideal current source above its minimum voltage. Below VTX(min) it cannot hold the current, and a loop that is short of supply does not fail cleanly: it reads correctly at low values and then stops rising, because the transmitter runs out of voltage only as the current climbs. A reading that tops out below full scale is the symptom. The calculator's budget is at Imax for that reason.

The transmitter's own consumption is below the zero.The scaling assumes the loop current is only what the transmitter sets. That holds while the electronics draw less than the zero-scale current, which is SLAA866's design note 2. SLYT847's implementations draw 130 µA to 440 µA, a fraction of 4 mA; a design that draws more cannot reach the bottom of its range.

The receiver is ideal. The sense resistor has its nominal value and the ADC has no offset, gain or linearity error. A 0.1 % resistor is a 0.1 % gain error on every reading, and its temperature coefficient adds to it; thecurrent sense resistor calculator works through tolerance, TCR and lead resistance. At 250 Ω the lead resistance matters far less than at a milliohm shunt, but the tolerance does not shrink.

One series loop, DC. The model has no leakage: every load carries the same current. A receiver input referenced to a different ground, a damaged cable leaking to earth or a second receiver wired in parallel rather than in series all break that. It is also a DC model; a HART-enabled transmitter adds a signal on top of the loop current, and SLYT847 notes that "reducing the bandwidth with external components helps prevent interference with the HART signal."

Copper at one temperature. Cable resistance is computed from the AWG definition at 20 °C, as on thewire gauge calculator. Stranded cable is a little higher, and cable in the sun is warmer.

Common 4–20 mA mistakes

Further reading