HX711 scale adjustment with MicroPython

Hi there,

this is a short note to support the community of people aiming to use the HX711 with MicroPython.


The lowlevel HX711 driver hx711.py for the Terkin Datalogger is based upon the hx711-lopy project by David Gerber – kudos! There are some improvements to the power_up() and power_down() functions you can find there.

Scale adjustment

At Calibration process · Issue #5 · geda/hx711-lopy · GitHub, someone asked about how a »HX711 calibration sketch for MicroPython« would look like. On this matter, I would like to point out the discussion at Ermittlung der Variablen offset und divider / scale zur Justierung der Waage - #2 by Andreas, where we gave a short introduction to our corresponding implementation.

Here, we would like directly point out the implementation at MicroPython HX711 scale adjustment program. Maybe this helps any people looking for something like this. [1]

What’s next?

Maybe this introductory post will spark further discussions around that topic.


  1. Please note that this implementation is based on the Terkin Datalogger framework, by using terkin.sensor.SensorManager. However, this could easily be swapped out, in order to build a variant using the hx711.py in a standalone manner. ↩︎

It would be sweet to see a standalone implementation for the lowlevel hx711.py driver derived from that, in order to give something back to the community.

For making this happen, all the “sensor manager” stuff would have to be stripped from the ScaleAdjustment class and those two lines would have to be adjusted to use self.hx711.read() instead of self.sensor.loadcell.get_reading().raw, where a corresponding instance has been created within __init__, like self.hx711 = HX711(...), beforehand.