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.
Read a loop current as a value, find the current for a value, or work back from the voltage across the sense resistor. The fourth mode designs the transmitter end: TI SLAA866's DAC, op amp and transistor circuit that sets the loop current.
The value the transmitter reports as 4 mA: the bottom of its calibrated range. The default 0–10 bar range is illustrative. For a reversed range, where 20 mA means the low end, enter the larger value here.
The value the transmitter reports as 20 mA: the top of its calibrated range. It may be below the 4 mA value, for a reversed range.
Only a label for the results and the figure; the scaling is the same straight line whatever the unit.
The loop current measured, in mA. Currents below 4 mA or above 20 mA are still scaled along the same line and are flagged as under- or over-range.
Resolution of the ADC that reads the sense voltage. 12 bits is illustrative. The page treats it as ideal: 1 LSB = FSR / (2ⁿ − 1), as in TI SLAA013.
The input voltage that gives the ADC's top code. At 5 V with 250 Ω, 20 mA lands exactly on the top code and anything above it clips.
The resistor the receiver measures the loop current across. 250 Ω turns 4–20 mA into 1–5 V; a lower value takes less of the loop voltage. It is in series with the loop, so it also appears in the loop budget below.
The DC supply that drives the loop. SLYT847's Figure 1 draws a 24 V field supply. Use the lowest it will ever be, after its tolerance.
The least voltage the transmitter needs across its own terminals to regulate the loop current: its minimum compliance, from its datasheet. SLYT847 gives the typical compliance range as 12 V to 36 V, and SLAA866's design goal is a 12 V–36 V loop supply.
The most the transmitter may have across its terminals, the top of its compliance range. At low loop current it sees nearly the whole supply. Enter 0 to leave the check out.
The gauge of the pair to the transmitter. The resistance is computed from the AWG definition and copper at 20 °C, as on the wire gauge calculator. AWG 22 is illustrative.
One-way cable length from the receiver to the transmitter. The loop current goes out on one conductor and back on the other, so the copper is twice this. 500 m is illustrative.
Anything else in series with the loop: a second receiver's sense resistor, a loop-powered display, a barrier, protection resistors. 0 if nothing.
The largest current the loop has to carry. 20 mA at full scale; higher if the transmitter can drive over-range or signal a fault above 20 mA. SLYT847's Figure 4 labels the DAC161S997 loop "0-24mA".
- 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
- 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.
- 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.
- 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.
- 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.
- 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).
- 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
- The transmitter is an ideal current source above its minimum voltage: the loop current does not depend on the supply or the loop resistance as long as the transmitter has at least V_TX(min) across it. Below that it cannot hold the current, and the loop reads low.
- The receiver is ideal: the sense resistor has its nominal value and the ADC has no offset, gain or linearity error. The current sense resistor and ADC resolution calculators take those errors on.
- Cable resistance is copper at 20 °C, solid conductor, from the AWG definition. Warm cable has more: copper gains about 0.39 % per kelvin.
- The loop is a single series circuit: no leakage to ground, and every load carries the same current. Anything else in series, a second receiver, a display, a barrier or protection resistors, goes in R_other.
- In transmitter mode, SLAA866's circuit with ideal parts: the op amp holds its inputs together and the transistor passes whatever the op amp asks. The errors are those of the resistor values alone, given as a share of the 16 mA span.
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 span | 100–0 %, reversed | 0–10 bar | −50 to 150 °C | V across 250 Ω | 12-bit code, 5 V |
|---|---|---|---|---|---|---|
| 4 mA | 0.00 % | 100 % | 0.00 bar | −50.0 °C | 1.00 V | 819 |
| 8 mA | 25.0 % | 75.0 % | 2.50 bar | 0.00 °C | 2.00 V | 1638 |
| 12 mA | 50.0 % | 50.0 % | 5.00 bar | 50.0 °C | 3.00 V | 2457 |
| 16 mA | 75.0 % | 25.0 % | 7.50 bar | 100 °C | 4.00 V | 3276 |
| 20 mA | 100 % | 0.00 % | 10.0 bar | 150 °C | 5.00 V | 4095 |
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 goalEvery 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 conductor | 250 Ω, 20 mA | 250 Ω, 24 mA | 2 × 250 Ω, 20 mA |
|---|---|---|---|---|
| 16 | 12.8 Ω | 13.6 km | 9.74 km | 3.89 km |
| 18 | 20.4 Ω | 8.57 km | 6.12 km | 2.45 km |
| 20 | 32.5 Ω | 5.39 km | 3.85 km | 1.54 km |
| 22 | 51.6 Ω | 3.39 km | 2.42 km | 969 m |
| 24 | 82.1 Ω | 2.13 km | 1.52 km | 609 m |
| 26 | 130 Ω | 1.34 km | 958 m | 383 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
- Scaling from 0 mA instead of 4 mA. The receiver example reads 6.200 bar instead of 5.250 bar; the error is largest at the bottom of the range and zero at the top, so it can pass a full-scale check.
- Forgetting the cable, or counting one conductor. The current goes out and back: 500 m of cable is 1 km of copper, 51.6 Ω of AWG 22.
- Taking the supply as the transmitter's voltage. The transmitter gets what is left after every I × R in the loop, at the largest current. On the default loop that is 18.0 V out of 24 V.
- Leaving fault currents out of the budget. A transmitter that signals a fault above 20 mA needs the loop to carry it; size at that current, not at 20 mA.
- Putting the ADC's full scale at exactly 20 mA. 250 Ω into a 5 V ADC cannot distinguish 20 mA from any higher current, so over-range and a high fault both read as full scale.
- Getting a reversed range backwards. If 4 mA means full, the value at 4 mA is the larger number; entering the range the usual way round turns 25 % into 75 %.
- Adding a second receiver in parallel. Loop loads go in series; a second 250 Ω in parallel halves the voltage at both and each reads half the current.
Further reading
- TI SLAA866, Analog Engineer's Circuit: Loop-Powered 4mA to 20mA Transmitter Circuit — the design goals, the transfer function and the five design steps worked in the transmitter example.
- TI SLYT847, Designing 4mA to 20mA loop-powered transmitters — the two-wire loop, the compliance voltage and the performance metrics, and six transmitter implementations compared by compliance, resolution, accuracy and current.
- Current sense resistor calculator — the sense resistor's tolerance, TCR and connection errors.
- ADC resolution calculator — the LSB, the static errors and the effective bits of the ADC that reads the sense voltage.
- Wire gauge calculator — the cable's resistance and voltage drop from the AWG definition.
- Pt100 calculator — resistance and temperature for the platinum sensor a temperature transmitter may be reading before it scales the result to 4–20 mA.