HX711 Python Library for Raspberry Pi.
Branch: master
Clone or download
tatobari Merge pull request #19 from slabula/master
Major refactor, still backwards compatible. This version is a release candidate for PIP. Looking for volunteers to publish it.
Latest commit e790cc8 Feb 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Add .gitignore Mar 28, 2018
LICENSE Initial commit Jun 6, 2016
README.md Merge remote-tracking branch 'upstream/master' Nov 16, 2018
emulated_hx711.py Added made simulated tare optional. Feb 10, 2019
example.py Merged from latest tatobari-master. Feb 10, 2019
hx711.py Neater method of checking for odd value. Feb 10, 2019
setup.py Add setup.py Mar 20, 2018


HX711 for Raspbery Py

Quick code credited to underdoeg's Gist HX711.py. I've only made a few modifications on the way the captured bits are processed and to support Two's Complement, which it didn't.


Check example.py to see how it works.


  1. Clone or download and unpack this repository
  2. In the repository directory, run
python setup.py install

Using a 2-channel HX711 module

Channel A has selectable gain of 128 or 64. Using set_gain(128) or set_gain(64) selects channel A with the specified gain.

Using set_gain(32) selects channel B at the fixed gain of 32. The tare_B(), get_value_B() and get_weight_B() functions do this for you.

This info was obtained from an HX711 datasheet located at https://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/hx711_english.pdf