PLCBytes
Converters & calculators

4–20 mA and Raw Value Scaling

Set the signal, raw and engineering ranges once, then type any of the three values and get the other two. Signals outside 4–20 mA are checked for faults.

Ranges

Example

Signal

Raw value

Engineering units

Convert

Type into any of the three fields; the other two follow.

Position in range
NAMUR NE 43

Formulas and check points

Raw → value
Signal → value
Value → raw
PointSignalRaw valueValue

Home Assistant (modbus sensor)

Add these lines to your sensor under modbus:. Set data_type to match the raw value, for example int16 when it can go negative (Siemens S7 below 4 mA).

Runs entirely in your browser. Nothing you enter is sent to a server.

4–20 mA signal zones (NAMUR NE 43)

Transmitters that follow NAMUR NE 43 keep measurements within 3.8–20.5 mA and use 3.6 mA or less, or 21 mA or more, only to report a fault. Whether a transmitter goes low or high on a fault is usually a setting.

SignalMeaning
≤ 3.6 mAFault signal (low): broken wire, no loop power or a transmitter fault
3.6 – 3.8 mAOutside the measuring range, not a defined signal
3.8 – 4 mAUnder range: valid measurement below 0 %
4 – 20 mANormal range, 0–100 %
20 – 20.5 mAOver range: valid measurement above 100 %
20.5 – 21 mAOutside the measuring range, not a defined signal
≥ 21 mAFault signal (high): the transmitter reports a fault

How the scaling works

An analog transmitter turns a measurement into a current or a voltage, the PLC or I/O module turns that signal into a raw number, and somewhere that number has to become bar, °C or m³/h again. All three steps are straight lines, so two points are enough: the minimum and maximum of each range. A 0–10 bar transmitter on a Siemens S7 input gives 4 mA = 0 = 0 bar and 20 mA = 27648 = 10 bar; 12 mA is halfway, raw 13824, 5 bar.

The calculator works in every direction. Type the raw value read over Modbus to get the reading, type a reading to see which current a loop calibrator should send, or check what the PLC should show at 25 % steps. The formula section gives slope and offset ready for an HMI, a SCADA system or Home Assistant.

Why 4–20 mA and not 0–20 mA

With a live zero, 0 % is 4 mA, so a current near 0 mA can only mean a fault: a broken wire, a blown fuse or missing supply. With 0–20 mA or 0–10 V, a broken wire looks exactly like a real zero. NAMUR NE 43 adds clear limits: at 3.6 mA or less, or 21 mA or more, the transmitter is reporting a fault, not a value.

Common mistakes

Questions from practice

How do I convert 4–20 mA to engineering units?

value = (mA − 4) ÷ 16 × (max − min) + min. For a 0–10 bar transmitter at 12 mA: (12 − 4) ÷ 16 × 10 = 5 bar. The calculator does this in every direction and also gives the raw value of your PLC input.

What raw value does a Siemens S7 give for 4–20 mA?

4 mA is 0 and 20 mA is 27648, so 12 mA is 13824. Values up to 32511 (about 22.8 mA) are overrange; 32767 means overflow, or a wire break when the module diagnostics are on. Below 4 mA the value turns negative, so read it as Int16.

What current means a broken wire?

In a 4–20 mA loop a broken wire gives 0 mA. NAMUR NE 43 treats 3.6 mA or less as a fault signal, and 21 mA or more as well. Between 3.6 and 3.8 mA and between 20.5 and 21 mA the signal is outside the measuring range and worth checking.

How do I enter the scaling in Home Assistant?

The modbus integration calculates output = scale × value + offset from the raw register. Copy the generated scale, offset and precision into your sensor. Do not leave out precision: it defaults to 0, so Home Assistant would round 5.23 bar to 5.

Does it work for 0–10 V and other ranges?

Yes. Choose 0–10 V, 1–5 V or 2–10 V, or type any minimum and maximum, including inverted ranges such as 100–0 % for a level measured from the top. The fault check applies only to 4–20 mA, because a 0–10 V signal cannot tell a broken wire from a real zero.

Related tools