Close

Software - HX711 Libraries

A project log for Office Drought

I'm generally dehydrated so I'm making a water intake tracker using a scale and NFC chips stuck to my vessels.

iulian-arcusIulian Arcus 09/18/2016 at 03:100 Comments

Initially I was going to skip this bit in the docs but writing these logs inspired me to do this thoroughly. So I went and code reviewed most of the libraries for the HX711 on github.

Arduino

In my previous log I gave a shout out to a blog I found when I was looking for a chip to read my load gauge. I managed to find the library from its original developer. It's very clean and simple and there's a good setup tutorial in the readme that makes full use of helper functions so you don't have to write them.

Next up [bogde]'s library is the most refined and most cloned out of all the ones that I found. It has everything from zeroing to power management. There aren't any examples of using a fixed offset so you don't have to zero your device any time but that's just a call away. The only caveat with this is that the default Arduino version under Linux is 1.0.6 which requires you to remove some specific ESP8266 code (i.e. the two yield() calls) before installing the library in your Arduino environment or manually install a version above 1.5.1.

Linux GPIO

There are quite a few implementations ranging from a simple C example, a port of [bodge]'s implementation to GPIO and even a driver. Because I'm using Node Red I thought a nodejs wrapper might also be of interest.

Conclusion

When I first started this project I used the library in the tutorial and it was even configured perfectly for my gauge. But I want something that will be working for weeks on end so now that I found a fix for [bogde]'s library I'm inclined to use its sleep functionality.

I hope that helps anyone who wants to have a go at playing with strain gauges to skip the tedious task of finding the appropriate library and get on with playing with the data.

If I skipped any library it's either because it was an unattributed copy of [bodge]'s, it was a very basic implementation or written in a scripting language (python, ruby, etc.).

P.S. There are [two] [projects] from sparkfun that refer to HX711 which have good samples on how to use this library including an interactive calibration sketch to get the default offset and scale.

Discussions