How make temperature compensation formula?

My sensor results are drifting same as arduino internal temp how can i make formula that compensates water level ?
Water level is constant 295mm.

I am measuring water level with ADS1115 + 4-20mA Water Level Sensor

temp.jpg

temp.jpg

Hard to be exact given the scale of the graph, but it looks like something like:

mmH2O = reading +(20-temperature) * 1.5

You'll have to tweak the constants a bit I expect.

A popular approach is to collect some data points over entire the range of temperatures for which the probe will be used, and fit a corrective straight line or curve to the points.

If you need help, post the actual data points as text, not a graph.

That transducer gives a range of 0- 5m . 300mm of water is 300/5000 , or 6% of range . Drift could well be 0.5% of range accounting for a lot of error . You are showing 10mm change or 10/5000, 0.2% of span - pretty good and close to the A/D resolution .

Depending on how it is wired , your measurement could be referenced by the Arduino power supply voltage - which may also drift , you may be better off using the internal reference .

To compensate for temperature drift you would need put the system in a controlled cabinet , vary the temperature and measure the level - then you can establish the relation ship .
Really you need a different level transducer

The web page for the sensor claims that it is temperature compensated to much better than the observed drift. So you may be observing the temperature dependence of the ADC reference voltage.

Compensation Temperature Range: -10c—80c
ZTC: (typical):±0.02%FS/c
STC: (typical):±0.02%FS/c

I have to agree with hammy in that a good quality pressure transducer should include temperature compensation. I am also surprised that with the cost of what you have at $45.00 USD it does not include temperature compensation. Especially considering how wide a temp range can be in a submersible sensor. The sensor claims compensation so I really don't see a simple fix just using code over a wide range.

Ron

I am also surprised that with the cost of what you have at $45.00 USD it does not include temperature compensation.

It DOES include temperature compensation, if you believe the claims on the web page.

See reply #4.

What value of load resistor are you using? Where is the ADS1115 power supply coming from?

No code, no connection diagram, no build pictures.

Typical sense resistor for 4-20mA is a 100ohm metalfilm resistor, with ADS1115 set to PGA2.
Leo..

Wawa:
No code, no connection diagram, no build pictures.

Typical sense resistor for 4-20mA is a 100ohm metalfilm resistor, with ADS1115 set to PGA2.
Leo..

Yep. I was wondering how the Arduino's temperature was affecting the digital output from the ADS1115.

The Nano itself is digital, and can’t be influenced by temperature.
The only things that can do that is the sense resistor and the ADS1115, and of course the sensor itself.
Leo…

I am using 100ohm resistor and 2x18650.

resistor and ADS1115 and nano are almost together(in small box) and I was thinking that nano internal temp is correlation with ambient temp. and so i get ambient temp changes...

so is it possible that 100ohm resistor value varies correlation with ambient temp and so on pressure value...

what is the best 100 ohm resistor to use and with no affect of temp changes.

I would check the temperature dependence of the sensor output using an independent method.

For example, fill the cylinder with warm water and as it cools, use your multimeter to measure the sensor output current as a function of sensor temperature.

This

mortenx:
My sensor results are drifting same as arduino internal temp how can i make formula that compensates water level ?
Water level is constant 295mm.

I am measuring water level with ADS1115 + 4-20mA Water Level Sensor
4-20mA Tank Liquid Level Transmitter Water Level Sensor Pressure Transducer 0-5M | eBay

Your sensor is a pressure sensor - you need to correct for atmospheric pressure, not for temperature.

Suspect this is a classic xyproblem - you’ve guessed the problem is to do with temperature, but I’m pretty confident that’s irrelevant, or a much smaller effect. The sensor has only a submerged part
so it cannot compensate for atmospheric pressure by itself.

[ well, not unless it has a tube running inside the cable that samples atmospheric pressure at the
other end ]

MarkT:
[ … it has a tube running inside the cable that samples atmospheric pressure at the
other end ]

yes