 # Convert current sensor output in mA to analog readings

Most current analog sensors produce 4-20mA linear sensor output. In this article, you will learn how to convert the leaner sensor output to a measurement reading and how to set the conversion formula in ThingsLog UI.

## Introduction

Analog sensors produce either current or voltage output.

Current sensors are suitable for covering longer distances between the sensor and the data logger and thus have a great footprint in the industry. Voltage sensors are also widely used. They are typically cheaper, and can’t cover long distances but are typically suitable for integrated products where the sensor is embedded into the enclosure of the device.

An example of analog sensors is Pressure sensors (gauge or absolute), Level sensors, Temperature, Humidity, Weight, and many others.

### So how to convert the mA signal to a measurement reading

This tool uses the following formula to calculate the current output signal over a 4-20mA scale from a specified measurement input reading and range:

Y = Low Limit + (High Limit – Low Limit) * (X -4) / 16

Y – Measurement reading in the specific dimension (bar, m, °C to °F, etc).

X – mA current output of the sensor (should be between 4 and 20mA)

Low Limit – the lower limit of the sensor

High Limit – the upper limit of the sensor

## Examples

Let’s consider that we have a level sensor with a range of 0 – 4 meters and we get a sensor output of 5 mA.

`Y (m) = 0 + (4 -0)*(5-4)/16 = 0.25 m`

So we have:

Low limit,m = 0 m

High Limit,m = 4 m

X, mA = 5 mA

Let’s consider that we have a temperature sensor with a range of -20 to +100 °C and a sensor output of 10mA.

` Y ( °C ) = -20 + (100 - -20)*(10-4)/16 = 25 °C `

Low Limit, °C = -20 °C

High Limit, °C = 100 °C

X, mA = 10mA

## How to set conversion formulas in the ThingsLog UI Configuration menu

In ThingsLog UI you can set a conversion formula for analog sensor input ports.

Let’s consider the examples above.

### Level sensor configuration

For the 0 -4 m level sensor we have to enter the following formula:

`Y= (4 -0)*(X-4)/16 = 4*(X-4)/16 = 0.25*(x-4)`

With this config, the logger will convert the analog current signal to meters and will trigger an immediate alarm if the level goes under 1 m or above 3.5 m.

### Temperature sensor configuration

For the -20 +100 °C temperature current sensor we have the following formula

`Y ( °C ) = -20 + (100 - -20)*(x-4)/16 = -20 +120*(x-4)/16 = -20 + 7.5*(x-4) = -50 + 7.5*x `

With this config, the logger will convert the analog current signal to °C and will trigger immediate alarms if the temperature goes under 2 °C or above 8 °C.

## Conclusion

In this article, you have learned how to convert current sensor output in mA to analog readings and how to set conversion formulas in ThingsLog User Interface.

Share:

Related Posts ### Wooding company uses ThingsLog solutions for water and energy to support the safety production process

Aksel Treyd Lts is a fast-growing wood processing company with an annual production capacity of 20 000 tons per year. The company approached ThingsLog to ### Introduction to ThingsLog platform and mobile app – webinar record

Learn more during our November webinar on how to setup ThingsLog IoT platform and mobile app. The webinar will put focus on setting accounts, users, permissions, alarms 