The HX711 is a widely used, low-cost 24-bit analogue-to-digital converter (ADC) integrated circuit with an internal amplifier, specifically designed to interface directly with bridge sensors such as load cells and strain gauges.
It is a popular component for DIY and commercial weighing-scale projects using microcontrollers such as Arduino and Raspberry Pi.
Key Features
Applications
The primary application of the HX711 is to build precise weight and force measurement systems.
Using the HX711 with a load cell is a common method for building digital scales or force measurement systems due to its simplicity, low cost, and high precision. The process involves correctly wiring the load cell's four wires to the HX711 board, connecting the board to a microcontroller, using a library, and performing a simple calibration.
The HX711 is purpose-built to interface with Wheatstone bridges, which are the internal circuits of load cells and strain gauges. It provides the necessary excitation voltage to power the bridge and precisely measures the resulting minute differential voltage changes.
Wiring the Components
A standard four-wire load cell uses a color-coded system to identify the wires for excitation voltage and the output signal.
Load Cell to HX711 Connections
Connect the load cell wires to the corresponding terminals on the HX711 board:
If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.
Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.
The HX711 module is a 24-bit ADC meant for weight scales, serving as an interface between a load cell (bridge sensor) and a microcontroller. It usually features two pin sets: one for connecting the load cell (input) and another for the microcontroller (output).
| Pin Label | Name | Description | Typical Wire Colour |
|---|---|---|---|
| E+ | Excitation Positive | Positive supply to the load cell. | Red |
| E- | Excitation Negative | Ground/Negative supply to the load cell. | Black |
| A- | Channel A Negative | Negative differential signal input from the load cell. | White |
| A+ | Channel A Positive | Positive differential signal input from the load cell. | Green |
| B- | Channel B Negative | Secondary input channel (lower priority/gain). | — |
| B+ | Channel B Positive | Secondary input channel (lower priority/gain). | — |
| Vcc | Supply Voltage | Power supply for the module (2.7V to 5.5V). | — |
| GND | Ground | Common circuit ground. | — |
| DT / DAT | Data Out | Serial data output to the microcontroller. | — |
| SCK / CLK | Serial Clock | Clock signal input from the microcontroller. | — |
Key Connection Notes
To get started, you'll need the HX711 Arduino Library by bogde, which is the community standard. You can install it directly via the Arduino Library Manager.
Software Setup and Calibration
You will need a library to easily communicate with the HX711 using your microcontroller. The HX711 library by Bogdan Necula is a popular, well-maintained option available in the Arduino Library Manager.
Wiring Diagram
| HX711 Pin | Arduino Pin |
|---|---|
| VCC | 5V (or 3.3V) |
| GND | GND |
| DT (Data) | D3 |
| SCK (Clock) | D2 |
Basic Reading & Calibration Code
This script initialises the scale, “tares” it (sets it to zero), and reads the weight.
#include "HX711.h" // Pin definitions const int LOADCELL_DOUT_PIN = 3; const int LOADCELL_SCK_PIN = 2; HX711 scale; void setup() { Serial.begin(57600); Serial.println("Initializing the scale..."); scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); // --- CALIBRATION --- // 1. Upload this code with scale.set_scale() empty or set to 1. // 2. Put a known weight (e.g. 100g) on the scale. // 3. Divide the raw reading by the known weight to find this factor. scale.set_scale(2280.f); // Replace 2280.f with your calculated calibration factor scale.tare(); // Reset the scale to 0 Serial.println("Scale ready!"); } void loop() { if (scale.is_ready()) { long reading = scale.get_units(10); // Average of 10 readings Serial.print("Weight: "); Serial.print(reading); Serial.println(" g"); } else { Serial.println("HX711 not found."); } delay(1000); }
Critical Tips
This page has been accessed for: Today: 4, Until now: 218