Measuring 4-20 mA signal

I would be nice and more than useful if I could find some hints to how measure 4-20 mA signal via hardwario modules.

As far as I know:
it will be necessary to make a current converter from 4-20mA to 0-3V using a resistor.
A sensor generating 4-20 mA has to be externally powered, everything else can run safely from batteries.

Any help greatly appreciated!

You’re right, the simplest solution is to use resistor to convert current to the voltage.
You have to be careful and choose the right value so the voltage across that resistor does not goes above 3 V otherwise it might destroy the GPIO pin.

On some internet articles they add zener diode with series protection resistor to make sure the voltage does exceed 3V. It also protects the pin in case your sensor looses ground, that way you have 24 V on the GPIO pin, but thanks to that serial resistor (or fuse) and zener/TVS diode, you’re safe.

If I’m not overlooking then the series resistor should be at most 150 Ohms when I count the biggest current 20 mA. The sensor voltage 12/24V does not matter.

150 Ohm * 0.02 A = 3 V

Some internet articles