Arduino HX711 Library Load Cell: Wiring, Code and Simulator

To build this Arduino HX711 Library Load Cell project you need an Arduino Uno and an HX711 load cell amplifier. The HX711 library reads the raw 24-bit value from a load-cell amplifier. Make the 4 connections in the wiring table, upload the Arduino C++ code, and change the weight on the scale, then add scale.tare() and set_scale() to show grams.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
1HX711 load cell amplifierDT goes LOW when a reading is ready; 25 SCK pulses clock out 24 bits, MSB first. The reading is grams × 100.

Wiring

#FromTo
1Arduino Uno 5VHX711 load cell amplifier VCC
2Arduino Uno GNDHX711 load cell amplifier GND
3Arduino Uno pin 3HX711 load cell amplifier DT
4Arduino Uno pin 2HX711 load cell amplifier SCK

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add an HX711 load cell amplifier from the parts palette.
  3. Wire 1. Connect Arduino Uno 5V to HX711 load cell amplifier VCC.
  4. Wire 2. Connect Arduino Uno GND to HX711 load cell amplifier GND.
  5. Wire 3. Connect Arduino Uno pin 3 to HX711 load cell amplifier DT.
  6. Wire 4. Connect Arduino Uno pin 2 to HX711 load cell amplifier SCK.
  7. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  8. Run it. Press Run. Change the weight on the scale, then add scale.tare() and set_scale() to show grams.

Arduino C++ code

// HX711 (bogde): read a load cell. DT on 3, SCK on 2.
#include <HX711.h>

HX711 scale;

void setup() {
  Serial.begin(9600);
  scale.begin(3, 2);
}

void loop() {
  if (scale.is_ready()) {
    Serial.print("Raw: ");
    Serial.println(scale.read());
  }
  delay(300);
}

What to try

Change the weight on the scale, then add scale.tare() and set_scale() to show grams.

Frequently asked questions

How do I wire the HX711 Library Load Cell project on an Arduino Uno?

Make 4 connections: Arduino Uno 5V to HX711 load cell amplifier VCC; Arduino Uno GND to HX711 load cell amplifier GND; Arduino Uno pin 3 to HX711 load cell amplifier DT; Arduino Uno pin 2 to HX711 load cell amplifier SCK.

What parts do I need for this Arduino project?

An Arduino Uno and an HX711 load cell amplifier.

Can I simulate this Arduino project online for free?

Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.

What does the code do?

The HX711 library reads the raw 24-bit value from a load-cell amplifier.

More Arduino Uno projects