Debugging load cells and HX711

I’m working on a system to determine how long it takes to air dry laundry. As the fabric dries, it becomes lighter. The idea is to measure the weight of drying laundry and when it stops decreasing you know it is dry.

Enter: the load cell. Load cells convert force measurements (such as weight) into electrical signals. They’re found in most digital kitchen scales. If we can hang a piece of laundry from the load cell and feed the reading to a computer, we’ll be able to get the data we’re after.

Load Cell Cantilever.jpg

Image from http://2.bp.blogspot.com/

I decided to use a strain gauge load cell because it can measure hanging force easily, and it’s cheap and plentiful on Amazon.com. Grab a volt meter and a variable power supply and lets demonstrate how a load cell works.

Screenshot 2016-06-13 at 1.33.37 PM.png

Reading a load cell

A load cell comes with four wires. Red and black wires for voltage in and ground (5-10V). Two additional wires (usually green/white) will output a small voltage corresponding to the force on the load cell. The greater the force, the higher the voltage. In the photo above you see a voltmeter measuring millivoltage produced by weighing a pair of pliers.

Because the millivoltage is quite small, a load cell is paired with an amplifier chip to boost the signal. The HX711 will take measurements from the load cell and convert it to a 24 bit value (with over 16 million possible values). This amplification allows a 1kg load cell to have sub-1-gram accuracy.

Screenshot 2016-06-13 at 2.19.40 PM.png

HX711 amplifier with headers

Tip: always read the datasheet. Do not just grab somebody’s HX711 driver and expect it to be flawless. I speak from experience having soldered three separate HX711 chips, all apparently broken until I realized the driver was malfunctioning.

Also, if the HX711 is taking a reading from the load cell at the same time you are reading bits from the HX711, you will get corrupted data. This is because the HX711 sets the data out line to high while taking a reading. You will notice the data fluctuating wildly and a solid chain of 1 bits. In order to solve this problem, keep the HX711 in power save mode and only wake it up when you need to take a reading.

noise.png

Noisy data w/power save disabled

final.png

Clean data w/power save enabled

That’s it. Now it’s time to do some laundry…

 
56
Kudos
 
56
Kudos

Now read this

NSA puzzle

My dad recently presented me with a puzzle. The puzzle consists of nine square tiles. Each tile edge has the top or bottom half of an Air Force, Army, Marines, or Navy emblem. The challenge is to arrange the tiles in a 3x3 grid where all... Continue →