Industrial sensors · 4–20 mA · Arduino · ESP32 · ADS1115

4–20 mA Converter: Read a 4–20 mA Transmitter with Arduino & ESP32

A 4–20 mA converter turns loop current into a voltage your ADC can read. For most projects that converter is one precision resistor. The hard parts are choosing its value for your board, keeping the transmitter powered, catching a broken wire, and making sure a wiring fault can’t put 24 V on a 3.3 V pin.

Ramanu Systems · Pune, India · 3-minute answer, full engineering notes below

Quick answer

Put a burden resistor between the loop’s return wire and GND, and read the voltage across it: V = I × R. Size it so 22 mA still fits the ADC: about 220 Ω on an Arduino Uno, 107 Ω on a classic ESP32, 90.9 Ω on an ADS1115 at ±2.048 V. Treat anything below 3.6 mA or above 21 mA as a fault, not a reading.

SymptomReads 0, saturates, or the transmitter cuts out
Likely causeWrong burden, wrong wiring or not enough loop voltage
FixRight burden, low-side wiring, PTC + clamp, fault checks
Calculate my burden ↓ Show me the wiring Converter options

Is this your problem?

If any of these match your 4–20 mA sensor setup, read on:

  • The ADC reads 0 with the transmitter connected
  • Readings stop rising near full scale
  • The value jumps or drops when the pressure is high
  • The transmitter’s display flickers or resets
  • You can’t tell a broken wire from a real zero
  • An ESP32 or Arduino pin died after a wiring mistake

How a 4–20 mA loop works, in one picture

A 2-wire transmitter doesn’t output a voltage. It sits in series with a power supply and sets the current through the whole loop: 4 mA at the bottom of its range, 20 mA at the top. The same current flows through every part of the loop, so cable resistance doesn’t change the signal. You read it by passing the current through a known resistor and measuring the voltage across it.

Wiring diagram: 24 V loop supply through a PTC fuse to a 2-wire 4-20 mA transmitter, loop current through a 107 ohm burden resistor to ground, TVS clamp, 1 kilo-ohm series resistor and 100 nF capacitor to the ESP32 or Arduino ADC pin
Figure 1. Low-side burden: the loop returns through the burden to GND, so the ADC measures a ground-referenced voltage. The PTC, TVS and 1 kΩ keep a wiring fault away from the pin.
Why 4 mA and not 0? The “live zero” is the point of the standard. 4 mA means “bottom of the range”, while 0 mA means the loop is broken or unpowered. The transmitter also runs on that 4 mA, which is why only two wires are needed.

Calculate your burden resistor

Pick your board and your transmitter’s range. The calculator picks a standard burden value with room to detect faults, checks that the transmitter still gets enough voltage at 20 mA, and shows what happens if the loop shorts. Drag the current slider to see the reading at any loop current.

4–20 mA calculator

Burden resistor–
Pin at 4 mA–
Pin at 20 mA–
Supply margin–

ADC pin

0 V–

–

–

–

Fault thresholds (NAMUR NE43): below 3.6 mA / above 21 mA–
ADC reading at 4 mA / 20 mA–
Resolution (one ADC step)–
Current where the ADC saturates–
Voltage left for the transmitter at 20 mA–
Burden power at 20 mA–
If the transmitter shorts: burden current / power–

Code for your board

Burden values are E96 (1%); use 0.1% for best accuracy. Board limits from the Microchip, Espressif, Raspberry Pi and TI datasheets; fault thresholds from NAMUR NE43.

The 2-minute test: is it the transmitter or the ADC side?

Before you blame the sensor, test the burden and code with a fake loop. Disconnect the transmitter and its supply, then connect two AA cells in series with a 150 Ω resistor from the top of the burden to GND (cell + to the resistor, cell − to GND). With a 107 Ω burden that pushes about 11–12 mA, a known, quiet current. Check it with a multimeter in its mA range. If your code reads the same current, the ADC side is right and the problem is in the loop or the transmitter.

// Print loop current once a second (ESP32, ADC1 pin 34, 107 ohm burden)
void loop() {
  uint32_t mv = 0;
  for (int i = 0; i < 32; i++) mv += analogReadMilliVolts(34);
  float mA = (mv / 32.0) / 107.0;
  Serial.printf("%.2f mA\n", mA);
  delay(1000);
}

