Temperature compensation for HX711 and / or load cell?


i am not sure if English or German is the common language here? I try to do my best and start the discussion in English.

I have an issue with my bee-scale. I am using a Bosche H30A with HX711 on a Raspberry Pi Zero.
The HX711 is driven by 5V. Now I installed the scale outside with no weight on it (so it should measure 0grams). I calibrated the scale at an ambient temperature of about 15°C with an weight of 20kg.
But, i see a huge temperature-dependency, the correlation is obvious.
Any ideas whats wrong here?


Thanks, and sorry for my english :)

English or German, both is ok.

I don’t think the HX711 is the problem but the load cell itself, have a look at Temperaturkompensation für Waage nötig? Datensammlung and you may check your solder joints, clean them carefully from flux!

Hi, thanks for the quick response. As Thias said, the soldering and the flux is most likely the reason.
I will check that! I keep you informed :)

Thanks a lot for the hint!

According to the graphic your shared there is a strong linear dependency (which I had to learn recently as well). You can simply try to calculate the compensated weight by

W_{comp} = W_{raw} (1- c(T_{cal}-T_{sc}))
W_{raw}: raw weight values from scale
c: compensation coefficient (I use 0.0002 for the same scale/ADC setup)
T_{cal}: Temperature at calibration time (slighly below 20°C)
T_{sc}: Temperature of scale (put the sensor close to the scale)

1 Like

Sure, i could compensate the error with your posted equation, but way better would be to find a solution for the root cause :)

You wrote, you had to learn that as well. Do you still have the temperature effect, because you posted " After cleaning with alcohol and a tooth brush the dependency is almost completely gone."

I try to check the soldering and i will clean everything from the flux. Let’s see, maybe thats also it.

Well, I initially though so, but had to learn that cleaning the soldering is important but the remaining effects arise from the temperature dependency of the scale itself. I just didn’t look closely enough at the beginning. Effects on the ADC are definitely worth looking at.

What was the remaining error (g/K) after cleaning everthing?

about 10g/K. see my panel here.

It depends also on the load cell and the need and amount of compensation is different for different load cells. so be sure to talk about the same load cell. But I think you are using a Bosche (H30 or H40?) load cell in the linked dash board also.

First of all, load cell should have temperature compensation built-in. This involves additional strain gauges built-in and are generaly more expensive. Ask your factory. Beware, Typical reseller will tell you whatever you want to hear. Next, there are difference between ready-made hx711 modules available on aliexpress, ebay etc. From my experience “red” modules are more temperature stable than “green”, unfortunately I didn’t have time to analyze the reason. I recommend to use your own ADC modules, for example based on ADS1231 should repeatable success be priority. For one-off project, however, red HX711 should be very good.

1 Like

I have 2 identical scales, both have the green HX711 and Bosche H30A.
I read, that the green HX711 boards do not have a connection between E- and GND (i checked that, my boards didn’t), so i connected them. As read, the connection is also good for stability reasons. This was already done before i figured out the temperature behaviour.

Yesterday evening i cleaned the soldering and I removed all flux. This was not really an improvement. See :

The other scale is way better. Here i have two temperature-sensors. One located in the box near the HX711 board, the other one is near the load cell. This configuration is working very good, more accuracy is not important for me. Unfortunately the temp-sensor failed during the night, so i don’t have temp measurements below 8°C, but the weight is very stable, seesecond link.


Now i should swap the electronic board and the load cell, to see whether the HX711 or the load cell itself is not working proper.
I am sure BOSCHE load cells are well designed and they have temperature compensation on board, but maybe the one i got is faulty? (At least the price and the data spec. should ensure that)
Any other ideas?

1 Like

Aren’t there any physical touch or cables which could affect load on the load cell ? Both have the same type of load ? If everything is absolutely same on both platforms then probably swapping electronics would hint more in most effective way.

1 Like

I can not see your data! How different are (how much g / kg / %) the two setups?

The author made this visualization private.

Swapping the load cell is a good idea to go on in diagnostics. Double check your physical connections. What are you using screw terminals, soldering? also moving the cable (by wind), some beekepers have sheeps also ;-) or direct sun radiation can influence the reading massively!!

Ups, now the visualization is public. The scale is not loaded, so it should get 0 grams. (The load cell itself is loaded with the scale, but calibrated to 0 grams).

All physical connections are soldered and are looking good. Powersupply is from the socket, so should also be no problem.
Both scales are on the same spot, so wind sun etc. should also be no prob.
How should direct sun radiation influence the reading? I measure the temp, so the direct influence factor should be the temperature, right?

In case the load cell or the (analog) cable of the load cell is warmed up one-sided resistance will change unpredictable and lead to weird readings. I noticed this on a hive with sunlight in the afternoon only. Every day at around 16h increase the weight and decreased later.

I saw also more variation on a load cell with zero / no weight than on a load cell with some kg. So you should check this also. This seems to be a common problem because you can find load cells aos that ar specified from a certain weight up (e.g. 5-150 kg).

Ok, you have around 20 g on the “good” setup, what is quite good and the same as I observed on the workbench. The other scale has 600 g, hmm, that is too much I think also!

Could you doublecheck the calibration? And do the calibration with al least 1 kg pre-load?

I will check the calibration on Sunday. The Calibration is done with - of course- zero weight on the scale (which is about 5kg on the cell) and with 20kg on the scale.

600g is way too much - there must be a faulty part - hopefully with your help i will find it :)

I have two more scales (also same configuration like the two mentioned scales above), but those are loaded with bee hives. So the temperature impact is not clearly visible - because i don’t know how the bees are flying etc. :) (ID: 551549 and 613169)

On Sunday i will dismount all scales and i will place them unloaded and save from wind/rain on the balcony. Lets see what happens with the other two.

1 Like

@clemens meint die Auswirkungen dieses Effekts hier (:

While writing I thought on this: Tagesschwankungen im August, biologisch oder Artefakte? but after looking at this still mysterious effect I think about a combined effect of 1/2 side weighting plus temperatur effects.

Btw. @zmaier feel free to send your data instead of thingspeak or in parallel to thingspeak also to the hiveeyes visualization tool based on Grafana Grafana I think it has a lot of mor options and possibilities to combine different data sources e.g. in one panel or add DWD weather data to your data.

1 Like

@clemens : I am sending the data also to my influxdb server (Weight and temp is measured every 30s and i am sending the median value of these points every 10min). I am a beginner in grafana, so my dashboard is very simple. But of course i will check all of your visualizations and i am really looking forward to see your boards and your ideas :)

If you want to have a look at it :

I don’t know how to share the dashboard without the need to login.

1 Like