https://github.com/raleighlittles/uss-dbs-driver
A Linux keyboard driver for the US Solid Precision Balance scales (USS-DBS28-30)
https://github.com/raleighlittles/uss-dbs-driver
rs232 uinput us-solid-precision-balance-scale uss-dbs28-30 weighing-scales
Last synced: over 1 year ago
JSON representation
A Linux keyboard driver for the US Solid Precision Balance scales (USS-DBS28-30)
- Host: GitHub
- URL: https://github.com/raleighlittles/uss-dbs-driver
- Owner: raleighlittles
- Created: 2022-09-14T05:53:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-01T05:59:08.000Z (over 3 years ago)
- Last Synced: 2025-01-26T14:52:17.985Z (over 1 year ago)
- Topics: rs232, uinput, us-solid-precision-balance-scale, uss-dbs28-30, weighing-scales
- Language: C++
- Homepage:
- Size: 8.54 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README

# Context
I got my hands on a [semi-advanced weighing scale](https://ussolid.com/100-x-0-001g-analytical-balance-1-mg-digital-lab-precision-scale.html) but unfortunately, the 'UNIT' button (and part of the display) didn't work, so I couldn't change units on the device. To make things worse, I found out the scale didn't natively support milligrams. I wanted to see if I could use software to remedy these issues...
# About
This program is a wrapper around the RS-232 interface implemented by the USS-DBS Digital Analytical Balance Scale. The scale transmits measurements via RS-232 through a USB B connector on the side. My program listens over the serial port to measurements received, and can:
* convert them to any desired unit
* log the measurements (and the time the measurement was received) to a CSV file
* transmit the measurement as keyboard input via [`uinput`](https://kernel.org/doc/html/v4.12/input/uinput.html), i.e. which allow you to treat the scale as a keyboard
# Installation
The program is written in C++ (since it requires the `uinput` interface) and is built via C-Make.
```bash
$ cmake CMakeLists.txt && make
```
# Usage
```
Usage: ./us_solid_precision_balance_driver
-h Shows this help text
-u [unit name] Measurements will be converted to the specified unit. (See manual for supported unit descriptions)
-o [filename] Logs measurements to the specified CSV file
-k Prints measurements from the keyboard directly. Only recommended in single-measurement mode (otherwise it'll be noisy)
```
# Output
Here's an example of the output you'll see:
```
[DEBUG] User specified unit: lb
[DEBUG] User requested output to output-file.csv
[DEBUG] Measurement received: 0.676918
[DEBUG] Current Time = Fri Sep 30 22:30:03 2022
[DEBUG] Measurement received: 0.676918
[DEBUG] Current Time = Fri Sep 30 22:30:03 2022
```
A few lines of the CSV file created:
```
'Measurement Time' , 'Measurement Value (Units = g)'
307.72 , Fri Sep 30 22:08:11 2022
307.72 , Fri Sep 30 22:08:11 2022
307.72 , Fri Sep 30 22:08:11 2022
307.72 , Fri Sep 30 22:08:11 2022
```
# Contributing/Notes
The `docs` folder contains information about the format of the data sent by the scale, as well as the product manual.
Note that the scale has 2 modes, a "continuous" mode and a "single-measurement" mode. The continuous mode will poll the scale very rapidly, so be careful using it if you have either the keyboard or output file set.