Wire it right in 3 steps

  1. Put the burden on the low sideLoop supply + to the transmitter's + terminal. Transmitter − to the top of the burden. Bottom of the burden to GND, and the loop supply's − to the same GND. The ADC reads the top of the burden through a 1 kΩ resistor with 100 nF to GND at the pin.
  2. Check the voltage budgetThe supply must cover the transmitter's minimum voltage plus the drop across the burden and cable at 20 mA: Vsupply ≥ Vmin + 0.02 A × (Rburden + Rcable). Most 2-wire transmitters need around 8 to 12 V; check yours. A 24 V supply usually leaves plenty of margin.
  3. Protect the pin and detect faultsAdd a PTC fuse in the loop and a TVS across the burden, and keep the 1 kΩ in series with the pin. In code, flag anything below 3.6 mA (broken wire, no power, sensor fault) or above 21 mA (short or sensor fault) instead of showing it as a value.
The 24 V trap If the transmitter or its cable shorts, the transmitter no longer limits the current and the full loop supply appears across the burden. That is 24 V on the node your ADC pin is connected to, and around 220 mA through a 107 Ω resistor. Without a PTC and a clamp, the resistor overheats and the 3.3 V pin is destroyed. Never connect the burden node straight to the pin.

2-wire, 3-wire or 4-wire?

Transmitter typeHow it's poweredHow to wire the burden
2-wire (loop-powered)From the loop itselfSupply + → TX+, TX− → burden → GND (Figure 1)
3-wireSeparate + and common GNDSignal output → burden → GND (shared with supply −)
4-wireSeparate supply (often mains)Output + → burden → output − tied to your GND. Isolated output is best

Which board are you using?

Board / ADCBurden (E96)4 mA → 20 mA on the pinNotes
Arduino Uno / Nano (5 V ref)221 Ω0.88 → 4.42 VLeaves room to see faults up to about 22 mA
Arduino, 3.3 V on AREF / Pi Pico147 Ω0.59 → 2.94 VPico ADC pins are not 5 V tolerant
ESP32 (classic)107 Ω0.43 → 2.14 VStays inside the 0.15–2.45 V accurate range; use ADC1 pins
ESP32-S3137 Ω0.55 → 2.74 V0–3.1 V range at 12 dB
ADS1115, ±2.048 V90.9 Ω0.36 → 1.82 VFinest resolution: under 1 µA per step

The common 250 Ω value gives 1 to 5 V. That suits a 5 V Arduino only if you don't need to see over-range faults, and it will damage a 3.3 V board at 20 mA.

4–20 mA converter options

OptionGood forWatch out for
Burden resistor onlyCheapest; bench tests, one sensor, short cableNo protection; a short can kill the pin. Add PTC, TVS and series resistor yourself
Ready-made 4–20 mA to voltage moduleQuick prototypes; jumper-selected output rangesUsually one channel; check the input protection, the output range against your ADC, and whether it needs its own supply
Burden + ADS1115High resolution, several channels over I²CKeep inputs below VDD + 0.3 V; still needs protection
Isolated converter (DIN rail)Long cables, noisy plants, sensors on different groundsCostly and bulky, but the only cure for ground loops
Protected analog front-end (Ramanu, coming soon)Up to 4 channels of 4–20 mA, 0–10 V or 0–5 V into ESP32, Arduino or ADS1115Not isolated; for isolation use a DIN-rail converter

Coming soon from Ramanu

4-channel protected 4–20 mA & 0–10 V input for ESP32 / Arduino

Everything on this page, on one board: precision burden, protection and a clean 0–2.0 V output your ADC can read.

  • 4–20 mA per channel: 0.1% 165 Ω burden with a PTC fuse, enabled by solder jumper
  • Or voltage inputs: 0–3.3 V, 0–6 V, 0–10 V by jumper
  • 24 V-rated TVS on every input; output can never exceed 3.3 V
  • 4 mA = 0.4 V, 20 mA = 2.0 V: open-loop detection works even on a classic ESP32
  • Selectable 5 Hz / 100 Hz / 1 kHz filter, genuine TI op-amps, made in Pune

Still reading wrong? Other common causes

CauseWhat you noticeFix
No ground connection between loop supply and boardRandom or floating readingsConnect the supply − to the board GND (low-side burden)
Loop supply too lowFine at low pressure, drops or flickers near full scaleRaise the supply, or lower the burden; check the calculator's supply margin
Transmitter wired backwardsAlways 0 mASwap the + and − wires at the transmitter
Burden on the high sideThe ADC sees close to 24 VMove the burden to the return leg, between TX− and GND
Ground loop between two earthed pointsOffset that changes when machines switch onUse one earth point, or an isolated converter
Noisy ADC referenceSteady current but jumpy readingsSee our analogRead fluctuating guide
That's the practical answer.Engineers who want the numbers, read on.

