Convert from a raw analog input reading (0-5 v or 4-20ma) to an actual value.

The Formula (In 2 Parts)

% Of Range = (<Analog Reading> – <zero reading>) / (<max reading> – <zero reading>) * 100

Value = (<% Of Range> * (<Max Value> – <Min Value>)) + <Min Value>

  • <Analog Reading> is the current output reading from the device.
  • <Zero Reading> is the output that is given when the device is not reading anything. This is almost never 0, usually a 4-20mA device will read 4 for zero. A reading needs to be taken however to ensure that it is indeed dropping to 4 often it will settle just above or just below 4 (4.03).
  • <Max Reading> this is the reading when the device is on its maximum reading. For example a temperature sensor that reads from -40 to +60 you will need to find out what the max reading is at +60 (this can often be found on the calibration reports provided with the sensors).
  • <Min Value> The minimum value of the sensor. If a temperature sensor reads from -40C to +60C then the Min Value is -40.
  • <Max Value> The maximum value of the sensor.If a temperature sensor reads from -40C to +60C then the Max Value is 60.

Example

For a Temperature sensor from -40C to +60C range a value calculation would look like the following.

  • Reading at -40C = 4.07
  • Reading at +60C = 19.99
  • Current Reading = 15.22

% Of Range = (15.22 – 4.07) / (19.99-4.07) * 100

% Of Range = 70%

Converted Value = 100 * 70% = 70C above min Range

Converted Value = 70C – 40C = 30C