There are essentially 2 ways to read Analog inputs: reading current or reading voltage. Current is generally the most common because it can reach longer distances across the wire without losing analog input signal. Voltage, on the other-hand, will degrade over long distances producing inaccurate readings.

When working with devices that only read 1-5V you need a method to convert the 4-20mA devices to produce a 1-5V signal. The analog inputs on the Sierra Wireless modems (used in SCADACore Sentinel products) read 0-30V so a conversion is necessary.

Analog Input Hardware

To convert a mA analog input signal to voltage you need to attach a inline resistor. The size of your resistor will determine the output range of your voltage. There are 2 different methods for analog inputs: sink and source. If you have a source 4-20mA device you can simply insert the resistor in-line. If you have a sink analog input you need to provide power to the input to produce a signal.

Resistor Calculations are as follows:

Using ohms law V = R(I)  (Voltage = Resistance * Current)

If we were to scale a 4-20mA to 1-5V

For the 0 Value: .004 Amps * 250 ohms = 1 Volt

For the Max Value: .20 Amps * 250 ohms = 5 Volts

Depending on the device if you wanted a higher range you could do that with a larger resistor. This is sometimes more desirable if your analog inputs are not as accurate.

If we wanted to scale 4-20mA to 30V

For the 0 Value: .004 Amps * 1000 ohms = 4 Volts

For the Max Value: .20Amps *1000 ohms = 20 Volts

Analog Input Wiring

Placing the wire is quit simple it simply has to be inline. Because the resistor does not care where it is placed in the circuit you can simply run a resistor from the analog input to the ground.

Sourced Analog Inputs

Sourced analog inputs already have power so you are not required to power the inputs. You can simple “splice” a resistor on the analog line, since there is already power coming out of the analog output from the device. This will simply convert a 4-20mA output into a 1-5V output

Source Analog Input

Sinked Analog Inputs

Sinked inputs are a little more complicated as you have to “power” the analog input from an external source before you can read from it. Sinked inputs are far more common. Essentially you have to first provide power to the analog output of the remote device turning it into a sourced analog input. After that a resistor anywhere inline will create the conversion for you.

A typical wiring diagram with a single power source would look like this:

Sink Analog Input

It can look a little daunting at first but if you remove the power from the modem/plc/logger you can see that you simply run voltage through the analog output of the device and back through the analog input of the modem/plc/logger. You can simply attach a resistor between the return and the ground to provide the conversion from 4-20mA to 1-5VDC.

Sing Analog Input

Analog Input Math Conversion

Once you have completed the circuit you should be reading a value from 1-5V. Now you have to do a simple math conversion to find out what the actual value is.

Min/Max

First you need to find out what the minimum and maximum voltages are.

Set the analog output to zero on the remote device and record the reading. It will usually be around 1V but not exactly. For example this one might read 1.05V, this is due to the accuracy of the device and the accuracy of the resistor you put inline.

Next set the analog output on the device to max and record the reading. Again it will usually be around 5V but not exactly. For example this one might read 4.98V.

Min: 1.05V

Max: 4.98V

Formula For Percent

Next we calculate the percentage of the analog input we would expect half way between 1V and 5V to be about 50% (3V should be 50%) . With the formula: ((Ain – Min) / Max-Min) * 100

So if we had 3V we would have ((3V – 1.05) / (4.98V – 1.05V) * 100 = (1.95 / 3.93) * 100 = 49.91%.

Formula for Range of Device

Now that we have the percent reading of the analog input we can easily convert it into an actually reading for the output of a device.

Example 1:

If we had a toxic gas monitor that read from 0ppm to 10ppm H2S we simply take our percent in our formula and multiply it by the max.

The complete formula would look like this: ((Ain – Min) / Max-Min) * (Scale Of Device)

.4991 * 10ppm = 4.991ppm  (half the scale from 0 to 10 ppm is 5ppm.

 

Example 2:

For devices that have a range below zero like a temperature sensor you need to calculate the range then subtract to get back to the min value of the device. If a particular sensor went from -40C to +60C we need a way to get back to -40C. The Range on this sensor is 100C, half of that is 50C so we would expect a 50% reading to be at 10C (50C above the minumim).

We use the same formula: ((Ain – Min) / Max-Min) * (Scale Of Device) But now we have to finish by subtracting -40C to get back to the devices minimum.

( ((Ain – Min) / Max-Min) * (Scale Of Device)) – 40

.4991 * 100 = 49.91C – (40C) = 9.91C

 

Foot Notes

When looking at this from a big picture it can look scary but taking it step by step makes it easy for anyone to understand.