May 28, 2026

4-20 mA Signal Conversion: Mathematical Principles and Practical Calculations

Converting 4-20 mA analog signals to meaningful engineering units is one of the most fundamental tasks in PLC programming and industrial automation. While the concept is straightforward, mastering the mathematical principles and understanding the various calculation methods is essential for accurate process control and reliable system operation. This article explores the mathematical foundations of 4-20 mA signal conversion and provides practical calculation methods used in real-world industrial applications.

Basic Linear Conversion Formula

4-20 mA Signal Conversion Formula on Whiteboard
Figure 1: Technical Diagram Showing 4-20 mA Signal Conversion Formula and Mathematical Examples
Signal Conversion Process
Figure 2: 4-20 mA to Engineering Units Conversion Steps
The most common 4-20 mA signal conversion uses a linear relationship between current and the measured parameter. The fundamental formula for converting current to engineering units is:
Engineering Value = (Current - 4) / 16 × (Maximum Value - Minimum Value) + Minimum Value
Where:
Current = the measured current in milliamps (4-20 mA)
Minimum Value = the engineering unit value at 4 mA
Maximum Value = the engineering unit value at 20 mA
This formula works because the 4-20 mA range spans 16 mA (20 - 4 = 16), which represents the full scale of the signal. By subtracting 4 from the current value, we normalize the signal to a 0-16 mA range. Dividing by 16 gives us a percentage (0-1), which we then scale to the engineering unit range.

Practical Example: Temperature Measurement

Consider a temperature transmitter with a range of 0°C to 100°C. At 0°C, the transmitter outputs 4 mA, and at 100°C, it outputs 20 mA. If the PLC reads 12 mA from the transmitter, what is the actual temperature?
Using the formula:
Temperature = (12 - 4) / 16 × (100 - 0) + 0
Temperature = 8 / 16 × 100 + 0
Temperature = 0.5 × 100 + 0
Temperature = 50°C
This calculation shows that 12 mA corresponds to exactly 50% of the full scale, which equals 50°C.

Pressure Measurement with Negative Values

The 4-20 mA conversion becomes more complex when the minimum engineering value is negative. Consider a pressure transmitter measuring differential pressure from -50 PSI to +50 PSI. At -50 PSI, the output is 4 mA, and at +50 PSI, the output is 20 mA.
If the PLC reads 8 mA, the pressure is:
Pressure = (8 - 4) / 16 × (50 - (-50)) + (-50)
Pressure = 4 / 16 × 100 + (-50)
Pressure = 0.25 × 100 - 50
Pressure = 25 - 50
Pressure = -25 PSI
The calculation correctly handles negative values by including them in the formula. The key is ensuring that the minimum and maximum values are correctly identified and applied.

Reverse Calculation: Converting Engineering Units to Current

Sometimes, engineers need to determine what current value corresponds to a specific engineering unit value. This reverse calculation is useful when testing transmitters or setting alarm thresholds. The reverse formula is:
Current = (Engineering Value - Minimum Value) / (Maximum Value - Minimum Value) × 16 + 4
For example, if a temperature transmitter has a range of 0°C to 100°C, and we want to know what current corresponds to 75°C:
Current = (75 - 0) / (100 - 0) × 16 + 4
Current = 0.75 × 16 + 4
Current = 12 + 4
Current = 16 mA
This calculation shows that 75°C corresponds to 16 mA, which is 75% of the full scale.

Voltage-Based Conversion

Many PLC analog input modules convert the 4-20 mA signal to voltage before digitization. A standard 250-ohm resistor is commonly used in the input circuit, creating a 1-5 volt range (4 mA × 250 Ω = 1 V; 20 mA × 250 Ω = 5 V).
When working with voltage measurements, the conversion formula becomes:
Engineering Value = (Voltage - 1) / 4 × (Maximum Value - Minimum Value) + Minimum Value
Where the voltage ranges from 1 to 5 volts. If a PLC reads 3 volts from a temperature transmitter with a 0-100°C range:
Temperature = (3 - 1) / 4 × (100 - 0) + 0
Temperature = 2 / 4 × 100 + 0
Temperature = 0.5 × 100 + 0
Temperature = 50°C

Digital Count Conversion

Modern PLCs convert analog signals to digital counts using analog-to-digital converters (ADCs). A 12-bit ADC produces values from 0 to 4095 counts. However, the actual usable range for 4-20 mA signals is typically 819-4095 counts (corresponding to 4-20 mA).
The conversion formula for digital counts is:
Engineering Value = (Count - 819) / 3276 × (Maximum Value - Minimum Value) + Minimum Value
Where 3276 represents the span of usable counts (4095 - 819 = 3276).
If a 12-bit ADC reads 2457 counts for a temperature transmitter with a 0-100°C range:
Temperature = (2457 - 819) / 3276 × (100 - 0) + 0
Temperature = 1638 / 3276 × 100 + 0
Temperature = 0.5 × 100 + 0
Temperature = 50°C

Handling Non-Linear Transmitters

