Scales

(First a short update on Gameduino 3X. The GD3X manufacturing run is starting any day now. After the bare boards arrive in California, we'll get them assembled, tested and shipped asap. Current best estimate is June 5th for shipping, but much depends on manufacture time and DHL. I know many people are waiting on GD3X, thanks!)
 



I weigh things much more than I used to. Running a store and shipping items means weighing the orders of course, but I also keep track of inventory by weight. Miscounting things is incredibly easy, so weighing them instead makes a lot of sense.

These scales I've been using are quite good. Accuracy is about 2g, which is enough for shipping. However they are not USB-connected, so don't work with my mailing software. Last week I wondered how hard it would be to make scales, so spent an enjoyable Saturday morning messing around with the parts.

The parts in this case are a cheap load cell and A/D, plus some reference weights. The first step was to repurpose an I2CDriver as a digital scale interface, and get it talking to the HX711 chip. This is an A/D specifically for scales with 24-output. However not all of those 24 bits are good. More on that in a moment.
HX711 and load cellAfter getting the microcontroller reading the load cell, it was time to make it into some scales by sticking it between two metal plates. Here's the top view - two 6"x6" plates

This image was deleted by MailChimp when they shut down TinyLetter.
and here is the load cell, fixed between the plates

This image was deleted by MailChimp when they shut down TinyLetter.

How well does it work? This is a real-time trace of the A/D output as I place a 100g weight on the platform, and then remove it.

This image was deleted by MailChimp when they shut down TinyLetter.
The red curve is the raw readings from the HX711 sensor. (The extra peak at the 9s mark is my grasp, pushing down slightly on the platform as I grab the weight.) The green curve is the raw readings, smoothed with an exponential moving average. This is a simple filter that doesn't require any memory - perfect for tiny microcontrollers. The filter doesn't quite reach the proper value even after 5 seconds of settling. That's a bit annoying for everyday use, so I added a easy hack: the filter resets when the input changes by more than a threshold value. This works much better:

This image was deleted by MailChimp when they shut down TinyLetter.
It's nice and responsive, but has good noise rejection. To show the filter working, here's an enlarged view of the first 4 seconds:

This image was deleted by MailChimp when they shut down TinyLetter.Without the filter, the scales have about 2g of noise. This is the accuracy of my cheap postal scales, and is probably not a coincidence. With the filter, the noise is reduced about 10X, so the accuracy is about .2g.

The next step is to implement a standard scale protocol in the firmware.