# Basic Knowledge Current Measurement

Transferring sensor values via a so-called “current loop” has significant advantages compared to voltage measurement.For better understanding, we first show you the disadvantages of sensors with voltage output. Here’s an example:

In an ideal scenario, no currents would flow during a voltage measurement. In reality, however, all voltage measuring devices, i. e. also analog inputs of controllers, have a finite input resistance. In our example, this input resistance is R = 10 kΩ (which is not a very good value for a measuring device… our AIO voltage inputs have 900 kΩ). When you apply a voltage U to be measured to this input, then a current I = U / R flows. This current is therefore smaller the higher the input resistance is. This current is a problem because it distorts the measurement result. In addition to the input resistance, there are also the resistance of the lines and the internal resistance of the voltage source (the sensor). Ideally, these resistances should be 0 Ω In reality, however, they are in fact resistances with relatively small values.  In our example we assumed 15 Ω each for the cables from the sensor to the controller and 10 Ω internal resistance for the sensor. This is a total of 40 Ω, which are all arranged in series connection with the input resistance.

The small measuring current therefore flows through all these “parasitic” resistors and generates a voltage drop of U = R*I. This voltage drop causes the sensor voltage at the controller to be measured too low. The smaller the line and internal resistances are and the lower the measuring current, the smaller the voltage drop and thus also the measuring error. In our example, the sensor actually outputs a voltage of 8.52 V. However, a voltage of 8.486 V is measured at the analog input of the controller. The measuring current of only 850 µA thus generates a voltage drop due to the parasitic resistors of 34 mV. This is already 0.4% measurement error.

## The current loop

Parasitic resistors are irrelevant in a current loop. Here is our example with a sensor having 4 to 20 mA current output:

Since no current can be lost in a closed loop (hence the term “current loop” for this measurement method), the analog input measures exactly the 18.5 mA that the sensor outputs. The size of the parasitic resistors does not have any influence on the measurement accuracy!

Now you know why it is better to use a sensor with current output for long leads or measurement inputs with moderate input resistance. You get much more accurate measurements. If you take a close look at the circuit diagram, you will also see that in principle several current inputs can be connected in series without affecting the measuring accuracy. Try it with our AIO current inputs: If you connect 2 of them in series, you should get exactly the same measurement value for both inputs (exactly to 24 µA, because our AIO can’t measure any more precisely).

And what if you were to connect 4 AIO current inputs in series? In general, all 4 inputs should show the same value. But now we come to the limits of this measurement process:

## Current loop limits

In order for the sensor to be able to output the 4 to 20 mA, it requires a voltage source. No voltage, no current! This voltage source is usually located somewhere between the sensor and the controller:

In our case, this power supply should give the current loop a 15 V voltage. In our example, this voltage has been applied to a total resistance of 290 Ω. If the sensor would not regulate the current to 4 to 20 mA, then a maximum current of 51.7 mA (I = U/R) would be able to flow. This is enough for the sensor to regulate to a maximum of 20 mA.

If we connect our second current input in series, we get 540 Ω “loop resistance” and a maximum current of only 27.7 mA can flow. A good sensor can still regulate a maximum of 20 mA on it. But with 3 inputs in series, the loop resistance would already be 790 Ω and a maximum of only 19 mA could flow in the current loop. Even the best sensor can no longer make 20 mA out of it. In general you have to take into consideration that in a current loop the maximum supply voltage is chosen as high as possible (although a lot of sensors cannot handle more than 24 V) and the loop resistance is kept as low as possible. At 24 V, most sensors can still work well with a loop resistance of 1 kΩ. According to the standard, a current output of 4 to 20 mA must only be able to process loop resistances up to 600 Ω.

By the way, many sensors even have their own power supply connection. Such sensors then have more than 2 connections. One is for GND, another for the 24 V supply voltage and the third is the current output.

## Dynamic signals

Please read the voltage measurement tutorial if you have questions regarding the setting “ADC data rate” in PiCtory and would like to know more about the measuring of rapidly changing sensor values.

## Why is it the smallest value 4 mA and not 0 mA?

The advantage of 4 mA as the smallest value is easy to explain: If your sensor would output a current of up to 0 mA, then the currents close to 0 would be far too small to be exactly measurable with inexpensive analog inputs. In addition, interference from outside would then cause stronger errors relative to the measuring current. But the most important point is the possibility to easily detect a line break towards the sensor using such a measuring range. In the event of a line break, 0 mA would flow. If, however, 4 mA is the smallest sensor value, then a significantly smaller measured value means that the line is defective (short-circuit or breakage).

## The AIO analog outputs for current loops

Our AIO current outputs have an internal voltage supply of 15 V. They can only be operated with a maximum loop resistance of 600 Ohm. The numerous current ranges offered in PiCtory in addition to the classic from 4 to 20 mA are only necessary for very few, very exotic actuators. The same applies to the various input ranges of the four analog inputs. If you really should find a sensor with 0-24 mA or even -24 to +24 mA, then you have the chance to use it with our AIO in your control system.