While most 4-20 mA transmitters are linear, some specialized transmitters use non-linear output curves. For example, certain flow meters use square root relationships to provide better resolution at lower flow rates. These require custom conversion functions rather than simple linear formulas.
Non-linear conversions typically involve lookup tables or polynomial equations. A lookup table approach stores discrete calibration points and interpolates between them. A polynomial approach uses mathematical functions to calculate the engineering value directly from the current or voltage input.

Scaling and Offset Calculations

In practice, PLC programmers often use scaling and offset parameters to simplify calculations. The general form is:
Engineering Value = (Raw Input - Offset) × Scale
For a 4-20 mA signal with 0-100°C range, the offset would be 4 (the minimum current), and the scale would be 100/16 = 6.25 (the engineering unit range divided by the current range).
This approach allows programmers to enter calibration parameters once during system setup, and the PLC automatically applies them to all measurements.

Accuracy and Resolution Considerations

The accuracy of 4-20 mA conversions depends on several factors: transmitter accuracy, ADC resolution, and calculation precision. A typical industrial transmitter maintains ±0.5% accuracy, while a 12-bit ADC provides approximately ±0.025% resolution. The overall system accuracy is typically limited by the transmitter accuracy.
Resolution refers to the smallest change in engineering units that the system can detect. With a 12-bit ADC and a 0-100°C range, the resolution is approximately 0.024°C. This means the system can distinguish between values separated by about 0.024°C.

Common Calculation Errors

Several common mistakes can compromise 4-20 mA conversions. First, using incorrect minimum and maximum values leads to completely wrong results. Second, forgetting to subtract 4 from the current value produces calculations offset by 25%. Third, using voltage instead of current (or vice versa) without proper conversion factors introduces significant errors. Fourth, failing to account for negative engineering values causes sign errors in calculations.

Conclusion

Accurate 4-20 mA signal conversion is fundamental to reliable industrial automation systems. The linear conversion formula provides a straightforward method for most applications, while specialized techniques handle non-linear transmitters and digital systems. Understanding the mathematical principles, recognizing common errors, and applying appropriate calculation methods ensures that PLC systems accurately interpret sensor signals and maintain precise process control. Whether working with temperature, pressure, flow, or level measurements, mastering these calculation techniques is essential for automation professionals.

Key Takeaways

The basic conversion formula: (Current - 4) / 16 × (Max - Min) + Min
Reverse calculation determines current from engineering units
Voltage and digital count conversions use similar principles with different scaling factors
Non-linear transmitters require custom conversion functions
Accuracy depends on transmitter quality and ADC resolution
Common errors include wrong min/max values and unit confusion

May 26, 2026

4-20 mA Integration with PLC Analog Input Modules

Successfully integrating 4-20 mA sensors and transmitters with programmable logic controllers requires understanding both the hardware connections and the software configuration. PLC analog input modules serve as the interface between the analog 4-20 mA signal world and the digital PLC environment.

PLC Integration Architecture

4-20 mA Signal Path from Transmitter to PLC Processing

This article explores the practical aspects of hardware integration, module selection, configuration, and troubleshooting of 4-20 mA inputs in PLC systems.

PLC Analog Input Module Architecture

Siemens S7-1200 PLC with Analog Input Module
Siemens S7-1200 PLC with Analog Input Module and 4-20 mA Signal Connections

A typical PLC analog input module contains several key components: terminal blocks for signal connections, signal conditioning circuitry, analog-to-digital converters (ADCs), and communication interfaces. The signal conditioning stage includes the precision resistor (usually 250 ohms) that converts the 4-20 mA current to a 1-5 volt signal. This voltage is then amplified and filtered to remove noise before being converted to digital counts by the ADC.

Most modern PLC analog input modules use 12-bit or 16-bit ADCs. A 12-bit ADC produces values from 0 to 4095 counts, while a 16-bit ADC produces values from 0 to 65535 counts. The higher resolution of 16-bit modules provides better accuracy and finer resolution, making them preferable for applications requiring high precision.

Hardware Connection Considerations

Proper physical connection of 4-20 mA signals to PLC input modules is critical for reliable operation. Each analog input channel typically has three terminals: positive signal input, negative signal return (common), and shield ground. The 4-20 mA signal flows from the transmitter through the positive terminal, through the precision resistor in the input module, and returns through the common terminal.
The shield ground connection deserves special attention. The shielded cable used for 4-20 mA signals should have its shield connected to the shield ground terminal at the PLC module. This connection provides a return path for electromagnetic interference, significantly improving noise immunity. The shield should be connected at only one end—typically at the PLC module end—to prevent ground loops that can introduce noise into the signal.

Cable selection significantly impacts signal quality. Industrial-grade twisted-pair shielded cable is standard for 4-20 mA signals. The twisted pair geometry helps cancel electromagnetic interference, while the shield provides additional protection. Cable impedance should be less than 100 ohms per kilometer. For long cable runs (over 500 meters), low-impedance cable becomes increasingly important.

Transmitter Power Supply Considerations

