How to Use the HX711 Load Cell Amplifier with Arduino

What Is a Load Cell and How Do Strain Gauges Work?

A load cell is a transducer — a device that converts a physical force (weight or pressure) into an electrical signal. Inside every load cell is one or more strain gauges: thin metallic foil resistors bonded to a flexible substrate. When weight is applied, the substrate bends, the foil stretches or compresses, and its electrical resistance changes by a tiny but measurable amount.

That resistance change is captured using a Wheatstone bridge circuit. Four resistors are arranged in a diamond (bridge) configuration. In a load cell, one or more of those resistors are the strain gauges themselves. When the bridge is balanced (no load), the output voltage is zero. Under load, the bridge goes out of balance and produces a differential voltage proportional to the applied weight.

The catch? That differential voltage is tiny — typically in the range of 1–3 millivolts per volt of excitation. With a 5 V supply, a 10 kg load cell might produce only 15 mV at full capacity. An Arduino’s built-in ADC cannot read signals this small accurately. That’s exactly where the HX711 comes in.

Why You Need the HX711 (Signal Amplification and 24-Bit ADC)

The HX711 is a dedicated load cell amplifier and analogue-to-digital converter (ADC). It was designed specifically for weighing applications and solves two problems at once:

  • Amplification: The HX711 has a programmable gain amplifier (PGA) with gains of 128x or 64x on channel A, and 32x on channel B. This brings the millivolt-level load cell signal up to a readable range.
  • High resolution ADC: Unlike the Arduino’s 10-bit ADC (1,024 steps), the HX711 uses a 24-bit ADC — that’s 16,777,216 steps. This gives you far greater sensitivity and precision.

The HX711 communicates with your Arduino over a simple two-wire serial interface (clock + data), making it easy to integrate without any special protocol libraries. You can pick up an HX711 load cell amplifier module that breaks out all the connections you need to get started.

Load Cell Types: Which One Should You Use?

Load cells come in several physical configurations. For Arduino projects, the most practical options are:

TypeShapeBest ForTypical Capacity
Beam (bending beam)Rectangular barPlatform scales, DIY projects1 kg – 200 kg
Button / discFlat discCompression measurement50 kg – 1000 kg
S-typeS-shapedTension and compression5 kg – 500 kg
Single-pointFlat beamOff-centre platform scales1 kg – 50 kg

For most beginner and intermediate projects — kitchen scales, postal scales, ingredient dispensers — a single-point beam load cell is the best starting point. It handles off-centre loads well, mounts easily between two flat surfaces, and pairs perfectly with the HX711. A high-precision strain gauge load cell is available in 1 kg, 5 kg, 10 kg, and 20 kg capacities — choose the one closest to your maximum expected weight for the best resolution.

Wiring a Beam Load Cell to the HX711 and Arduino

Load cells have four wires. The colour coding is fairly standard but can vary slightly between manufacturers. Always check the datasheet for your specific model. The common convention is:

Wire ColourFunctionHX711 Pin
RedExcitation positive (E+)E+
BlackExcitation negative (E−)E−
WhiteSignal positive (A+)A+
GreenSignal negative (A−)A−

Once the load cell is connected to the HX711 module, wire the HX711 to your Arduino:

HX711 PinArduino Pin
VCC5V
GNDGND
DT (Data)Digital Pin 3
SCK (Clock)Digital Pin 2

You can reassign DT and SCK to any available digital pins — just update the pin numbers in your sketch accordingly. An Arduino Uno R3 works perfectly for this project, and its 5 V output provides clean excitation voltage to the HX711.

Mounting tip: For a single-point load cell, the fixed end (with the mounting holes furthest from centre) attaches to a solid base, and the platform sits on the free end. The load cell flexes downward under weight — make sure it has clearance and isn’t resting on any surface mid-span.

Code Setup and Library Installation

The easiest way to interface with the HX711 is using Bogdan Necula’s HX711 Arduino Library, which is available directly from the Arduino Library Manager.

To install it:

  • Open the Arduino IDE.
  • Go to Sketch → Include Library → Manage Libraries.
  • Search for HX711 Arduino Library by Bogdan Necula.
  • Click Install.

Once installed, include it at the top of your sketch:

#include <HX711.h>

// Define the HX711 data and clock pins
const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;

HX711 scale;

