penguin_38
Posts: 1
Joined: Mon Jun 08, 2020 6:11 pm

Raspberry pi 4 and 4-20mA analog input

Mon Jun 08, 2020 6:18 pm

Hi guys,

As a first project, I would like to measure my fuel oil tank level and read it from a webpage.
To do so, I get a 4-20 mA sensor.

I visited several websites, trying to get information about how to link a 4-20 mA sensor to a Raspberry pi.
Some people use Arduino and I didn't get enough information to success.

Does anyone can help in this first project ?

boyoh
Posts: 1468
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Raspberry pi 4 and 4-20mA analog input

Tue Jun 09, 2020 4:17 pm

4 - 20 ma senses uses current loop in their operation ,Used a lot in Industrial operation sending signals to PLCs and
micro processors. An example to tell if a motor is stopped, or just idling off load , A PLC or Microprocessor will want to
know the difference. In a nut shell you want know if 4ma current flowing is indicating motor stopped or running off load.
Use the 20ma current as motor full load indication

If you use it for level indicating , you will want to know if 4ma current flowing indicates tank empty or you have reserve showing
Use the 20ma current flowing to indicate tank full.

Regards BoyOh
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

ghellquist
Posts: 73
Joined: Thu Aug 02, 2012 8:47 am
Location: Stockholm Sweden

Re: Raspberry pi 4 and 4-20mA analog input

Wed Jun 10, 2020 6:06 pm

You will need some extra hardware. The Raspberry does not have any analog inputs available. The 4-20 mA current loop can show a value from 0 to 100% (or how you want to scale the signal) and the values in between. An analog input would show that signal as a number, say from 0 to 32000 and then you scale that to between 0% to 100%, or if you preferr you could scale it to number of liters in the tank.

Best is if you can find some solution that is already prepared for this. I suggest you do a google search for, as example, "raspberry 4-20mA input" or "raspberry 4-20mA receiver".

Return to “Beginners”