Introduction: Arduino Bathroom Scale With 50 Kg Load Cells and HX711 Amplifier

Picture of Arduino Bathroom Scale With 50 Kg Load Cells and HX711 Amplifier

This Instructable describes how to make a weighing scale using readily available off the shelf parts.

Materials needed:

  1. Arduino - (this design uses a standard Arduino Uno, other Arduino versions or clones should work also)
  2. HX711 on breakout board - This microchip is specially made for amplifying the signals from load cells and reporting them to another mircocontroller. The load cells plug into this board, and this board tells the Arduino what the load cells measure.
  3. 50kg load cells (x4) - Load cells are specially shaped metal parts that have strain gauges glue to them. The strain gauges are resistors that change their resitance when they are bent. When the metal part bends, the resistance of the load cell changes (the HX711 measures this small change in resistance accurately). You can buy the load cells and HX711 as a kit here: https://www.amazon.com/Degraw-amplifier-weight-Arduino-Bathroom/dp/B075Y5R7T7/
  4. Sturdy flat mounting surface - a stiff piece of hardwood or metal is ideal
  5. Wires in various colors for connecting all the parts
  6. Power supply for Arduino

Step 1: Mount the Load Cells

Picture of Mount the Load Cells

Mount the 4 load cells to the bottom of the scale in the four corners. Epoxy works well to hold them in place. See the mounting diagram, it shows which surface should be mounted to the base and which surface should touch the floor.

Step 2: Verify the Load Cell Wiring

Picture of Verify the Load Cell Wiring

The wiring diagram is made assuming the load cell is constructed like this picture.

To make sure you get it right, be sure to figure out which two terminals on the load cells have the highest resistance between them (E.g. Black and White, to match the schematic), wire them in a big color matching loop, like B-B W-W B-B W-W and then excite (E+/E-) two opposite center taps (R) and sense (A+/A-) on the other pair of center taps.

This page on Sackexchange has even better information: https://arduino.stackexchange.com/questions/11946/how-to-get-weight-data-from-glass-electronic-bathroom-scale-sensors/18698#18698

Step 3: Wire the Load Cells and HX711

Picture of Wire the Load Cells and HX711

See the wiring diagram for how to connect the load cells, HX711, and Arduino.

Some of the load cell wires are connected together to form what is called a Wheatstone bridge arrangement. This can get a little confusing. A good option for connecting all the load cells in a clean, easy to understand way is the SparkFun load cell combinator board - https://www.sparkfun.com/products/13878

This arrangement allows the loads on all of the different load cell sensors to be combined and measured at once.

Step 4: Add HX711 Library to Your Arduino IDE

The HX711 library is available here: https://github.com/bogde/HX711

See this link on the Arduino website for instructions on how to add the library to your Arduino IDE: https://www.arduino.cc/en/Guide/Libraries

Step 5: Calibrate and Weigh!

Sparkfun has great Arduino programs to run the scale. The most up to date versions are available on GitHub and reprinted below: https://github.com/sparkfun/HX711-Load-Cell-Amplifier

The first software step is to determine calibration factors for the scale. To do this, run this code:

/*
Example using the SparkFun HX711 breakout board with a scale By: Nathan Seidle SparkFun Electronics Date: November 19th, 2014 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

This is the calibration sketch. Use it to determine the calibration_factor that the main example uses. It also outputs the zero_factor useful for projects that have a permanent mass on the scale in between power cycles.

Setup your scale and start the sketch WITHOUT a weight on the scale Once readings are displayed place the weight on the scale Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight Use this calibration_factor on the example sketch

This example assumes pounds (lbs). If you prefer kilograms, change the Serial.print(" lbs"); line to kg. The calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg).

Your calibration factor may be very positive or very negative. It all depends on the setup of your scale system and the direction the sensors deflect from zero state This example code uses bogde's excellent library: https://github.com/bogde/HX711 bogde's library is released under a GNU GENERAL PUBLIC LICENSE Arduino pin 2 -> HX711 CLK 3 -> DOUT 5V -> VCC GND -> GND

Most any pin on the Arduino Uno will be compatible with DOUT/CLK.

The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.

*/

#include "HX711.h"

#define DOUT 3 #define CLK 2

HX711 scale(DOUT, CLK);

float calibration_factor = -7050; //-7050 worked for my 440lb max scale setup

