Project Overview & Target Board
A weight sensor for Arduino relies on a strain gauge load cell paired with a 24-bit delta-sigma analog-to-digital converter (ADC). The microcontroller cannot read the microvolt-level changes from a Wheatstone bridge directly; it needs the HX711 amplifier chip to digitize the signal. This guide walks through wiring, calibration, and debugging a 50kg half-bridge load cell setup.
Difficulty Rating: Intermediate (Requires basic soldering and serial monitor calibration).
Estimated Time: 45 minutes.
Bill of Materials & Spec Sheet
Sourcing the correct variant of the HX711 board is the most common pitfall. In 2026, you will find two main colors on the market: green and red. Always buy the green board. Red boards frequently omit the copper trace for the E- (Excitation minus) pin, rendering them useless for standard 4-wire load cells without a messy bodge wire.
| Component | Exact Variant / Model | Key Specification | Approx. Cost |
|---|---|---|---|
| Microcontroller | Arduino Uno R3 (ATmega328P) | 5V Logic, 14 Digital I/O | $12 - $25 |
| ADC Module | HX711 Breakout (Green PCB) | 24-bit, 80 SPS, 128x Gain | $3 - $5 |
| Load Cell | 50kg Half-Bridge (CZL601 style) | Aluminum alloy, 4-wire, 1mV/V | $8 - $12 |
| Wiring | 22 AWG Stranded Hookup Wire | Low noise, flexible | $5 |
Wiring the Weight Sensor for Arduino
The physical connection is split into two stages: the load cell to the HX711, and the HX711 to the Arduino. Keep the wires between the load cell and the HX711 as short as possible (under 30cm) to prevent electromagnetic interference from corrupting the microvolt signals.
Load Cell to HX711 Pinout
Load cell wire colors can vary by manufacturer, but the 4-wire standard usually follows this scheme. Always verify with a multimeter if your datasheet is missing.
| Load Cell Wire | Function | HX711 Pin |
|---|---|---|
| Red | Excitation+ (E+) | E+ |
| Black | Excitation- (E-) | E- |
| White | Signal+ (A+) | A- |
| Green | Signal- (A-) | A+ |
Note: Swapping A+ and A- will simply invert your readings (negative weight when you push down). Swap them back if your scale reads backwards.
HX711 to Arduino Uno R3 Pin Mapping
| HX711 Pin | Arduino Uno R3 Pin | Notes |
|---|---|---|
| VCC | 5V | Do not exceed 5.5V or you will fry the LDO. |
| GND | GND | Must share a common ground with the Uno. |
| DT (Data) | D3 | Any digital pin works; D3 used in code below. |
| SCK (Clock) | D2 | Any digital pin works; D2 used in code below. |
Compilable Calibration & Reading Code
This code uses the widely adopted HX711 library by Bogdan Necula. Install it via the Arduino Library Manager (search "HX711 Arduino"). The script includes non-blocking error handling to prevent the microcontroller from hanging if the sensor disconnects.
#include <HX711.h>
// Pin definitions for Arduino Uno R3
const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;
HX711 scale;
// Calibration factor determined during setup
float calibration_factor = 21500.0;
void setup() {
Serial.begin(9600);
Serial.println("Initializing Weight Sensor for Arduino...");
// Initialize the HX711
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
// Tare the scale to zero with no weight on it
Serial.println("Taring... Ensure scale is empty.");
scale.tare();
Serial.println("Tare complete. Place known weight to calibrate.");
}
void loop() {
// Error handling: Check if HX711 is ready before reading
if (scale.is_ready()) {
scale.set_scale(calibration_factor);
float weight = scale.get_units(10); // Average 10 readings for stability
Serial.print("Weight: ");
Serial.print(weight, 2); // Print to 2 decimal places
Serial.println(" kg");
} else {
// Exact error string output when hardware fails to respond
Serial.println("HX711 timeout. Check wiring.");
}
// Allow serial commands for live calibration
if (Serial.available()) {
char temp = Serial.read();
if (temp == '+') calibration_factor += 100;
if (temp == '-') calibration_factor -= 100;
if (temp == 't') scale.tare();
Serial.print("Current factor: ");
Serial.println(calibration_factor);
}
delay(200); // 5Hz update rate
}
Debugging Common HX711 Errors
When building a weight sensor for Arduino, the serial monitor will inevitably throw errors if the physical layer is flawed. Here are the exact error strings and how to fix them.
Error 1: Serial prints Weight: nan
Meaning: The HX711 is communicating, but the math is failing, or the ADC is saturating. Ranked Causes:
- Calibration factor is zero or wildly wrong: If your
calibration_factoris set to 0, dividing by zero yields NaN. Start with a baseline of 21500 for a 50kg cell. - Load cell overloaded: You exceeded the 50kg physical limit, bending the aluminum past its elastic region. The Wheatstone bridge is now unbalanced beyond the HX711's 24-bit range.
- Missing E- connection: If using a red HX711 board without the E- trace, the bridge lacks a ground reference, resulting in floating garbage data that parses as NaN.
Error 2: Serial prints HX711 timeout. Check wiring.
Meaning: The Arduino sent a clock pulse, but the HX711 never pulled the DT (Data) line low to signal readiness. Ranked Causes:
- SCK and DT pins swapped: The most common bench mistake. Verify D2 is SCK and D3 is DT.
- Logic level mismatch: You are using an ESP32 or 3.3V Arduino without a level shifter. The HX711 requires a minimum of 4.5V on the SCK pin to recognize a logic HIGH.
- Dead HX711 chip: If VCC and GND were accidentally reversed for even a second, the internal LDO and digital core are fried. Replace the module.
Extending and Simplifying the Build
Depending on your end goal, you can modify this architecture.
How to Simplify: If you do not need raw data processing and just want a working digital scale for a DIY project, buy a pre-calibrated I2C Digital Scale Module (like the SparkFun Qwiic Scale). These boards include the HX711, an ATTiny85 pre-programmed with calibration firmware, and output weight directly over I2C, eliminating the need for the bogdan Necula library and manual serial calibration.
How to Extend: To make this a standalone bench scale, add an I2C OLED display (SSD1306 128x64) and a momentary pushbutton. Wire the button to a digital pin with an internal pull-up resistor. When pressed, trigger scale.tare(). Use the U8g2 library to render the weight variable in a large font on the screen, removing the need for a PC connection.
Frequently Asked Questions
Can I use a 3-wire load cell with the HX711?
Yes, but it requires a specific wiring trick. 3-wire load cells (often found in bathroom scales) are actually two half-bridge sensors wired in parallel with a shared center tap. You must wire the Red wire to E+, the White wire to A+, and tie both Black wires together to E- and A-. However, for precise Arduino projects, a 4-wire full-bridge or half-bridge cell is vastly superior for noise rejection.
Why is my weight sensor for Arduino drifting over time?
Drift is caused by three factors: thermal expansion, mechanical creep, and power supply noise. The HX711 is ratiometric, meaning it scales readings based on the excitation voltage. If your Arduino's 5V USB rail fluctuates (common with cheap PC USB ports), your weight reading will drift. Power the Arduino from a regulated 5V 2A wall adapter, and allow the load cell 5 minutes to thermally stabilize after powering on.
How do I connect multiple load cells to one HX711?
You cannot wire multiple independent 4-wire load cells to a single HX711 A-channel. If you are building a large platform scale with four 50kg load cells (one in each corner), you must use a Load Cell Combinator board. This PCB wires the four cells in a specific series-parallel configuration to create a single, unified Wheatstone bridge output that mimics one large 4-wire load cell, which then connects to your single HX711.
References:
1. SparkFun Load Cell Amplifier HX711 Hookup Guide
2. Arduino Official Documentation: Digital Pins






