radeye-b20
A small Python driver for the Thermo Scientific RadEye B20 handheld radiation survey meter.
The RadEye B20 streams live readings over its infrared read-head, but the serial protocol is undocumented and — as far as I can tell — no public library speaks it. This one does. It was reverse-engineered by watching the wire and checking decoded values against the meter's own display, so it's honest about what it can and can't do (see Limitations).
from radeye_b20 import RadEye
with RadEye() as meter: # auto-detects the IR-USB cable
for reading in meter.stream():
print(reading.value, reading.unit) # e.g. 3.51 cps
Install
pip install radeye-b20
Or from source:
git clone https://github.com/navyasharmabits/radeye-b20
cd radeye-b20
pip install -e .
Requires Python 3.8+ and pyserial. Works on Linux, macOS, and Windows (the
meter appears as a normal USB serial port).
Command line
radeye ports # list serial ports, flag the likely RadEye
radeye stream # live readings until Ctrl+C
radeye stream --csv # timestamp,value,unit (pipe to a file)
radeye stream --port /dev/ttyUSB0 --scale-cps 0.01
Library
from radeye_b20 import RadEye, find_port
print(find_port()) # '/dev/ttyUSB0' or None
with RadEye(port="auto", scale_cps=0.01, scale_cpm=0.1) as meter:
r = meter.read() # one reading, or None on a skipped frame
if r:
print(r.value, r.unit, r.timestamp, r.checksum)
Each Reading carries the scaled value, the unit ("cps", "cpm", or
"code:<n>" for anything unverified), a unix timestamp taken at decode time,
the raw integer digits, the unit code, the trailing checksum token, and
the cleaned raw frame text.
How it works
The meter sends fixed ASCII frames at 9600 baud, 7 data bits, even parity, 1
stop bit (7E1), each framed by STX … ETX CR LF. A decoded frame looks like:
351 5 0 0 04 FH41B2 0 42
| | | └─ checksum (algorithm unknown — exposed, not verified)
| | └───────── device / probe tag
| └────────────────────── unit code: 5 = cps, 3 = cpm
└────────────────────────── value digits (decimal point implied by the unit)
There's no decimal point on the wire, so the integer is scaled per unit
(cps × 0.01, cpm × 0.1). The cable is a Prolific PL2303, which the driver
auto-detects by USB vendor ID / by-id symlink, and whose occasional
zero-length-read glitches it tolerates without dropping the connection.
Limitations
I'd rather you know these up front than discover them:
- Reverse-engineered, not from a spec. Verified against one meter's display.
- Only cps and cpm are trusted. Other unit/range modes are surfaced as
code:<n>and passed through unscaled — the meter has modes I couldn't test, and I won't pretend the scaling for those is right. - The checksum is not verified. The algorithm is unknown; the field is exposed so you can experiment, but frames aren't validated against it.
- Scaling may be meter-dependent. If readings are off by a constant factor,
check against the display and set
scale_cps/scale_cpmaccordingly.
⚠️ Not for safety-critical use
This is a hobbyist/research convenience for logging and visualisation. It is not calibrated, validated, or certified, and must not be relied on for radiation-safety decisions, dose assessment, or any situation where a wrong or missing reading could harm someone. For that, use the instrument's own display and your organisation's approved procedures.
Contributing
If you have a RadEye B20 and can capture frames in a mode this doesn't handle (especially dose-rate / µSv·h⁻¹ modes), a sample of raw frames alongside the displayed value is exactly what's needed to extend it. Open an issue or PR.
License
MIT © Navya Sharma
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 radeye_b20-0.1.0.tar.gz.
File metadata
- Download URL: radeye_b20-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93881ce1b616605f03e3dd82dc9c5bda3631b20188c89499f00d05bd24b264e3
|
|
| MD5 |
c6675c5e100879eace09dfa1967989ce
|
|
| BLAKE2b-256 |
de2467cb2a2189de1a5da2a7be51060d5c2c6d7ca732b3bb99d816050349edbc
|
Provenance
The following attestation bundles were made for radeye_b20-0.1.0.tar.gz:
Publisher:
publish.yaml on navyasharmabits/radeye-b20
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radeye_b20-0.1.0.tar.gz -
Subject digest:
93881ce1b616605f03e3dd82dc9c5bda3631b20188c89499f00d05bd24b264e3 - Sigstore transparency entry: 2221453234
- Sigstore integration time:
-
Permalink:
navyasharmabits/radeye-b20@b19e8e07a742e94cb27684dc61e69608d1fbf58f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/navyasharmabits
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b19e8e07a742e94cb27684dc61e69608d1fbf58f -
Trigger Event:
release
-
Statement type:
File details
Details for the file radeye_b20-0.1.0-py3-none-any.whl.
File metadata
- Download URL: radeye_b20-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0dda6d098ee12aaead8b546e9e75356d2b2b52792c8610f818831cf99cadf52
|
|
| MD5 |
e8dbdb671cbf91154ff6a7bc35f24c5b
|
|
| BLAKE2b-256 |
82f156fe8d01fac75620e1e0f65bfb03b6a0d02dd7b9912f8f704d9030c0e63b
|
Provenance
The following attestation bundles were made for radeye_b20-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on navyasharmabits/radeye-b20
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
radeye_b20-0.1.0-py3-none-any.whl -
Subject digest:
f0dda6d098ee12aaead8b546e9e75356d2b2b52792c8610f818831cf99cadf52 - Sigstore transparency entry: 2221454012
- Sigstore integration time:
-
Permalink:
navyasharmabits/radeye-b20@b19e8e07a742e94cb27684dc61e69608d1fbf58f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/navyasharmabits
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b19e8e07a742e94cb27684dc61e69608d1fbf58f -
Trigger Event:
release
-
Statement type: