Analog Scaling: Converting 4–20 mA Signals Into Real-World Values
- PLC Play Ground
- 0
- Posted on
Many industrial sensors output a 4–20 mA signal, but your PLC can’t use that directly — it needs to convert the raw current into real-world units like °C, bar, or millimeters.
This conversion process is called analog scaling, and getting it right is essential for accurate alarms, trends, and control logic.
How Analog Scaling Works
A typical PLC receives a 4–20 mA signal and maps it to the engineering range of the sensor.
Example (pseudocode):
raw = AI0 // 4–20 mA input
scaled = SCALE(raw, 4, 20, 0, 100) // maps to 0–100°C
This maps the minimum and maximum current values to the sensor’s minimum and maximum measurement values.
Quick Safety & Troubleshooting Tip
If your analog reading is stuck at exactly 4 mA or 20 mA, check for:
- loose or broken wiring
- a failed sensor
- a process hitting the measurement limit (e.g., tank completely empty or full)
These extreme values often indicate more than just a process change.
1-Minute Practice Problem (Solved)
Let’s scale a 0–250 bar pressure sensor that outputs 4–20 mA.
Sensor Range:
- 0 bar (minimum)
- 250 bar (maximum)
Signal Range:
- 4 mA (minimum)
- 20 mA (maximum)
Mapping Table
| PLC Input (mA) | Real Value (bar) |
|---|---|
| 4 mA | 0 bar |
| 20 mA | 250 bar |
Scaling Formula
The basic scaling formula is:
scaled = (raw_mA - 4) * (250 / 16)
Why 16 mA?
Because the usable current span is:
20 mA – 4 mA = 16 mA
Example: PLC Reads 12 mA
Let’s calculate:
scaled = (12 - 4) * (250 / 16)
scaled = 8 * 15.625
scaled = 125 bar
Result:
A 12 mA signal corresponds to 125 bar, which makes sense — it is exactly halfway between 0 and 250 bar.
