# Temperature Compensation for Load Cells

Hi,
My project: A scale that measures the weight of my kegs inside the kegerator.
Problem: Readings oscilates according to the temperature. The correlation is pretty proportional. Please see attachment.

My hardware:
Temperature Sensor XC3700
4 X 50kg Load Cells (Chinese)
Esp8266 NodeMCU

Can someone please give me some guidance, ideas how to implement a compensation for this in my code? Has anyone experience on this?

Thank you

What is causing the temperature changes?
Actually where are the load cells? Inside the keg machine or is the entire unit sitting on the cells?
Who is drinking your beer at 5am?
How many kegs are there?
Who is drinking your beer at 11am?
What does your index values actually mean? 12.727 - 13.043 is that whole range for a ounce, a gram, a kilo?
Who is drinking your beer at 2pm
What does your temperature values measure ?

In all seriousness though, you seem to “gain” .1(something) for every 3(something else)

Are those air temperature measurements?
The temperature of the load cells and the Esp8266 will lag several minutes beind the air temperature changes so try measuring and plotting those.

Hi,
@mirandax Screenshot image;

Tom..

Hi,
A solution would be;

Have a separate load cell in the Kegerator that is under a static known load.
You use that signal to calculate the error correction to the variable signal.

Tom..

TomGeorge:
Hi,
A solution would be;

Have a separate load cell in the Kegerator that is under a static known load.
You use that signal to calculate the error correction to the variable signal.

Tom..

That's not a bad idea Tom, thank you.

However, I would have to buy more load cells, build something and have the static load all the time, and the space inside the kegerator is not much.

I was more interested in implementing a code which would compensate the oscillation, based on a sort of known pattern. Looking at the graph, the answer seems to be in front of my eyes but haven't figured out.

Seems you have to work out which part or parts are temp sensitive. Maybe with the help of a hair dryer.
Start with the HX711 board. Keep the hair dryer at some distance, and warm up slowly/evenly.
Could use a (waterproof) DS18B20 sensor if you found out which part (load cell or HX711) is doing it.
Leo..

mirandax:
Looking at the graph, the answer seems to be in front of my eyes but haven't figured out.

And you have the luxury of knowing exactly what that graph is.

From my perspective your base temperature for the beer is close to 52 degrees F, and once every 6 hours it is cooled down to 34 degrees over 30 minutes and then is heated back up to 52 over next the next 30 minutes. Then maintained at that temperature for the next 4 1/2hours before the cycle starts over again.

Slumpert:
And you have the luxury of knowing exactly what that graph is.

From my perspective your base temperature for the beer is close to 52 degrees F, and once every 6 hours it is cooled down to 34 degrees over 30 minutes and then is heated back up to 52 over next the next 30 minutes. Then maintained at that temperature for the next 4 1/2hours before the cycle starts over again.

Since the title was Consumption.. my thoughts were a bit different.....
temperature should not move that fast. it is as if the sensor is in the air and not the liquid. when the chiller turns on, the air will get cold but the liquid would only give up some heat.

the thermal expansion of metals could alter the physical constraints of the load cell and it could see more or less force based on metal expansion and not due to a temperature effect of the cell itself.

Since both sensors react at odd times but almost in unison, I would look to the physical properties of the environment around the sensors. Since he creaping pattern seems more locked to both sensors, it would make me not suspect the power supply.

as a test, could you put a towel and plastic tarp over the load cell so that it will not see the temperature change as fast ?

Is the load cell inside of the refrigerator ? mounting it on a leg would allow unit measurement.

Lastly, do you have a link to the data sheet for the load cell ? what does that say about temperature effects ?
if they are known, then that might have a correction factor.

dave-in-nj:
my thoughts were a bit different.....
temperature should not move that fast.

Those cheap bathroom scale load sensors have a expected temperature drift of about .1kg for every 10c rise in temperature from 0c.

when doing a common refrigerator temperature data logging with an RTD some 2+ decades ago I found that the closer the sensor got to 32 deg F, the slower the response. hours. drifting might be a result of the sensor ability. probably not as two different ones are reacting in a parallel fashion. but, it would not be the first time two totally separate problems ran in parallel.
Mine cleared 90% of the error in the first few minutes, but an hour later, it was still moving towards temperature. it was drifting lower, so it was not heat loss. overnight it was still drifting lower.

in this case, there is much we do not know.
#1) where is the only strain gauge sensor located ? why did the OP state he got 4 ?
#2) what does the code do for smoothing ? ie : what code ?
#3) where is the temperature sensor located ? is it in air or in the liquid ?

Since we know that mass cannot alter temperature in the speeds shown on the chart, we could assume the temperature sensor is located in air.

since we do not know the location of the strain gauge, or the smoothing, we could assume that the vibration of the compressor is adding spikes, the spikes end once the compressor shuts off and then it takes quite some time for new data to replace the spikes.

2 things the OP has not shared. #1) code #2) a pint.
the latter is more important as after a few of those #1) becomes less important.
3 things...is there a sensor on compressor operation ? that might be the reveal in this mystery.

as for the dip, that would make me triple check my power supply.
and the code to see if there are two loops running for both temp and weight. One runs when the compressor is off, the other while it is powered.
Straws are in plentiful supply for grasping when code is not available.