Introduction: Arduino Scale With 5kg Load Cell and HX711 Amplifier

Picture of Arduino Scale With 5kg Load Cell and HX711 Amplifier

This Instructable describes how to make a small 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. 5kg load cell - 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 both the HX711 and load cell here: https://www.amazon.com/Degraw-Load-Cell-HX711-Combo/dp/B075317R45/

4. Sturdy flat mounting surface (x2) - 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 Cell

Picture of Mount the Load Cell

First we are going to mount the load cell. Your mount will be unique, but here are the guidelines you need to follow:

1. The aluminum load cell should have 4 tapped holes and a label showing the direction of force.Mount the side without the label to the fixed surface and mount the side with the label to the moving surface. The arrow on the labeled side should point down in the direction the platform will move when a load is applied.

2. The mounting plate and the moving plate should both be as rigid as possible

3. Make sure to put some form of rigid spacers between the mounting plates and the load cell. Standoffs or washers both work well. The goal is that any force applied to the moving plate causes the load cell to bend and twist. Without spacers, load would be transferred directly from the moving plate to the fixed plate without affecting the load cell.

Step 2: 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.

On aluminum load cells, multiple strain gauges are already wired together to for a Wheatstone bridge. All you need to do is connect the wires to the HX711 board in the correct orientation.

Step 3: 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 4: Calibrate and Weigh!

Picture of 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:

<p>/*<br> 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;
  }
}</p>

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

<p>/*<br> 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();
}</p>

Comments

megan_stapley (author)2017-10-18

Where did you buy your washers/standoffs?...I can't find any with a similar thickness

DegrawSt (author)megan_stapley2017-10-19

I buy all of my spacers from McMaster-Carr. They are affordable and have a good selection. The best for this project are Aluminum unthreaded spacers, 10 mm height.

https://www.mcmaster.com/#unthreaded-spacers/=19vtog2

johnnyfrx made it! (author)2017-10-11

This was a great project with great parts from DeGraw. I built this mainly to track the weight of our Bearded Dragon, but now I am weighing EVERYTHING just so I can play with my toy. You can check it out here: https://www.instructables.com/id/Arduino-Uno-HX711-Digital-Weight-Scale/

Mepod (author)2017-10-05

Hello. Can I use 100 g load cell for this?

DegrawSt (author)Mepod 2017-10-06

Yes, 100g load cells are usually wired the same way. It should work without any changes.

DavidG809 (author)2017-10-02

Good instruction
Question can this load cell only be used to measure downward force (as bath scale) what type do I need for a pull scale as used in a fish or supermarket hanging scale? I’ve never seen one used in that orientation

Thanks

DegrawSt (author)DavidG8092017-10-03

This type of load cell should only be used to measure force in the direction of the arrow on the front, but you could definitely flip it over to measure a pulling force. This would only really be good for a permanently mounted scale since the force is on a cantilever.

If you want to measure pulling force with a handheld device, you could follow most of the instructions but use "S type" load cell (https://www.aliexpress.com/item/YZC-516C-S-type-weighing-sensor-100kg-200kg-300kg-500kg-2000kg-1-Ton-2-Ton-pull/32768086816.html), this would be very accurate. You could also buy a cheap digital luggage scale and remove the load cell

DavidG809 (author)DegrawSt2017-10-03

Thank you! This points me towards the right direction.