void setup() {
  Serial.begin(57600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}

void loop() {
  if (scale.is_ready()) {
    long reading = scale.read();
    Serial.print("Raw reading: ");
    Serial.println(reading);
  } else {
    Serial.println("HX711 not found. Check wiring.");
  }
  delay(500);
}

Upload this sketch and open the Serial Monitor at 57600 baud. You should see large, stable raw numbers changing as you apply pressure to the load cell. If the reading is zero or stuck, check your wiring and confirm the HX711 power LED is on.

Calibration Procedure: Tare and Known Weight

Raw ADC values are meaningless on their own. Calibration converts them into grams or kilograms by finding a calibration factor — the number of raw units that correspond to one unit of weight.

Step 1: Tare (Zero the Scale)

Taring removes the weight of the platform or any object sitting on the scale at startup. The HX711 library handles this with scale.tare(), which reads the average of several samples and stores it as the zero offset.

Step 2: Find the Calibration Factor

Place a known weight on the scale (e.g. a 500 g calibration weight or a household item you’ve weighed on a trusted scale). Read the raw value with the known weight, then subtract the tared zero reading. Divide by the known weight in your desired unit to get the calibration factor.

#include <HX711.h>

const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;

HX711 scale;

// Replace this value after calibration
float calibration_factor = -7050.0;

void setup() {
  Serial.begin(57600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);

  Serial.println("Taring... Remove any weight from the scale.");
  delay(3000);
  scale.tare(); // Zero the scale
  Serial.println("Tare complete. Place known weight now.");
}

void loop() {
  scale.set_scale(calibration_factor);

  Serial.print("Weight: ");
  Serial.print(scale.get_units(10), 2); // Average of 10 readings
  Serial.println(" kg");
  delay(1000);
}

To find your calibration_factor: comment out scale.set_scale(), read the raw value with a known weight on the scale, then calculate:

calibration_factor = raw_reading_with_weight / known_weight_in_kg

Adjust the sign if your readings come out negative — this simply reflects which direction the load cell bends relative to your wiring polarity.

Reading Weight and Printing to Serial

With calibration complete, reading weight is straightforward. The get_units() function returns the averaged, scaled value in whatever unit you calibrated against:

#include <HX711.h>

const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;
const float CALIBRATION_FACTOR = -7050.0; // Your calibrated value

HX711 scale;

void setup() {
  Serial.begin(57600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.set_scale(CALIBRATION_FACTOR);
  scale.tare();

  Serial.println("Scale ready. Place an object to weigh it.");
}

void loop() {
  if (scale.is_ready()) {
    float weight = scale.get_units(10); // Average 10 readings
    Serial.print("Weight: ");
    Serial.print(weight, 3);
    Serial.println(" kg");
  }
  delay(500);
}

The argument passed to get_units() controls how many ADC readings are averaged before returning a value. Higher values (10–20) give smoother, more stable readings but increase response time. For a kitchen scale, 10 is a good balance.

Building a Simple Scale Project

Once you have stable, calibrated readings, it’s easy to extend the project into a functional scale. A common next step is adding an I2C LCD display to show the weight without a computer connected. Here is an outline of the complete project:

  • Hardware: Arduino Uno, HX711 module, beam load cell (e.g. 5 kg), I2C 16×2 LCD, two flat acrylic or plywood panels, M3 bolts for mounting the load cell.
  • Platform: Mount the load cell between the two panels. The bottom panel is your base; the top is the weighing surface. Ensure the load cell has 3–5 mm clearance above the base to flex freely.
  • Tare button: Wire a momentary push button between a digital pin and GND (use INPUT_PULLUP). When pressed, call scale.tare() to rezero — useful for taring a container before adding ingredients.
  • Display: Use the LiquidCrystal_I2C library to print weight to the LCD. Update every 250–500 ms for a responsive feel.
// Simplified loop with LCD and tare button
void loop() {
  if (digitalRead(TARE_PIN) == LOW) {
    scale.tare();
    lcd.clear();
    lcd.print("Tared!");
    delay(1000);
  }

  float weight = scale.get_units(10);
  lcd.setCursor(0, 0);
  lcd.print("Weight:         ");
  lcd.setCursor(0, 1);
  lcd.print(weight, 2);
  lcd.print(" kg         ");
  delay(300);
}

This is the foundation of a fully self-contained digital scale. Add a 9 V battery or USB power bank and you have a portable, wireless weighing solution.

Accuracy Tips and Common Mistakes

Getting accurate, repeatable readings from a load cell setup requires attention to both hardware and software. Here are the most impactful improvements you can make:

Hardware Tips

  • Mounting matters most. The load cell must be rigidly fixed at its base and free to flex at its sensing end. Any movement of the base panel will cause erratic readings.
  • Keep the load centred. Single-point load cells are designed for off-centre loads but still perform best near the centre of the platform. For corner-supported platforms, use four matched load cells in a summing configuration.
  • Avoid vibration. Place the scale on a stable, level surface. Vibration introduces noise that no amount of averaging can fully remove.
  • Temperature drift: Load cells have a temperature coefficient. For laboratory-grade accuracy, allow the setup to reach thermal equilibrium before calibrating and measuring.

Software Tips

  • Average more readings. Increasing get_units() from 5 to 20 samples significantly reduces noise, especially if you’re measuring slow, static loads.
  • Re-tare after power-up. Always tare with nothing on the scale. Skipping this step is the most common cause of incorrect readings.
  • Recalibrate when the setup changes. If you change the platform, move the load cell, or operate in a significantly different temperature, recalibrate.
  • Don’t exceed capacity. Overloading a load cell permanently deforms the strain gauges. Choose a load cell capacity at least 20% above your maximum expected weight.

Common Mistakes to Avoid

  • Using a USB hub or noisy PC USB port as power — try a dedicated 5 V supply if readings are unstable.
  • Soldering directly to the HX711 module pins without strain relief on the load cell wires — vibration can crack solder joints over time.
  • Confusing grams and kilograms in the calibration factor — your reading will be off by a factor of 1,000.
  • Not checking scale.is_ready() before reading — if the HX711 is still converting, you’ll get stale data.

Wrapping Up

The HX711 and a beam load cell are one of the most cost-effective ways to add precise weight measurement to any Arduino project. Once you understand the underlying Wheatstone bridge principle, the wiring is straightforward, the library handles all the low-level communication, and calibration takes just a few minutes with a known weight.

From here you can go further — logging weight data to an SD card, sending readings over Wi-Fi with an ESP32, triggering relays when a threshold is reached, or building a multi-cell platform scale. The fundamentals covered in this guide apply to all of those projects.

To get started, you’ll need the three key components: the HX711 load cell amplifier module, a precision strain gauge load cell in the capacity that suits your application, and an Arduino Uno R3 to tie it all together. Happy building.

Leave a Reply

Your email address will not be published. Required fields are marked *