# ArcSecs environmental module v0.5 (prototype)

Keep the existing gated event counter unchanged. Its encoder uses GPIO7, which is also the XIAO default I2C SCL. A second XIAO board is an optional, deliberately separate sensor controller. Do not wire I2C to the active encoder pin. This is a stationary bench design, not a rotating assembly.

## Candidate circuit
- Second XIAO RP2040: USB power; D4/GPIO6 SDA, D5/GPIO7 SCL, 3.3 V logic and common sensor ground. Check breakout pull-ups are to 3.3 V only.
- INA219 breakout, default address 0x40, high-side shunt in the separately regulated low-voltage motor supply: supply + to VIN+, VIN- to motor +; motor return to supply ground. Check shunt rating, board current limits and motor stall current before connection. Use a current-limited supply and appropriate motor suppression. Never connect motor supply voltage to a GPIO.
- TMP102 breakout at 0x48, standard 12-bit mode, placed near oscillator; measures local board temperature, not atomic temperature. Verify configuration and address before use. Temperature changes slowly and placement matters.
- No accelerometer yet. No motor speed feedback. No unattended or spinning operation.

Candidate budget: second board $5, INA219 breakout $6, TMP102 breakout $4, total $15 planning allowance; not a verified cart. Excludes shipping and tools. Sensor firmware requires Arduino-Pico and Adafruit INA219 library; not compiled or tested on hardware. Check library API and calibration for the actual shunt. Manufacturer references: https://wiki.seeedstudio.com/XIAO-RP2040/ ; https://www.ti.com/product/INA219 ; https://www.ti.com/product/TMP102 .

## Software
Keep all Python files together. Python 3, Tkinter for GUI; pyserial only for hardware. Run `python environment_dashboard.py` or `python environment_capture.py --simulate`. Hardware uses distinct USB ports and the existing 0.2 gated counter (≤1 kHz qualification target only). Readings are snapshots BEFORE and AFTER, not synchronized samples during the count. An absent or failed sensor is recorded explicitly; valid raw counts are retained. JSONL is a new ledger, not the earlier CSV. Never merge synthetic and measured observations as evidence. Timestamps are host metadata, not an independent measurement of universal time.

Calibrate temperature against a reference thermometer; voltage and current against a meter under a known load, and check motor-off zeros. Compare counts with sensor board disconnected versus connected. Repeat with orientation reversal only after guarding and mounting are verified. A sensor reading is not a correction coefficient: establish response slopes and residual uncertainties independently. No experimental evidence yet.
