# Subscribe / Seebscribe

Seebscribe is an experimental wearable ECG prototype built during Fab Academy
2026. A XIAO ESP32-C3 reads an AD8232 ECG sensor, calculates tentative live
metrics, and serves a browser dashboard over Wi-Fi.

The project explores heartbeat visualization and sharing as a form of creative
communication. It is not a certified medical device and must not be used for
diagnosis or safety-critical monitoring.

## Repository contents

- `firmware/XIAO_AD8232_WIFI_WEB/` — main firmware. The XIAO hosts the live
  dashboard directly, so no computer-side program is required during normal use.
- `firmware/XIAO_AD8232_Diagnostic/` — simple serial diagnostic firmware that
  reports the ECG value and AD8232 lead-off states.
- `hardware/` — enclosure CAD location and mechanical notes.

## Components

- Seeed Studio XIAO ESP32-C3
- AD8232 ECG sensor module
- 3.7 V LiPo battery
- Custom carrier PCB or equivalent wiring
- Two body-contact snap electrodes
- Elastic chest strap
- 3D-printed enclosure and cover
- Headers, connectors, wire, insulation, and fasteners

## Wiring

| AD8232 | XIAO ESP32-C3 |
| --- | --- |
| `3.3V` | `3V3` |
| `GND` | `GND` |
| `OUTPUT` | `A0` |
| `LO+` | `D1` |
| `LO-` | `D2` |

Confirm the labels on your own AD8232 board before powering it. Do not connect
or disconnect body electrodes while the system is connected to mains-powered
test equipment. Operate the wearable from its battery during body-worn tests.

## Upload the main firmware

1. Install Arduino IDE.
2. Add ESP32 board support and select **Seeed Studio XIAO ESP32-C3**.
3. Open
   `firmware/XIAO_AD8232_WIFI_WEB/XIAO_AD8232_WIFI_WEB.ino`.
4. Replace `YOUR_WIFI_NAME` and `YOUR_WIFI_PASSWORD` near the top of the sketch.
5. Connect the XIAO by USB and upload the sketch.
6. Open Serial Monitor at `115200` baud.
7. Copy the dashboard address printed by the board.
8. Open the address on a computer or phone connected to the same Wi-Fi network.

The dashboard is available at the board's IP address. If mDNS works on the
network, `http://seebscribe-ecg.local/` may also work.

## Diagnostic mode

If the waveform is flat or the dashboard reports poor electrode contact:

1. Upload
   `firmware/XIAO_AD8232_Diagnostic/XIAO_AD8232_Diagnostic.ino`.
2. Open Serial Monitor or Serial Plotter at `115200` baud.
3. Check the three streamed values: `raw_ecg,lo_plus,lo_minus`.
4. With good contact, verify that the ECG value changes and the lead-off inputs
   are not continuously reporting disconnected electrodes.
5. Recheck snap contacts, wire routing, skin contact, and the `LO+` / `LO-`
   wiring before returning to the main firmware.

## Mechanical assembly

1. Print the enclosure base and cover.
2. Fit the custom PCB, XIAO, AD8232, battery, and snap fasteners into the base.
3. Keep the USB connector and power control accessible.
4. Route short sensor wires away from loose power wiring.
5. Add strain relief. The prototype used low-temperature 3D-pen filament to
   secure wires and board edges after placement was tested.
6. Fasten the cover and connect the enclosure snaps to the matching chest strap.
7. Check for exposed conductors, sharp edges, loose boards, and battery damage
   before wearing the device.

## Test sequence

1. Power the electronics without wearing the device.
2. Verify the XIAO starts and the dashboard loads.
3. Check lead-off behavior with the diagnostic sketch.
4. Connect the electrodes and test while sitting still.
5. Confirm that the live waveform reaches the browser.
6. Check that BPM and RR values appear after several stable beats.
7. Test battery operation with USB disconnected.
8. Only after the electrical tests pass, install the electronics in the shell
   and test the complete wearable.

## Known limitations

- Motion and poor electrode contact can create significant noise.
- BPM, RR, and RMSSD are prototype estimates, not clinical measurements.
- The dashboard is intended for local same-network use.
- Battery duration and extended-wear comfort still require systematic testing.
- The repository must not contain real Wi-Fi credentials.

## Project documentation

The full development story, PCB iterations, dashboard experiments, and system
integration are documented on the Fab Academy project website.

