PLC Simulator
Free tool

4–20 mA Scaling Calculator

Convert milliamps to engineering units, raw ADC counts to pressure or temperature, or reverse any of those — with a live formula and a copyable result.

4–20 mA Scaling Calculator

All calculations are client-side. Nothing is sent to a server.

Direction

mA
mA

Formula

EU = 0 + (mA − 4) / 16 × (100 − 0)

Engineering Units

50.000

Worked example

Pressure transmitter: 0–100 bar, 12 mA signal

A pressure transmitter ranges 0–100 bar and outputs 4–20 mA. If the PLC reads 12 mA, what is the actual pressure?

4 mA12 mA20 mA0 bar50 bar100 barEU = 0 + (12 − 4) / 16 × 100 = 50
Analog input loop a 4-20 mA scaling calculation runs on: transmitter, analog input card, scaled engineering unitsA 4 to 20 milliamp analog signal from a sensor, read by the analog input card and scaled linearly into engineering units such as degrees Celsius.sensor4-20mAAI cardADC62.5deg C (scaled)10004mA20mAlinear scaling
The full analog signal chain — transmitter to 4-20 mA loop to scaled engineering units in the PLC.

Step-by-step

  1. 1. Span = EU_max − EU_min = 100 − 0 = 100 bar
  2. 2. Current span = mA_max − mA_min = 20 − 4 = 16 mA
  3. 3. Normalised = (12 − 4) / 16 = 0.5
  4. 4. EU = 0 + 0.5 × 100 = 50 bar

Background

What is 4–20 mA and why does scaling matter?

The 4–20 mA current loop is the dominant analogue signal standard in industrial process control. A transmitter (pressure, temperature, flow, level) converts a physical measurement to a proportional current: 4 mA represents the minimum of the measurement range, 20 mA represents the maximum. The 4 mA “live zero” is the feature that makes the standard so robust — a broken wire reads 0 mA, which is unambiguously different from a genuine minimum measurement.

Inside the PLC, the analogue input module converts the 4–20 mA signal to a raw integer via an analogue-to-digital converter (ADC). A 12-bit card produces values from 0 to 4095; a 16-bit card produces 0 to 65535. Your ladder logic or structured text program then scales that integer to an engineering unit (bar, °C, m³/h) using the linear interpolation formula the calculator above implements in real time.

Getting the scaling right matters in three ways: incorrect engineering-unit display misleads operators; incorrect PID setpoint comparison causes process upsets; incorrect alarm limits trigger nuisance trips or, worse, miss real faults. The formula is straightforward but there are two gotchas that catch beginners — using the raw ADC span instead of the mA span, and forgetting to handle the live-zero offset (subtracting 4 before dividing by 16, not dividing by 20).

The general formula

For mA to engineering units: EU = EU_min + (mA − 4) / 16 × (EU_max − EU_min).
For raw ADC counts to engineering units: EU = EU_min + (raw − raw_min) / (raw_max − raw_min) × (EU_max − EU_min).
In IEC 61131-3 Structured Text: EU := EU_min + (REAL(raw) - raw_min) / (raw_max - raw_min) * (EU_max - EU_min);

Fault detection with the live zero

Because 4 mA is the minimum valid signal, most PLCs support configuring analogue input alarms at 3.6 mA (wire break / sensor loss) and 21 mA (over-range / transmitter saturation). When you configure these limits, the PLC sets a status bit you can use in your ladder program to inhibit PID control or trigger an operator alarm before a scaling error propagates into the process.

Where to practise

The simulator’s analogue scenarios — including the 4-20 mA Process Control and Pump Pressure scenarios — require you to write the scaling ladder rung as part of the program. The auto-grader tests both the scaled output value and the fault-detection coil. If the formula above makes sense on paper but breaks down when you implement it, the grader will tell you exactly which test case failed and what it expected.

Loop wiring a 4-20 mA transmitter terminates to a PLC analog input card before scalingA PLC terminal strip wiring view: a switch wired to an input terminal and a lamp wired to an output terminal, with numbered terminals.TERMINAL STRIP0VI0I124VO0O1switchlampfield wiring to numbered terminals
Wiring the loop to the analog input card — before any scaling happens.
Discrete I/O contrasted with the analog 4-20 mA signal the scaling calculator convertsA digital input pushbutton wired to a PLC input card, and a PLC output card driving a lamp, with a sinking versus sourcing hint.I/O CARDINPUTOUTPUTPushbuttonI:0/0LampO:0/0sinking (NPN) vs sourcing (PNP)
Discrete vs analog — scaling only applies to the analog signals.
Modbus link that carries 4-20 mA scaled values as register data to an HMI or SCADAA Modbus master polling three slave devices over a shared serial or TCP link, reading and writing their holding registers and coils.MASTERpolls slavesModbus RTU / TCPID 01regs/coilsID 02regs/coilsID 03regs/coilsrequest / response polling
Once scaled, the value travels to HMI/SCADA over Modbus or EtherNet/IP.
PLC scan cycle that reads and scales the 4-20 mA analog input every scanThe repeating PLC scan cycle: read inputs, execute the ladder logic, update outputs, then housekeeping, looping continuously.1Read Inputs2Execute Logic3Update Outputs4HousekeepingSCANCYCLE
The scan loop reads and scales the analog input on every cycle.

Now practise it in a real scenario

The 4-20 mA formula makes sense on paper. The grader will tell you if your ladder rung actually implements it correctly.

4-20mA FAQ

Common questions about 4-20mA scaling.

The linear interpolation formula is: EU = EU_min + (mA − 4) / 16 × (EU_max − EU_min). For raw ADC counts: EU = EU_min + (raw − raw_min) / (raw_max − raw_min) × (EU_max − EU_min). The calculator above applies both directions in real time.