Repository navigation
Calibration and Data
Each GM board calculates its reported dose using its own firmware coefficients. The backend register map historically calls the rate dose_level_msvh and accumulated dose dose_msv; the current application labels the interpreted readouts dose_level_usvh (µSv/h) and dose_accumulated_usv (µSv). It does not calculate a physically calibrated dose from pulses, and the accumulated-dose scale has not been independently verified. The committed coefficient sets are dashboard/calibration/gm1-dose.json and gm2-dose.json. They are not applied automatically by the installer.
The calibration JSON holds seven coefficient/exponent pairs per board. Its labels 11–24 are one-based labels for zero-based Modbus holding addresses 10–23. On the reference Pi, both boards' coefficient blocks were read back after programming in October 2026. Readback confirms register values, not physical dose accuracy. A reference instrument and an appropriate calibration procedure are needed to establish physical accuracy. An accumulated-dose register is not reset when coefficients change, so it may include values produced under earlier settings.
To preview a board's current block against the committed file, stop Node-RED so the tool has exclusive use of /dev/serial0, run it without --apply, then restart Node-RED:
sudo systemctl stop nodered
cd ~/node-red-dosimeter-gate/dashboard
../nlab-modbus-devices/.venv/bin/python scripts/set_gm_dose_calibration.py --unit 1
sudo systemctl start noderedUse --unit 2 for GM 2. The tool writes only with --apply; before writing it checks identity and external RS485 baud, saves a private backup of the 14 existing holding-register values, writes changed words, and verifies readback. Follow the dashboard operating notes before applying coefficients.
The board's pulses input register is an unsigned 16-bit counter (0–65,535). The reader adds successive modulo-65,536 changes into a separate Pi-side total_pulses value for each board. Totals and last register words are saved under ~/.local/state/dosimeter-gate/ about every ten seconds and on clean shutdown. A new state file starts from zero; earlier board pulses cannot be reconstructed. If a gap is too long or implausible for a reliable difference, the reader skips that interval, increments the visible gap count, and resumes from the current word.
The touchscreen's reset control clears one Pi-side total, not the hardware word. A reset creates a new baseline on the next successful read. See Operation.
The optional writer stores one InfluxDB point for each successful board poll. The measurement is geiger, tagged unit=gm1 or unit=gm2, with a millisecond timestamp. Finite numeric fields are:
| Field | Meaning |
|---|---|
pulses |
Current board pulse-register value |
pulses_per_sec |
Board-reported pulse rate |
dose_level_usvh |
Board-reported dose rate, interpreted as µSv/h |
dose_accumulated_usv |
Board-reported accumulated dose, interpreted as µSv |
reference_dose_usvh |
Shared operator-entered source dose rate in µSv/h, present only while set |
total_pulses |
Pi-side cumulative pulse count for that board |
hv_voltage |
Board high-voltage reading |
board_temp |
Board temperature |
supply_voltage |
Board supply-voltage reading |
The touchscreen's main dose cards and Grafana dose panels display negative dose-rate and accumulated-dose readings as zero while a firmware dose fix is pending. The current calibration coefficients produce µSv/h rate values; legacy InfluxDB fields dose_level_msvh, dose_msv, and dose_accumulated_board are read without numerical rescaling and should be interpreted using the dashboard operating notes. Raw register values and stored InfluxDB samples retain the original readings, including negative values. Use those sources for diagnosis rather than assuming a zero shown in a panel was the exact wire or stored value.