Python driver for Arduino+HX711 serial weighing scales.
Project description
serial-scale-hx711
Python driver for Arduino+HX711 serial weighing scales.
Renamed from
serial-weighing-scale(PyPI:serial-weighing-scale≤ 2.0.4). New releases publish underserial-scale-hx711. A deprecation stub remains on PyPI under the old name pointing here.
Hardware
- Arduino Uno (USB-A to USB-B cable)
- HX711 load cell amplifier (e.g. SparkFun SEN-13879)
- Load cell 100 g or 500 g (e.g. SEN-14727 / SEN-14728)
- Firmware: see
scale_firmware/(uses olkal/HX711_ADC)
The scale identifies itself as <SerialWeighingScale> over 115200 baud.
Install
pip install serial-scale-hx711
Or editable from this repo:
pip install -e .
Usage
from serial_scale_hx711 import Scale
scale = Scale(serial_port="/dev/ttyACM1")
scale.start() # connect and wait for firmware init
scale.tare()
weight = scale.read_weight_blocking() # grams, blocks until stable
scale.disconnect()
Auto-detect port
from serial_scale_hx711 import connect_serial_scale
scale = connect_serial_scale(["/dev/ttyACM0", "/dev/ttyACM1", "/dev/ttyACM2"])
API
| Method | Description |
|---|---|
start(timeout=10) |
Connect and wait for firmware ready |
tare() |
Zero the scale |
read_weight() |
Single reading (float or None) |
read_weight_blocking(n_valid, timeout) |
Block until N valid readings, return median |
read_weight_reliable(n_readings, measure) |
Repeated reads with custom aggregation |
identify() |
True if firmware responds with identity string |
get_calibration_factor() |
Read calibration factor from firmware |
disconnect() |
Close serial connection |
murineshiftwork integration
Used via murineshiftwork.logic.scale.SerialWeighingScaleAdapter. Install with:
pip install "murineshiftwork[calibration]"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serial_scale_hx711-2.1.1.tar.gz.
File metadata
- Download URL: serial_scale_hx711-2.1.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9574d492b99109071ba2bd542fbc82920a21106cc0377a84d6689c880d0183ae
|
|
| MD5 |
8d30b10680132cde632978e69054e123
|
|
| BLAKE2b-256 |
583eba6e54fe9bc4d9f0a751d211a12874e7993cddac2521ad90795ad19aef01
|
Provenance
The following attestation bundles were made for serial_scale_hx711-2.1.1.tar.gz:
Publisher:
release.yml on MurineShiftWork/serial-scale-hx711
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
serial_scale_hx711-2.1.1.tar.gz -
Subject digest:
9574d492b99109071ba2bd542fbc82920a21106cc0377a84d6689c880d0183ae - Sigstore transparency entry: 1660103315
- Sigstore integration time:
-
Permalink:
MurineShiftWork/serial-scale-hx711@31c6eb7cbfb9dc375f1df900ec95049ea88e8119 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MurineShiftWork
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31c6eb7cbfb9dc375f1df900ec95049ea88e8119 -
Trigger Event:
push
-
Statement type:
File details
Details for the file serial_scale_hx711-2.1.1-py3-none-any.whl.
File metadata
- Download URL: serial_scale_hx711-2.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1186718858220c7381cc1e0ef0794354bcf6756ed0385fb88364e25a93a2a7e7
|
|
| MD5 |
42264a877df22f92b81e5c1e25a78182
|
|
| BLAKE2b-256 |
1d99c7e185fcc521e8ebe726e11ad505e97dbfc632b650ac628882266a194f07
|
Provenance
The following attestation bundles were made for serial_scale_hx711-2.1.1-py3-none-any.whl:
Publisher:
release.yml on MurineShiftWork/serial-scale-hx711
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
serial_scale_hx711-2.1.1-py3-none-any.whl -
Subject digest:
1186718858220c7381cc1e0ef0794354bcf6756ed0385fb88364e25a93a2a7e7 - Sigstore transparency entry: 1660103412
- Sigstore integration time:
-
Permalink:
MurineShiftWork/serial-scale-hx711@31c6eb7cbfb9dc375f1df900ec95049ea88e8119 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MurineShiftWork
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31c6eb7cbfb9dc375f1df900ec95049ea88e8119 -
Trigger Event:
push
-
Statement type: