Skip to main content

Serial Weighing Scale

Deprecated. This package is no longer maintained. Use serial-scale-hx711 (Arduino+HX711) or serial-scale-bench (RS-232/USB bench scales) instead.

Arduino-based cheap precision weighing scale for readout via serial communication.


Version: "3.0.0" (deprecation stub — no further updates)

Precision weighing scales that include serial port communication usually come at considerable cost. This project showcases an affordable alternative. Using readily available electronics parts, the scale's measurements can be read via serial communication by a simple Python class.

Note: The design could easily be extended with an Arduino display to show the measurements.

Bill of Materials

  • Arduino Uno (including USB-A to USB-B cable)
  • Load cell amplifier HX711 (Sparkfun), e.g. from mouser.co.uk: 474-SEN-13879
  • Load cell (100g and 500g cells used), e.g. from mouser.co.uk: 474-SEN-14727 or 474-SEN-14728
  • Jumper wires, pin headers, nylon spacers for electronics
  • Acrylic or other material of choice for case and load cell mount
  • HX711 arduino library from olkal/HX711_ADC

Build

  1. Load .ino onto Arduino (via Arduino IDE or commandline like arduino --board arduino:avr:uno --port /dev/ttyACM0 --upload serial_scale.ino)
  2. Assemble electronics, e.g. as described in this HX711 wiring tutorial
  3. Print 3D components from drawings (Drawings named model are only for design, no need to print these)
  4. Move electronics into case
  5. Calibrate scale via Arduino IDE serial monitor commands. See below for communication protocol for calibration.

Usage

  1. Connect scale via USB to machine that is going to read the measurements from the scale
  2. Interact via python SerialScale object:
Open connection with SerialWeighingScale object & perform standard operations on it
import numpy as np
import time

from serial_weighing_scale import SerialWeighingScale

serial_port = "/dev/ttyACM0"  # for Unix systems. "COM1" on Windows systems
scale = SerialWeighingScale(serial_port=serial_port)
scale.connect()

while not scale.is_ready:
    time.sleep(.1)

# Perform standard operations
scale.tare()  # Tare scale
scale.read_weight()  # Take single measurement
scale.read_weight_repeated(n_readings=5, inter_read_delay=.1)  # Get n readings
scale.read_weight_reliable(n_readings=5, inter_read_delay=.1, measure=np.mean)  # Get statistic of n readings
Open connection by testing specific serial ports sequentially
from serial_weighing_scale import connect_serial_scale

scale = connect_serial_scale(serial_port_list=["/dev/ttyACM0", "/dev/ttyACM1"])

# ...

Communication protocol for messages between python and Arduino

  • Tare scale: send "t" -> Tare scale & Arduino confirms with "t"

  • Read scale: send "w" -> Arduino returns latest reading

  • Read calibration factor: send "f" -> Arduino returns calibration factor

  • Calibrate scale: send "c" + weight of known mass

    • Arduino confirms by sending known mass value back
    • Send "a" once known mass was placed on scale -> Arduino performs calibration & returns new calibration factor that needs to be added to serial_scale.ino

TODO

  • Add calibration routine to .ino & .py
  • Add test curve to .py

NOTES

  • calibration for first scale with 28.22g weight: -3150
  • calibration for second scale with 28.22g weight: -2894

Contributors

Code & electronics by Lars Rollik. Scale 3D printing drawings by Simon Townsend (Advanced Manufacturing FabLabs, Sainsbury Wellcome Centre). Thanks to Benjamin Hahl for useful input on the design.

Metadata

Release files for serial-weighing-scale 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serial-weighing-scale 3.0.0
File Size Uploaded
serial_weighing_scale-3.0.0.tar.gz 5.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for serial-weighing-scale 3.0.0
File Interpreter ABI Platform
serial_weighing_scale-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 MB

Release files / serial_weighing_scale-3.0.0.tar.gz

Download URL serial_weighing_scale-3.0.0.tar.gz
Size 5.7 MB
Tags Source
SHA-256 checksum
How to use checksums
fe8be2502e2cc1d6952d35000ae4049afb19e6b7b302c528070ed0cf9fb5b0d0
BLAKE2b-256 checksum
How to use checksums
ccdad64797e7a920ee6dbd795d07c9585457a68ada23a246dbb31ff9c79a4ef1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / serial_weighing_scale-3.0.0-py3-none-any.whl

Download URL serial_weighing_scale-3.0.0-py3-none-any.whl
Size 5.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4d75411a1217ed185e4815d187be008d991195c26388f9da29b0e4c3d37f1c4f
BLAKE2b-256 checksum
How to use checksums
a777f51728cabfc479d274e1537b441cdc1f0105ccb40fbc3bccbe835aecbf0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.6

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page