QualityRelay measurement logger · caliper readings → CSV

YOU MEASURE WITH THE CALIPER · the camera image is a visual record, not a measurement

Camera (visual record)

Optional. The still is saved to your computer and its filename is attached to this specimen's rows. The millimetres come from the caliper, typed below.

Specimen

Dimensions (mm) — leave blank to skip

Measurement device — spare ESP32 over USB

Put a spare ESP32 to work: it sends each reading straight into the log, so you don't type. Needs Chrome or Edge served from https or localhost (file:// and other browsers can't open USB serial — you can still type by hand). Wiring and firmware are on the Breadboard tab.

not connected

Logged rows

One row per individual reading (tidy format). Saved in this browser until you clear it.

Give the spare ESP32 a job

With the servo gone, a spare ESP32 is free. Use it as the measurement station: it reads the caliper or a gauge and sends each number straight into the logger over USB (the "Connect ESP32" button on tab 1, via Web Serial). You press one button on the bench, the number lands in the CSV, and the optional QAPASS 16×2 LCD shows it. Less typing, fewer transcription mistakes.

You still don't have to build this. Pure manual — read the caliper, type the number on tab 1 — needs no wiring at all, and the page does the maths. The ESP32 is a convenience and gives the spare board something to do.
Whatever the source, the number is evidence: the operator-confirmed caliper reading stays authoritative, and the repo never lets a raw sensor value set a verdict on its own.

Option A — potentiometer / linear gauge (reliable)

A linear slide potentiometer is a cheap position gauge: easy to wire and always works, but lower precision than your digital caliper and it must be calibrated. Good for a second axis (say height) or as a backup. It reuses the repo's existing potentiometer_to_mm() in qualityrelay17/hardware_ingest.py and the /hardware/caliper-reading endpoint.

ESP32 DevKit — use pins by their printed labels 3V3 GND GPIO34 GPIO32 5V/VIN GND GPIO21 GPIO22 GPIO34 = ADC in · GPIO21 = SDA · GPIO22 = SCL linear pot / slide gauge (~10 kΩ) pin1wiperpin2 push button (send reading) QAPASS 16×2 I²C LCD (optional) VCCGNDSDASCL red = 3V3/5V · grey = GND · orange = wiper→GPIO34 · green = button→GPIO32 · blue = SDA · yellow = SCL GND is shared: pot pin2, button, and LCD all return to any ESP32 GND pin.
fromtowhy
pot outer pin 1ESP32 3V3top of the divider
pot outer pin 2ESP32 GNDbottom of the divider
pot wiper (middle)ESP32 GPIO34 (ADC, input-only)the position voltage
button leg 1ESP32 GPIO32"send reading" button (INPUT_PULLUP)
button leg 2ESP32 GNDpressed = LOW
QAPASS LCD VCC / GNDESP32 5V (VIN) / GNDpower the 16×2 display (optional)
QAPASS LCD SDA / SCLESP32 GPIO21 / GPIO22I²C data / clock (optional)
Calibrate first. Measure at least five known positions against the real caliper, then set ADC_MIN/ADC_MAX and MM_MIN/MM_MAX in the sketch. Without that the millimetres are meaningless.

Firmware: firmware/measurement_station/esp32_measurement_station.ino (default mode). GPIO34 is input-only and ADC-safe.

Wire it and test (USB unplugged while wiring)

  1. Wire the three pot pins, then the button. The LCD is optional — skip it for the first test.
  2. Multimeter across the pot: wiper (GPIO34 wire) should read 0 → 3.3 V as you slide it. If it does not, swap pin1/pin2.
  3. Plug in USB. Flash esp32_measurement_station.ino with READ_SOURCE = SOURCE_POT. Open Serial Monitor at 115200; you should see # QRM ready.
  4. Press the button. A number prints each press. Slide the gauge, press again: the number changes.
  5. Calibrate: at ≥ 5 known caliper positions, note the printed raw/number, then set ADC_MIN/ADC_MAX and MM_MIN/MM_MAX in the sketch and reflash.
  6. In this page (tab 1) click Connect ESP32, pick the port, then press the button — the value lands in the focused field. Click "Add specimen to log".
Never feed more than 3.3 V into any GPIO: the pot's top pin must go to 3V3, not 5V/VIN. The ADC is slightly non-linear near 0 V and 3.3 V, which the calibration absorbs.

Option B — digital caliper data port (precise, advanced)

If your caliper has a 4-pad data port under a cover, the ESP32 can read the exact number it shows. Precise, but the logic is ~1.5 V and the frame format varies by brand, so this is experimental and untested here.

digital caliper (1.5 V port) V+ ~1.5 V CLK DATA GND level shifter LV ◄► HV (BSS138 ×2) ESP32 GPIO (CLK) GPIO (DATA) 3V3 → HV GND
Caveats. ~1.5 V logic is below many BSS138 level shifters' usable range; a per-line transistor stage or a caliper-specific reader may be needed, and the 24-bit format differs by brand. Verify on your bench before trusting it; in the firmware this mode is a documented stub.

How the ESP32 talks to the logger

The sketch prints at 115200 baud, one reading per button press. The logger (tab 1 → Connect ESP32) reads each line and either fills the field you are on or appends a row.

ESP32 printsthe logger does
20.01 (a bare number)fills the dimension field you have selected — use it like a numeric keypad, then click "Add specimen to log"
QRM,width,mid,20.01appends a full row (feature, location, value) with method = the "source" you picked
# QRM readyignored (banner / comment)

Device rows are tagged evidence_tier = PHYSICAL_CAPTURE; typed rows are OPERATOR_CONFIRMED. Confirm device readings against the display when it matters.

CSV columns (tidy / long format)

One row per individual reading. This is the format the Export button writes and that docs/engineering/templates/specimen_measurements.csv documents. Excel opens it directly; use a pivot table to view width-per-position etc.

columnmeaning

Handoff to a later agent (not run here)

This page and the summarizer only record and describe the measurements. They do not change code. A later agent (your "CMC agent") could read this CSV and propose updates, for example:

  • group rows by specimen_id and feature, then compare the measured mean against nominal_mm;
  • flag critical features (width, slot_inner_width) whose deviation exceeds the chosen tolerance;
  • propose new nominal/tolerance constants or decision thresholds for review.
Guardrail: any such change is a proposal for a human to review. Measured data is evidence; it does not by itself re-tune the safety policy. Keep the raw CSV so every proposed change is traceable to real readings.

Summarize a CSV now, without any agent: python3 scripts/summarize_measurements.py your_file.csv prints per-specimen min/max/mean/spread and deviation from nominal, and can write a JSON summary with --json out.json.