4-20 mA transmitters require power to operate. Two-wire transmitters draw their power from the signal loop itself, while three-wire and four-wire transmitters have separate power connections. Understanding the transmitter power requirements is essential for proper system design.
Two-wire transmitters are the most economical, using only two wires for both power and signal. The loop power supply must provide sufficient voltage to overcome the voltage drops across the transmitter, cable, and input module resistor. A typical 24 VDC power supply is standard, providing adequate voltage for most installations. The power supply must also include current limiting to protect the circuit from short circuits.

Three-wire transmitters use one wire for power supply common, one for signal positive, and one for signal negative. Four-wire transmitters have completely separate power and signal circuits, providing the best performance but requiring more wiring. The choice between these configurations depends on application requirements, budget, and available infrastructure.

PLC Module Configuration

Configuring the PLC analog input module involves several steps. First, the module must be physically installed in the PLC chassis and properly seated to ensure good electrical contact. Second, the module must be recognized by the PLC system software and assigned to the appropriate I/O address space. Third, the module parameters must be configured to match the signal characteristics.

Key configuration parameters include the input range (typically 4-20 mA or 0-10 V), the number of active channels, the sampling rate, and the filter settings. The input range configuration tells the module how to scale the raw ADC counts to engineering units. Most modules allow selection between different standard ranges or custom ranges.

The sampling rate determines how frequently the module reads the analog input. Typical sampling rates range from 10 to 1000 samples per second. Higher sampling rates provide faster response but increase computational load. For most industrial applications, 100 samples per second provides adequate response while maintaining reasonable performance.

Filter settings reduce noise in the analog signal. Most modules offer selectable filters with different time constants. A first-order low-pass filter with a 100-millisecond time constant is typical for industrial applications. Faster filters provide better response but may not adequately suppress high-frequency noise. Slower filters provide better noise suppression but may cause lag in signal response.

Software Implementation in SCL

In Siemens TIA Portal using SCL, reading 4-20 mA analog inputs involves accessing the analog input data from the module and applying the appropriate conversion calculations. The PLC automatically converts the analog signal to digital counts, but the programmer must convert these counts to engineering units.
A typical SCL implementation looks like:
ORGANIZATION_BLOCK "AnalogInput"
VERSION : 0.1

VAR raw_count : INT; // Raw ADC count from module current_mA : REAL; // Calculated current in mA temperature : REAL; // Temperature in degrees C min_temp : REAL := 0.0; // Minimum temperature max_temp : REAL := 100.0; // Maximum temperature END_VAR; BEGIN // Read raw count from analog input module (channel 0) raw_count := INT(AI[0]); // Convert count to current (12-bit ADC: 819 counts = 4mA, 4095 = 20mA) current_mA := (raw_count - 819) / 3276 * 16 + 4; // Convert current to temperature temperature := (current_mA - 4) / 16 * (max_temp - min_temp) + min_temp;
END_ORGANIZATION_BLOCK

Calibration and Verification

After installation and configuration, the system must be calibrated to ensure accurate measurements. Calibration involves comparing the PLC reading with a known reference value and adjusting the conversion parameters if necessary.

A typical calibration procedure involves applying known current values to the input and recording the corresponding PLC readings. At minimum, calibrate at two points: 4 mA (0% of range) and 20 mA (100% of range). For higher accuracy, calibrate at three or more points across the measurement range.
If the readings don't match the expected values, the offset and scale parameters should be adjusted. Offset adjusts the zero point of the measurement, while scale adjusts the full-scale reading. Most PLC systems provide easy methods to adjust these parameters without modifying the core program logic.

Troubleshooting Common Issues

Several common problems can occur with 4-20 mA input integration. If the PLC reads a constant value regardless of transmitter output, the signal connection is likely broken or the module is not properly configured. If the reading fluctuates wildly, inadequate filtering or poor cable shielding is usually the cause.

If the reading is consistently offset from the expected value, calibration adjustment is needed. If the reading is scaled incorrectly (for example, showing double the expected value), the scaling parameter needs adjustment. If the reading occasionally drops to zero, a loose connection or intermittent break in the signal cable is likely.

Redundancy and Diagnostics

Modern PLC systems often include redundancy features for critical measurements. Dual analog input modules reading the same transmitter provide backup if one module fails. The PLC can compare the two readings and alert the operator if they diverge beyond a threshold, indicating a potential problem.
Diagnostic features in the analog input module can detect various fault conditions: open circuit (broken wire), short circuit, out-of-range signal, and module hardware failures. These diagnostics are typically reported through status registers that the PLC program can monitor.

Conclusion

Successful integration of 4-20 mA signals with PLC analog input modules requires attention to hardware connections, proper module configuration, accurate software implementation, and thorough testing. Understanding the signal path from transmitter through input module to PLC memory, combined with knowledge of configuration options and troubleshooting techniques, enables automation professionals to build reliable measurement systems. Whether implementing temperature monitoring, pressure control, or flow measurement, mastering these integration techniques is essential for effective industrial automation.

Key Takeaways

Analog input modules convert 4-20 mA signals to digital counts using precision resistors and ADCs
Proper cable selection and shielding significantly impact signal quality
Configuration parameters must match the transmitter and application requirements
SCL programs must convert raw counts to engineering units using appropriate formulas
Calibration at multiple points ensures accurate measurements
Diagnostic features help identify and troubleshoot connection and hardware problems