Close

Software Rewrite & HX711 woes

A project log for Bee hive health monitor

This project will monitor the weight changes in the hive along with some environmental items to provide real time indicators of hive health

sparksronsparks.ron 06/24/2020 at 18:000 Comments

We have now completed a major software rewrite from the prototype software. As with most prototypes it had been written in a "good 'nuff" method to quickly test the various hardware and internet protocols, but had little (or no) error checking, fall back options, etc.

The new software is structured to allow it to be modular and when each piece is fully operational it is extracted from the main loop and put in an appropriate function with the main loop calling that function.  This paves the way for the functions to be put into library module format for better management, reusability, and isolation.

In the process we added support for either of two types of temperature-relative humidity sensors. As noted earlier, testing of the DHT11/21 sensor showed it is useless for outdoors in coastal climates. Most of the summer, our night time humidity is well above 70%. That is the point where the DHT sensor saturates and reads 100%. It then requires the humidity to drop to about 60% for it to begin working again. In the summers here, that may not happen for many days. We have not yet completed testing on the SHT21 and HDC1080 sensors, but the early results are promising.

Most of the time with hardware has revolved around the HX711 A/D module. First as noted by Ken Meyer in his excellent project log Modifying the HX711 for 3.3v operation, the module fails to regulate voltages properly when run on 3.3v instead of 5.0v. The result is wildly varying scale readings. While his log was clear (thanks to pointing out a datasheet error), how it all worked was not obvious for us. It took a bit of measuring and soldering/desoldering to be able to understand it all. We then created a spreadsheet to properly calculate things. In our case piggybacking the 20k resistor with something between 20k-22k worked perfectly. However smaller values did not. This means there is a lower bound as well as the upper one. The upshot is that for our modules the larger divider resistor value (singly or in combination) must not be lower than 10K or higher than 11.5K in order to maintain proper regulation.

Now we have excellent calibrated performance at a single point and zero. However, other issues will remain. Temperature stability, load cell "creep", power use, software OTA updating, etc. are all upcoming issues.

Discussions