Arduino Bathroom Scale With 50 Kg Load Cells and HX711 Amplifier

170,182

256

69

Introduction: 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/ If you do purchase the kit please leave a review! It is really helpful for future buyers.
  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

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

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

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 LOADCELL_DOUT_PIN  3
#define LOADCELL_SCK_PIN  2

HX711 scale;

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.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  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 LOADCELL_DOUT_PIN  3
#define LOADCELL_SCK_PIN  2

HX711 scale;

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

  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  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();
}

4 People Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

69 Discussions

1
LukeVincent
LukeVincent

Question 5 weeks ago

Great tutorial. I wired everything as instructed. However, the weight reading I get is constantly fluctuating. Sometimes increasing linearly with time. Sometimes decreasing. Sometimes all over. I'm trying to figure out where the problem is but I'm having some trouble. Is it more likely an issue with the load cells, wiring, HX711 amplifier, arduino? Thanks in advance for the help.

0
abdulbasituetuk
abdulbasituetuk

5 weeks ago

hi..how to use zero factor for permanent scale
because when the controller is reset, it scale the already placed object to zero

0
Harrisk6
Harrisk6

2 months ago

Is there a way to connect more than 4 load sensors?
I am working on an application that will measure the added cell of a couch.
If the couch is already (say...) 100kg and has 3 seats should i use 8-12 load sensors?
How would i connect them?
Or should i go for larger sensors (150kg each)?
Thank you

0
abhishek123451
abhishek123451

Question 3 months ago

Hello,
I want to measure the deflection or the strain induced at a particular load on the rod(member) . I want to attach 4 strain gauges to one rod to measure strain at different points. Can i do it? Can i attach 4 strain gauges to one HX711 . Can u plz help me with wiring and coding. I hope for ur priceless reply.

Thank you

0
auliarhman71
auliarhman71

3 months ago on Step 1

Hello....
I want to ask, if i use 4 pcs of 50 kg loadcell, the maximum weight will be 200 kg or still 50 kg?
Thkns...

0
perkhaus
perkhaus

Question 5 months ago

I'm still not clear about the physical mounting of the load cells... I want to measure the weight of something hanging. I plan to cut a small piece of copper tubing in half and epoxy on the sensor as a channel for nylon cord to rest in, but where exactly on the sensor should I mount the channel for best performance?

0
igggy17
igggy17

9 months ago

how to read measurements?
there is no display
can I read with cell phone?

0
perkhaus
perkhaus

Reply 5 months ago

You can...
1. easily read via the same USB serial port used to program the Arduino.
2. add an LCD display
3. add a wifi or ethernet shield and host a web page

0
wwzerbyzerby
wwzerbyzerby

5 months ago

I’m going to give it a try. This is a great starting place then I can add more features till I have a nice system of my own on all my hives

0
brycopter
brycopter

Question 1 year ago on Step 5

Hey everyone! Is it possible to configure this to only use one of the load cells and not run in a series? How would I go about doing that? Thanks!

0
semih.tavukcu16
semih.tavukcu16

1 year ago

Do we have to use 1K ohm resistors for connection? And also in my setup, when I put weight on the platform, value is getting higher for 2-3 seconds and then it starts to get lower stabily. And if a lift the weight, value is getting lower for a 2-3 seconds then again it starts to get higher stabily. Anyone have any idea why?

0
gberl001
gberl001

Reply 10 months ago

No, there are no 1k resistors needed. The project shows 1k resistors to show what's going on behind the scenes on the load sensor. The load sensor is created using a strain gauge which is technically two resistors where one resistor changes with the amount of strain put on the gauge.

The only electronics you need for this are the arduino, the load cells, and the HX711

0
greeninrit
greeninrit

1 year ago

Can it Measure 50gms Object?

0
gberl001
gberl001

Reply 10 months ago

Yes, you can read 50g, the fluctuation can be up to 10g from what I've seen but as long as you're fine with a 50g +/- 10g reading then this would be a good project for that.

0
JasonR102
JasonR102

Question 1 year ago

Good day and thank you for posting this.
Question: Is it possible to run multiple scales from a single arduino? Say I wanted to run 10 different scales by sharing the SCK, and poser lines while using a seperate pin for each data conection.

0
gberl001
gberl001

Answer 10 months ago

Hey JasonR102, if you're still looking for an answer, you wouldn't be able to share the same SCK and DOUT lines if that's what you wanted. You could certainly use different pins for each scale and that would work. The problem is there is no way to specify which sensor to read from, if you received a signal from a sensor you wouldn't know which one.

1
Asif2025
Asif2025

2 years ago

Ok, I made it. It worked for a few days but now it shows only zero value if any weight is placed or not. What do you think the problem is?

IMG_20181006_220444.jpgIMG_20181006_221512.jpgIMG_20181006_222015.jpg