For engineers: 4–20 mA in numbers

1. Ranges and fault signalling (NAMUR NE43)

Loop currentMeaning
Below 3.6 mAFailure (low): open loop, no power, sensor fault
3.6 to 3.8 mAUnder-range, measurement still valid
3.8 to 20.5 mAMeasurement range
20.5 to 21 mAOver-range
Above 21 mAFailure (high)

To see a high fault you need ADC headroom above 21 mA, which is why the calculator sizes the burden for 22 mA rather than 20 mA.

2. Burden choice: resolution versus loop voltage

A larger burden gives more volts per milliamp, so better resolution and a low-fault level further above the ADC's floor. It also costs loop voltage: at 20 mA every 100 Ω drops 2 V that the transmitter no longer gets. The burden's tolerance is a direct gain error: a 1% resistor reads up to 1% off, a 0.1% resistor 0.1%. Its temperature coefficient matters in hot enclosures, so choose 25 ppm/°C or better for precision.

3. Resolution at the input

One ADC step in milliamps is LSB / R. A classic ESP32 at about 0.8 mV per step with 107 Ω resolves about 7.5 µA, roughly 1/2100 of the 16 mA span, but its ±60 mV total error (Espressif datasheet) means about ±0.56 mA before calibration. An ADS1115 at ±2.048 V with 90.9 Ω resolves 0.7 µA. Calibrate at 4 and 20 mA for real accuracy.

4. HART and isolation

HART devices superimpose a digital signal on the loop and need at least about 230 Ω of loop resistance to work. A plain analog reading doesn't. If the transmitter and your board are earthed at different points, the ground difference adds directly to the burden voltage; only galvanic isolation removes that.

What a burden resistor won't fix It won't isolate you from ground loops, it won't make a transmitter more accurate than its datasheet, and it won't protect anything by itself. Long runs near motors and VFDs also need twisted-pair, shielded cable with the shield earthed at one end.

Frequently asked questions

What is a 4–20 mA converter?

A circuit that turns a 4–20 mA loop current into a voltage an ADC can read. The simplest version is a single precision resistor (the burden): V = I × R. Ready-made modules add protection, scaling and sometimes isolation.

What resistor converts 4–20 mA to 0–5 V or 0–3.3 V?

250 Ω gives 1–5 V and 165 Ω gives 0.66–3.3 V. To keep room for fault detection above 21 mA, use about 221 Ω on a 5 V Arduino, 147 Ω on a 3.3 V ADC and 107 Ω on a classic ESP32.

Can an ESP32 read a 4–20 mA sensor?

Yes, with a burden resistor of about 107 Ω to GND, which keeps 4–20 mA inside the ESP32's accurate 0.15–2.45 V range. Use an ADC1 pin, analogReadMilliVolts(), a 1 kΩ series resistor with 100 nF at the pin, and a PTC and TVS on the loop.

How do I wire a 2-wire 4–20 mA transmitter to an Arduino?

Connect the loop supply + to the transmitter +, the transmitter − to a 221 Ω burden resistor, and the other end of the burden to GND. Connect the supply − to the Arduino GND, and read the top of the burden with an analog pin through 1 kΩ.

Why does 4–20 mA start at 4 mA?

So that a broken wire (0 mA) can be told apart from the bottom of the range (4 mA), and so a 2-wire transmitter has current to run on. Readings below 3.6 mA are treated as a fault.

How do I detect a broken wire on a 4–20 mA loop?

Check the current in code: below 3.6 mA means open loop, lost power or a sensor fault; above 21 mA means a short or sensor fault (NAMUR NE43). Make sure your burden leaves the 3.6 mA level above the ADC's floor and 21 mA below its top.

Do I need an isolated 4–20 mA converter?

Not for one sensor on a short cable sharing your board's ground. Use isolation for long runs, noisy plants, several transmitters powered from different supplies, or any sensor earthed at a different point than your controller.

Read industrial sensors safely

Get the protected front-end when it launches

4 channels of 4–20 mA or 0–10 V into your ESP32, Arduino or ADS1115, without risking a pin. Genuine TI parts, made in India.

© Ramanu Systems · Precision electronics modules, Made in India · Fault thresholds from NAMUR NE43. Board limits from the Microchip ATmega328P, Espressif ESP32 and ESP-IDF, Raspberry Pi RP2040 and Texas Instruments ADS1115 documentation. HART loop resistance from the HART physical layer specification. Results are estimates; verify with your own measurement. Found an error? Tell us and we will fix it and credit you.

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top