You are offline. The tools work from the copy saved in this browser; pages you have not opened yet need a connection.
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
ExampleSignal
Raw value
Engineering units
Convert
Type into any of the three fields; the other two follow.
| Position in range | |
|---|---|
| NAMUR NE 43 | |
| Nearest whole raw value |
Formulas and check points
| Raw → value | |
|---|---|
| Signal → value | |
| Value → raw |
| Point | Signal | Raw value | Value |
|---|
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.
| Signal | Meaning |
|---|---|
| ≤ 3.6 mA | Fault signal (low): broken wire, no loop power or a transmitter fault |
| 3.6 – 3.8 mA | Outside the measuring range, not a defined signal |
| 3.8 – 4 mA | Under range: valid measurement below 0 % |
| 4 – 20 mA | Normal range, 0–100 % |
| 20 – 20.5 mA | Over range: valid measurement above 100 % |
| 20.5 – 21 mA | Outside the measuring range, not a defined signal |
| ≥ 21 mA | Fault 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
- Wrong raw range. Siemens S7 maps the nominal range to 0–27648, not 0–32767. Other modules use 0–4095, 0–10000 or report µA directly (4000–20000). The module manual says which.
- Raw value read with the wrong type. Below 4 mA an S7 reports negative numbers. Read as UInt16, −691 becomes 64845 and the value jumps to the top of the range. Use Int16; the register decoder shows both.
- Range set twice. If the transmitter is set to 0–10 bar but the PLC scales to 0–16 bar, every value is off by the same factor. The range must match on both sides.
- An integer register is not an analog range. Many Modbus transmitters send 523 for 5.23 bar. That is a fixed scale factor; the register decoder finds it with “Find my value”.
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
- IEEE 754 ConverterFloat32 and Float64 to hex and back, bit by bit, with registers for every byte order.
- CRC-8 / CRC-16 / CRC-32 CalculatorAny CRC from 3 to 82 bits: 113 named algorithms, your own parameters, and finding which CRC a device uses.
- S5TIME / DT / DTL ConverterSiemens S7 time formats: S5TIME, TIME, DATE, TOD, DATE_AND_TIME and DTL to raw hex and Modbus registers and back.
- P1 Telegram Decoder (DSMR)Decode a smart meter P1 telegram (DSMR, Belgian e-MUCS): OBIS codes, CRC check, power per phase, gas and water.
- Pt100 / Pt1000 CalculatorResistance to temperature and back per IEC 60751, with 2-wire lead error and tolerance classes.
- Thermocouple CalculatormV to °C and back for types K, J, T, E, N, R, S and B, with cold junction compensation.
- Register DecoderFloat32, Int32, UInt16 and bits in every byte order, plus Find my value.
- Address Converter40001 ↔ offset 0, 4x/3x/0x/1x notation, 5- and 6-digit addresses.
- Value EncoderTurn a value like 230.5 into registers for every byte order.
- CRC-16 CalculatorModbus RTU checksum in wire order, plus a full frame check.
- Frame DecoderRead RTU and TCP frames from Wireshark or a serial log.
- Request GeneratorRead and write requests in RTU, TCP and ASCII, plus a check of the reply.
- Frame ConverterThe same Modbus frame as RTU, TCP and ASCII, with CRC, header and LRC recalculated.
- Function & Exception CodesWhat each code means and the usual cause in practice.
- Status Word DecoderName each bit of a 16- or 32-bit status register.
- Modbus RTU Timing CalculatorCharacter time, t1.5 and t3.5, frame length, shortest timeout and how many reads per second fit on the line.
- Register mapsReady-made register maps for meters, inverters and batteries.