# 4-20mA sensor to a microcontroller

I need to connect a sensor with a 4-20 mA loop to a microcontroller. The MCU operates at 3.3V and the following image is from the sensor's datasheet.

I'm planning on converting the 4-20mA to a 0.6-3V range to be measured with the internal ADC.

I'm trying to figure out if the setup would work if I power the sensor via a 12V boost. From what I understand it should be ok as the drops would be 3V (in case of max output) + 6V required for the sensor's operation or if just providing 6V would be enough?

• You may want to post a link to the datasheet so folks can see exactly what you're working with. It could make a difference in the right way to power the sensor. – ScienceGeyser Mar 8 at 17:05
• 12V is fine. Based on the limited information from just the table you show, I'd agree with Arsenal's answer -- count the Vdrop from the sense resistor in series with the sensor's operating voltage. – Pete W Mar 8 at 19:58
• Thanks for the comments, updated with the datasheet – mmvgm1 Mar 9 at 8:04

Your thinking is correct that you need 3 V on top of the 6 V, so providing just 6 V wouldn't work out as the voltage for the sensor in the loop would drop below 6 V.

The maximum loop impedance is given for a supply of 24 V. It's actually $$\R_{max} = \frac{V_{supply}-6~\text{V}}{20~\text{mA}}\$$.

You can turn this around to get the minimum supply: $$\{V_{supply}}_{min} = 6~\text{V} + 20~\text{mA} * R_{loop}\$$. In your case that is 150 ohm, so 9 V.

You might also want to leave some space for error values like > 20.7 mA or something, depending on the sensor.

This is different for devices with an active output (3-wire, 4 wire).

The output from the sensor is a current source so you only need to make sure you can produce the right voltage for your ADC. In your case, 150 Ohms should be your sense resistor to give you 3 V full scale. A 6 V supply on the current source should be able to get that done. As pointed out in Arsenal's answer, in order to get the 6V minimum on the sensor, you'll need at least 9 Volt power supply when at full scale. If you have a long wire, or lot's of connectors in the run, you should use a higher voltage to insure that the sensor has at least the minimum voltage applied.

simulate this circuit – Schematic created using CircuitLab

• Thanks for the detailed explanation – mmvgm1 Mar 9 at 16:37