I have attached a 4…20 mA waterlevel sensor (0 - 0.4 bar, operates from 10 - 30 V) to a 4-20 mA Current Receiver and am logging the values with python script running on a Raspberry Pi via one of your I2C-Interfaces for Raspberry Pi.
This is how I attached the sensor:
[ +] --------------- [+] I2C Sensor [GND] --------------- [-]
Some questions remain:
Which gain factor should I use? I am currently running with the gain factor 1 but I think this does not use the full resolution of the ADC. Is there a formula to calculate the gain factor?
single ended vs differential
I only get reasonable readings if I use “single ended” altough I would have expected that the circuit above is a differential measurement
calculate min/max values
How do I calculate the correct values from the ADC for the equivalents of 0, 4 and 20 mA to correctly scale to the physical value?
At the moment I get the following measurements:
96 : sensor is not attached
3250: Sensor value 0
6350: 0.1 bar (1/4 of the sensors max)
I can’t currently measure the sensors maximum value but estimate the ADC reading to be about 15664
use external voltage
Currently the sensor is running of the 16 V provided by the Current Receiver. Is it possible to use an external voltage? This would enable me to run the sensor with 12 V from a battery.
Thank you in advance