Skip to content

HX711 load cell driver for Raspberry Pi Pico (RP2350) using PIO and the Pico SDK.

License

Notifications You must be signed in to change notification settings

Tinymaxi/hx711-pico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VS Code Release License: MIT

hx711-pico

C++ driver for the hx711 24-bit ADC using the Raspberry Pi Pico (RP2350) and the Pico SDK.
The hx711 is commonly used with load cells to build digital scales.
This repository provides a modern C++ class for the Pico, plus calibration examples.


✨ Features

  • Supports the HX711 24-bit ADC for load cells
  • Fixed configuration: Gain = 128, Output Rate = 10 samples per second (SPS)
  • Simple calibration routine with tare and scale factor
  • Example applications included:
    • Calibration
    • Raw sensor value reading
    • Saving the calibration to flash memory enablig weighin without new calibratin after powering back on.
  • Compatible with Raspberry Pi RP2350 and Pico SDK (CMake build system)
  • Uses RP2350’s Programmable I/O (PIO) for efficient sampling
  • Parallel reads: Each RP2350 PIO block can run four state machines, allowing up to four HX711 load cells to be read in parallel
  • Optional trimmed moving average filter: removes the highest and lowest values in a window to smooth noisy readings while maintaining 10 SPS output rate

📜 License

This project is licensed under the MIT License.

  • Parts of this code are derived from Rob Tillaart’s hx711 library,
    Copyright (c) 2019-2025 Rob Tillaart, MIT License.
  • Parts of this code are derived from Daniel Robertons hx711 PIO,
    Copyright (c) 2020 Daniel Robertson, MIT License.
  • Additions and Pico-specific code
    Copyright (c) 2025 Max Penfold, MIT License.

Info

cpg is counts per gram. grams = (raw - offset) / cpg

About

HX711 load cell driver for Raspberry Pi Pico (RP2350) using PIO and the Pico SDK.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published