# BYITL SP-01 Smart Plant Pot — Wiring

**USB-C in, 5 V throughout. There is no battery, no BMS and no buck
converter in this product** — the Feather's own USB-C port is the only power
input, and everything on board runs from it.

> **Safety:** never plug the USB-C adapter in while the enclosure lid is off and
> you are handling the pump wiring. Water and mains-derived 5 V do not mix:
> keep the reservoir out of the case while you work.

---

## 1. Power chain (the whole of it)

```
USB-C 5 V 2 A wall adapter
        │  USB-C cable
        ▼
Feather ESP32-S3 (U1) USB-C port      ← reachable through the -X wall opening
        │
        ├─ 3.3 V regulator on board ──► I²C sensors (U2 soil, U3 light)
        │
        └─ "USB" pin  (= 5 V bus)  ───► MOSFET driver (U4) V+
                                              │ switched
                                              ▼
                                        Pump (M1)
```

The Feather's pin marked **USB** is the raw USB bus voltage. That is the 5 V
rail for the pump. Do **not** take pump power from `3V3` — it is a small
regulator and the pump will brown out the MCU.

**Fit C1 and D1.** The pump is an inductive load with a real inrush:

- **C1 — 470 µF 16 V electrolytic** across the driver's V+ / GND screw
  terminals. Observe polarity (stripe = negative). This holds the 5 V rail up
  through the pump's start-up surge; without it the ESP32 can brown-out and
  reset every time it doses.
- **D1 — 1N5819 Schottky** directly across the pump's two leads, **cathode
  (banded end) to the + lead**. This clamps the inductive kick when the MOSFET
  turns off. Solder it at the pump, not at the driver.

---

## 2. Connections

| From | To | Signal | Wire | Notes |
|---|---|---|---|---|
| Wall adapter | U1 USB-C | 5 V | supplied cable | Only power input. Port faces the −X wall. |
| U1 `USB` pin | U4 screw terminal `V+` | 5 V | 22 AWG red (W3) | Fit C1 across V+/GND here. |
| U1 `GND` | U4 screw terminal `GND` | GND | 22 AWG black (W3) | |
| U1 GPIO (LEDC-capable) | U4 STEMMA JST-PH signal | PWM | JST-PH lead | Any LEDC-capable GPIO. PWM lets you throttle the dose rate. |
| U4 switched output `+` | Pump M1 `+` | 5 V sw. | 22 AWG red | D1 cathode to this lead. |
| U4 switched output `−` | Pump M1 `−` | GND sw. | 22 AWG black | |
| U1 STEMMA QT | Tether (W1) → U2 soil probe JST-PH | I²C + 3V3 + GND | 4-core, 1 m | Runs out the −X wall cable port. |
| Tether spur (W2) | U3 BH1750 5-pin header | I²C + 3V3 + GND | 5-way DuPont, 150 mm | Spurs off the same bus at the pot. |

### I²C bus

Both sensors share one bus, so the tether is a single 4-wire run
(SDA / SCL / 3V3 / GND):

- **U2 STEMMA Soil** — address **0x36** (seesaw)
- **U3 BH1750** — address **0x23** with ADDR low (leave the ADDR pin unconnected
  or tie it to GND); 0x5C if ADDR is pulled high

Run the bus at **100 kHz**, not 400 kHz. This is a ~1 m cable and the pull-ups
are the ones on the breakouts; 400 kHz over that length is marginal. If reads
are intermittent, shorten the tether before anything else.

### Pump polarity

A peristaltic pump only pumps the right way round. After wiring, run it briefly
with the inlet tube in the reservoir:

- water moves **reservoir → pot** — correct;
- water tries to move the other way, or the pot line just blows air back —
  **swap the two pump leads**.

Note the ports on this pump sit close together; make sure you have identified
which barb your inlet tube is actually on before concluding the polarity is
wrong. (See the port-spacing note in `reference/step/SOURCES.md`.)

---

## 3. Where each cable physically runs

- **USB-C** enters through the rectangular opening in the enclosure's −X wall,
  aligned to the Feather's own connector.
- **I²C tether** leaves through the round port in the −X wall (upper), runs to
  the pot, climbs the **+Y pilaster** ("spine") on the pot's +X face in its open
  cable groove, and enters the light-sensor well through the side channel. The
  short spur to the soil probe's JST connector runs across the rim — the
  probe's connector deliberately sits **above** the rim, never in the soil.
- **Dose tube** leaves through the round port in the −X wall (lower), climbs the
  **−Y pilaster**, and pushes into the horizontal delivery bore that pierces the
  pot wall just above the soil line. Water runs down the inside face.
- **Suction tube** stays inside the enclosure: from the pump's lower port it
  climbs the dry side, crosses the divider through a pass-through **near the top**
  of the wall, then steps over the tank rim and drops to the floor. The divider
  is the wet/dry overflow dam, so its only breach is kept high (~95 mm); an
  overflow has to reach that height before it can spill toward the boards. Fit
  the strainer/weight (T2) on this end.
- **Strain relief.** Each −X-wall lead port has an eyelet post just inside it,
  and the +Y pilaster carries one at the pot end. Loop a small cable tie through
  the eyelet and around the lead so a pull on the desk cable loads the post, not
  the Feather's STEMMA-QT JST-SH or the sensor connectors.

Every one of these has a modelled opening; nothing is threaded through a hole
that does not exist.

---

## 4. Service access

Six M3 screws release the enclosure lid. With the lid off:

- both boards' screws, the driver's screw terminals and its JST input are all
  reachable from directly above;
- the pump strap's two M3 screws come out from above, and the pump then lifts
  straight up out of its cradle;
- the reservoir lifts straight out for cleaning.

Nothing in this design is glued, and no connector is buried where it cannot be
reached with the lid off.
