# Sentinel — Hardware bench preparation

## Goal

Tomorrow's first real-sensor session is a **workbench test at room
temperature**, not a freezer installation.

The supplied runner keeps this data separate from the real freezer:

- Device: `sentinel-pi-bench-001`
- Equipment: `bench-test-001`

The bench equipment will automatically appear in Fleet Overview.

## Planned physical channels

| Sentinel channel | Tomorrow |
|---|---|
| Ambient | DS18B20 #1 |
| Internal | DS18B20 #2 |
| Evaporator | Temporary simulated 22 °C channel |
| Compressor | PT100 3-wire through MAX31865 |
| Current | Temporary 0 A simulated channel |

This lets us validate the three real temperature sensors immediately
without contaminating the freezer baseline.

---

## DS18B20 wiring

Both DS18B20 probes share one 1-Wire bus.

Raspberry Pi:

- 3.3 V: physical pin 1
- GND: physical pin 6
- GPIO4 / 1-Wire data: physical pin 7

Use **one 4.7 kΩ resistor between GPIO4/data and 3.3 V** for the entire
DS18B20 bus.

Do not assume wire colours until the probe wiring has been confirmed.

---

## MAX31865 / PT100 wiring

Typical Raspberry Pi SPI wiring:

- MAX31865 VIN/VCC -> Raspberry 3.3 V
- MAX31865 GND -> Raspberry GND
- MAX31865 CLK/SCK -> GPIO11, physical pin 23
- MAX31865 SDO/MISO -> GPIO9, physical pin 21
- MAX31865 SDI/MOSI -> GPIO10, physical pin 19
- MAX31865 CS -> GPIO8/CE0, physical pin 24

The supplied configuration assumes:

- PT100
- 3-wire probe
- MAX31865 reference resistor: 430 Ω
- 50 Hz filter
- SPI bus 0 / CE0

**Before powering the PT100 circuit, verify the reference resistor fitted
to the MAX31865 board.** Many PT100 boards use 430 Ω, but the board
marking/component value should be checked.

---

## Tomorrow: software sequence

First enable/check Raspberry interfaces:

```bash
python tools/check_hardware_interfaces.py
```

Then discover DS18B20 sensors:

```bash
python tools/discover_ds18b20.py
```

Expected shape:

```text
AUTO_1 = 28-xxxxxxxxxxxx -> 22.4 °C
AUTO_2 = 28-yyyyyyyyyyyy -> 22.5 °C
```

The default bench configuration already uses `AUTO_1` and `AUTO_2`, so
manual editing is not required for the first test.

Test PT100 separately:

```bash
python tools/test_max31865.py
```

When all three real sensors read correctly:

```bash
python hardware_bench.py
```

Then open Sentinel Fleet Overview. A new equipment should appear:

```text
bench-test-001
```

Click it to see the real measurements flowing through:

```text
physical sensor
    ↓
Sentinel sensor driver
    ↓
AcquisitionService
    ↓
SQLite
    ↓
FastAPI
    ↓
Dashboard
```

---

## Current sensor

Current measurement is deliberately left at 0 A in this release.

We will integrate the ADS1115/current clamp only after the temperature
chain is validated. This prevents current-conditioning work from blocking
the first real Sentinel acquisition.

---

## Important

Do not run the normal simulated acquisition process and the hardware bench
runner at the same time unless you intentionally want both equipment
streams active.
