Weight / Load Cell
Interfacing HX711 + Load Cell Weight / Load Cell with Raspberry Pi
What is the HX711 + Load Cell?
HX711 + Load Cell practical reference
The HX711 is a 24-bit precision analog-to-digital converter (ADC) chip designed specifically for weigh-scale and industrial control applications. It amplifies and digitizes the tiny differential voltage produced by a load cell's Wheatstone bridge, turning raw strain-gauge signals into a clean digital reading a microcontroller can use. Paired with a bar-type or button load cell, it's the standard combo for building a DIY digital kitchen scale, a bench scale, or a weight-triggered trigger for automation projects.
Key specifications
- ADC resolution: 24-bit
- Operating voltage: 2.6V–5.5V (module regulator allows 5V logic and supply)
- Operating current: ~1.5 mA active, <1 µA in power-down
- Sample rate: 10 SPS or 80 SPS, selectable via the RATE pin
- Input channels: Channel A (gain 128 or 64), Channel B (gain 32)
- Interface: Simple 2-wire synchronous serial (DT/SCK, bit-banged — no dedicated hardware peripheral needed)
- Load cell type: Any 4-wire Wheatstone-bridge load cell (bar, S-type, button, or half-bridge pair)
- Typical load cell range: 1 kg, 5 kg, 10 kg, 20 kg, or 50 kg bar cells are the most common hobbyist sizes
Pinout and connection notes
Most breakout boards label the load cell terminal block as E+/E-/A+/A- and expect the standard 4-wire color code (red=E+, black=E-, white=A+, green=A-); some load cells swap green/white, so if readings are unstable or negative, try swapping A+ and A-. Channel B (B+/B-) is present on the HX711 IC itself but is rarely broken out on cheap modules.
- VCC: Power, 2.6–5.5V DC
- GND: Ground
- DT: Data output — serial data line, read by the microcontroller
- SCK: Serial clock input — clocks out each data bit and also selects gain/channel via pulse count
- E+: Load cell excitation positive — wire to the load cell's red wire
- E-: Load cell excitation negative — wire to the load cell's black wire
- A+: Channel A positive input — wire to the load cell's white wire
- A-: Channel A negative input — wire to the load cell's green wire
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up HX711 + Load Cell with Raspberry Pi
Library
hx711 (Python, gandalf15/HX711 or similar) by Community-maintained
pip3 install hx711 (or clone a maintained GitHub port — check current activity before picking one, this ecosystem has several forks)
Wiring
| Component pin | Raspberry Pi pin | Note |
|---|---|---|
| VCC | 3.3V (physical pin 1) | |
| GND | GND | |
| DT | GPIO5 (physical pin 29) | |
| SCK | GPIO6 (physical pin 31) | |
| E+ | Load cell red wire | |
| E- | Load cell black wire | |
| A+ | Load cell white wire | |
| A- | Load cell green wire |
Swipe sideways to see every column →
- The Python HX711 library ecosystem is fragmented across several community forks with different APIs — the exact method names above match the "hx711" package, but check your installed version's docs if a call doesn't match.
- Same tare/known-weight/divide calibration workflow as the other boards; this raw-units script is a calibration starting point, not a finished scale.
- Since this is a bit-banged protocol read in Python (not a dedicated peripheral), expect noisier timing than on a microcontroller — averaging more samples helps.
Related Components
Related Guides & Projects
Raspberry Pi Pico W and Pico 2 W: Install MicroPython with Thonny or UF2
Hold BOOTSEL, drag the correct UF2 file, open the REPL and blink the onboard LED. Includes the Pico vs Pico W vs Pico 2 W firmware differences and what to do when the drive does not appear.
Raspberry Pi Pico W Web Server in MicroPython: Control an LED and Read a Sensor
Connect the Pico W to WiFi, serve a responsive control page, switch an LED and display the onboard temperature or an external sensor, with timeouts and reconnect handling.
Raspberry Pi Pico Oscilloscope with MicroPython
Convert a Raspberry Pi Pico into a basic 500 kSPS oscilloscope using its 12-bit ADC and MicroPython. Displays waveforms on an SSD1306 OLED or streams samples over USB serial to a Python plotter on your PC.
Self-Hosted Nextcloud NAS on Raspberry Pi 4
Build a private, durable Nextcloud NAS on a Raspberry Pi 4 -- SSD boot instead of a failure-prone SD card, Docker Compose with Redis caching, Tailscale for remote access with zero ports forwarded, and an automated backup strategy that actually runs.