The Hx711 is a 24 bit analog to digital converter for weigh scales. Essentially it takes the four fancy wires from the load cell on the scale I bought and gives out four wires. Of those four wires, one is ground, one is 5v, and two are for information. Beyond supplying wires, the module acts as an amplifier for the signals from the load cell.
Moving on from how it works, I used the blog I mentioned in my previous post to connect the Hx711 to the Arduino and the scale. The library and starter code are both included in the blog. It wasn’t too difficult to get the system running on the starter code.
Unfortunately, the system isn’t exactly consistent. Every so often a random value is read. It also takes a while for the reading to stabilize. In order to provide a more reliable read, I wrote a function that finds the average of five reads and compares it to the average of the next five reads. If the two averages are within 0.1 g of each other, then the reading is accepted as accurate and the two averages are averaged and saved.
While this check provides a decently reliable read, it does take a while to run. And sadly, while it’s running RFID tags can’t be checked in or checked out. To help minimize problems, I’m having the LCD panel display a message until it’s found an accurate reading. This problem is simply a matter of having a slow and not exactly accurate scale. With a better scale system, checking the weight of the milk won’t take five seconds but rather a fraction of a second.
But I seem to be skipping over the fact that IT WORKS! 😀 The code is modified and running. See the text I received!
It’s awesome! It’s really working. Just not on battery yet. I’m running into almost the same problem I had before with getting the system on battery. When I have the LCD panel, the Arduino, and the Hx711 all plugged into the power coming from the 5v regulator, it’s no longer 5v. The voltage is reading around 3.7 –Â 4.2v directly from the 5v regulator. While this seems enough for the Arduino and the Hx711, it’s not enough for the LCD panel. I’m considering buying a panel from SparkFun that takes 3.3v instead of 5v but I’m not sure if that’s my best solution. I’m still considering. I would really just prefer to solve this problem rather than find a work around. But maybe my work around is my solution. Sigh. I’m just not sure right now.