# ArcSecs compact bench module — v0.4
Stationary bench only. No centrifuge construction or human tests. Keep rotating parts guarded. Disconnect power before wiring. All inputs must be conditioned to 0–3.3 V; no motor terminal or 5 V logic may connect directly to GPIO. Use separate regulated motor supply, common signal ground, and check transient noise with an oscilloscope. Never power motor from XIAO. Use approved enclosed supplies and current limiting. Verify actual breakout pinouts.

## Provisional budget and sourcing
| Item | Allowance USD | Candidate / specification |
|---|---:|---|
| XIAO RP2040 | 10 | https://wiki.seeedstudio.com/XIAO-RP2040/ |
| Motor/encoder | 25 | Pololu 5108 6 V LP 50:1 (price and cable not verified): https://www.pololu.com/product/5108/specs |
| Independent reference | 15 | Low-frequency quartz-derived logic output <=1 kHz; or qualified external divider. Exact part not selected. |
| Motor supply | 15 | Regulated current-limited 6 V compatible with selected motor; exact part pending |
| Sensors | 15 | Temperature, voltage/current measurement; manual log initially |
| Guard, wiring, conditioning | 20 | 3.3 V dual AND gate SN74LVC2G08 candidate https://www.ti.com/product/SN74LVC2G08; breakout, decoupling, guard, encoder cable |
| Total | 100 | Planning allowances, not a priced shopping cart; excludes shipping, tax, existing PC and test equipment. |

Pololu 5108 lists 270 RPM nominal no-load speed at 6 V and 0.36 A stall current. Encoder 12 CPR is a quadrature four-edge count per motor-shaft revolution, not the one-rising-edge count. With one channel rising only, expect 3 events per motor-shaft revolution, about 154 events per output-shaft turn for nominal 50:1 gearing; exact ratio and effective calibration must be measured. At 270 RPM this is roughly 694 Hz, below the preliminary 1 kHz design limit, but verify actual worst-case rate. Count a marked output shaft independently across many turns. Gear friction is a confound; an un-geared motor is an alternative later. Never assume advertised CPR equals firmware scale. Datasheet: https://www.pololu.com/file/0J1487/pololu-micro-metal-gearmotors_rev-6-1.pdf

## Logical connections (not a PCB layout)
Encoder channel A conditioned output -> gate A input; independent reference conditioned output -> gate B input. XIAO D0/GPIO26 -> both gate enables; external pull-down keeps gate closed during reset. Gate A output -> D5/GPIO7; gate B output -> D7/GPIO1. Power gate at 3.3 V with local decoupling per datasheet; all signal grounds common. Verify supply and logic levels of actual encoder before use. Reference runs independently; gate affects counting only. No motor speed feedback. A combinational AND gate can create an extra rising edge when enabled while input high: test boundary uncertainty with known pulses. No 10 MHz direct input to v0.2.

## Acceptance sequence
1. Test common pulse source on both channels at 10, 100 and 1000 Hz; vary gate duration and starting phase. Compare against independent calibrated counter; preserve failures. Verify reset and overflow. Do not infer accuracy from equal counts alone.
2. Confirm actual single-channel edges per shaft turn, using independent manual marks at slow speed. Check electrical noise, pulse width and worst-case rate.
3. Repeat stationary runs, record temperature, supply voltage/current and orientation manually. No environmental sensor driver exists yet.
4. Only after qualification, orientation reversal at stationary bench; no improvised rotor. Differences are instrument responses until conventional backgrounds are bounded.

## Desktop dashboard
Keep dashboard.py and counter_client.py together. Python 3 with Tkinter required; hardware mode also needs pyserial. Run `python dashboard.py`. Simulation default; edit synthetic row or capture and save. Hardware rows always unqualified. Exclusive serial connection and v0.2 protocol required; no firmware acknowledgement/run ID, so stale rows remain a risk. Close gate manually after error. CSV raw counts preserved. No live sensor integration. No physical board tested.