void setup() { Serial.begin(9600); Serial.println("HX711 calibration sketch"); Serial.println("Remove all weight from scale"); Serial.println("After readings begin, place known weight on scale"); Serial.println("Press + or a to increase calibration factor"); Serial.println("Press - or z to decrease calibration factor");

scale.set_scale(); scale.tare(); //Reset the scale to 0

long zero_factor = scale.read_average(); //Get a baseline reading Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects. Serial.println(zero_factor); }

void loop() {

scale.set_scale(calibration_factor); //Adjust to this calibration factor

Serial.print("Reading: "); Serial.print(scale.get_units(), 1); Serial.print(" lbs"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person Serial.print(" calibration_factor: "); Serial.print(calibration_factor); Serial.println();

if(Serial.available()) { char temp = Serial.read(); if(temp == '+' || temp == 'a') calibration_factor += 10; else if(temp == '-' || temp == 'z') calibration_factor -= 10; } }

After calibrating the scale, you can run this sample program, then hack it up for your own purposes:

/*
Example using the SparkFun HX711 breakout board with a scale By: Nathan Seidle SparkFun Electronics Date: November 19th, 2014 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).

This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your specific load cell setup.

This example code uses bogde's excellent library: https://github.com/bogde/HX711 bogde's library is released under a GNU GENERAL PUBLIC LICENSE

The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge based load cell which should allow a user to measure everything from a few grams to tens of tons. Arduino pin 2 -> HX711 CLK 3 -> DAT 5V -> VCC GND -> GND

The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.

*/

#include "HX711.h"

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define DOUT 3 #define CLK 2

HX711 scale(DOUT, CLK);

void setup() { Serial.begin(9600); Serial.println("HX711 scale demo");

scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

Serial.println("Readings:"); }

void loop() { Serial.print("Reading: "); Serial.print(scale.get_units(), 1); //scale.get_units() returns a float Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor Serial.println(); }

Comments

OrenE3 made it! (author)2017-12-03

Hey dude!
I have a question for you that I hope you can answer.
Me and my friend bought an HX711 but it looks a but different.

we've followed your tutorial and couldn't get any input from the load cells.
Do you have any idea in what way we should connect it? (look at the image)
We've treated the GND and OUT as E+ and E-.
and CK/TX as SCK.
We don't really have alot of knowledge in this field so we're probably have no idea what we're doing.
Can you please help us? :)
Thank you!!

StergiosZ (author)2017-11-14

Can you tell me how to connect 4-wire loads together????
I need this information to achive the above with 4-wire loads.....

DegrawSt (author)StergiosZ2017-11-19

I have another instructable about using load cells with 4 wires. It is located here, hopefully it is helpful with your setup:

https://www.instructables.com/id/Arduino-Scale-With-5kg-Load-Cell-and-HX711-Amplifi/

Neilcallahan (author)2017-10-18

For a ground point I have attempted to wire things up as close as I can figure to the diagrams and have used the calibration sketch, as is.

When I load the sketch the values float. With nothing on the scale, they will rise or fall, as much as 50 Lbs.

Does anyone have any thoughts on what may cause this behavior?

Thanks

Kdemon (author)2017-09-26

Nice instructable, I'm definitely going to build one, but what is the weight range? I would like to measure grams.

DegrawSt (author)Kdemon2017-09-27

This is probably the wrong set up if you need to measure grams. Fortunately, measuring on the gram scale is even easier! You can buy a single aluminum beam load cell already wired up. Check out this instructable for more info: https://www.instructables.com/id/Arduino-Scale-With-5kg-Load-Cell-and-HX711-Amplifi/

DavidF15 (author)2017-09-26

The coloring/configuration of the half-bridge cell wires if very important. They are different in several of your pictures. The wires on the cells pictured in step 2 (W-R-B) don't match the cells in the schematic (B-W-R). The wiring on the cells in the different panels of the step 1 pic differ from each other.

If you don't drive and sense on the center taps of the half-bridges, the circuit would have half the sensitivity of https://arduino.stackexchange.com/a/18698/6628 configuration since your wheatstone bridge would exist between the cell's center terminals, and then be attenuated from each node of the wheatstone bridge into the HX711 by the variable resistance of the strain gauge.

To make sure you get it right, be sure to figure out which two terminals on the load cells have the highest resistance between them (E.g. Black and White, to match your schematic), wire them in a big color matching loop, like B-B W-W B-B W-W and then excite (E+/E-) two opposite center taps (R) and sense (A+/A-) on the other pair of center taps.

DegrawSt (author)DavidF152017-09-27

Great feedback, thank you! I will add a step with your information and verification step.

Ben-DIY (author)2017-09-25

Great, I recently recycled 4 of these from a broken bathroom scale and was not sure how to use them. Thanks for sharing!

Swansong (author)2017-09-19

Thanks for sharing :)

About This Instructable

12,747views

170favorites

License:

More by DegrawSt:Arduino Scale With 5kg Load Cell and HX711 AmplifierArduino Bathroom Scale With 50 Kg Load Cells and HX711 Amplifier
Add instructable to: