# NicePanel-PoE v1 — Custom 802.3af PoE ESP32 Wall Panel Board
**Target fab: JLCPCB, quantity 12 · Rev A**

---

## 1. Architecture (revised — single-ESP32 design)

The original "Route 2" sketch (Ag9905 carrier + WT32-ETH01 module + CYD display over UART) has a fatal wiring problem: the WT32-ETH01 exposes Ethernet **only through its own RJ45 jack**, not its headers. A carrier board cannot inject data into it via pins. Solution: **integrate the WT32-ETH01's proven Ethernet subsection directly onto this board**, delete the second processor, and drive a bare 2.8″ ILI9341+XPT2046 SPI display module directly. One cable in, one firmware, no display-over-UART protocol.

```
[PoE Switch] ══ Cat5e/Cat6, up to 100 m ══> [Magjack HR911105A]
                                                 │
                        ┌────────────────────────┴───────────────┐
                   DATA pairs (1/2, 3/6)                    POE pairs (4/5, 7/8)
                        │                                        │
                 [LAN8720A PHY] ◄── 50 MHz osc            [Bridge rectifiers ×2]
                        │  RMII                                  │
                 [ESP32-WROOM-32E]                        [Silvertel Ag9905-MTB]
                        │  SPI (display+touch)                   │  5 V / 1.8 A isolated
                        ▼                                        ▼
              [2.8″ ILI9341 + XPT2046                 [Polyfuse] → 5V rail
               SPI display module, right-angle          ├→ ESP32 via AMS1117-3.3
               header, mounts on board front]           └→ Display module 5V
```

- **Displays:** buy bare 2.8″ ILI9341 SPI modules with XPT2046 touch (~US$8 ea) instead of CYD boards. They carry no ESP32, so nothing is wasted.
- **Ag9905 and the display modules are hand-mounted by you after JLC assembly** (Silvertel parts aren't in JLC's catalog; the Ag9900-MTB is a gull-wing SMT SIL module that solders in minutes).

---

## 2. Power section (PoE PD)

Copy the Silvertel **Ag9900-M datasheet V3.5 application circuit** (referenced below — verify values against the current datasheet before ordering):

- **Module:** Ag9905-MTB — 5 V nominal, 9 W (1.8 A cont.), IEEE 802.3af Class 0, 1500 V isolation, thermal protection.
- **Input (per datasheet app circuit):** two SMD bridge rectifiers (**MB1S** or equivalent) so the board works regardless of PoE polarity/pair mode (spare-pairs or phantom/Alt A), plus the datasheet's smoothing electrolytic (order-of-magnitude: 220–470 µF / 63 V low-ESR — **confirm exact value in the Ag9900 datasheet, section "Application Circuit"**).
- **Transient protection:** SMAJ58A TVS across the PoE input after the bridges.
- **Load budget:** ESP32 (Wi-Fi/BT *disabled* in firmware) ≈ 120 mA peak, LAN8720 ≈ 180 mA, ILI9341 + backlight ≈ 200–250 mA, 3.3 V LDO losses → **≈ 0.6 A of 1.8 A available.** Comfortable. Headroom for a Rev B I2S amp if you move the backlight pin (see §8).
- **Rails:** 5 V (isolated side) → AMS1117-3.3 (JLC basic part) → 3.3 V logic, with ≥ 470 µF bulk on 5 V input to the LDO and 100 nF at every VDD pin. Disable Wi-Fi in ESPHome — this removes the ~500 mA radio surge and keeps the AMS1117 well inside its thermal envelope.
- **Inrush note:** the Ag9905's soft-start handles cable charging; no extra hot-swap circuitry needed at Class 0.

## 3. Ethernet section

Clone the **WT32-ETH01 LAN8720 subsection** (open schematic widely mirrored in the egnor/wt32-eth01 GitHub repo) — it's a battle-tested ESP32+LAN8720 reference:

- **PHY:** LAN8720A, PHY address 1, 50 MHz oscillator → both PHY XI and ESP32 GPIO0 (`CLK_EXT_IN` mode).
- **Magjack:** HanRun **HR911105A** (RJ45 with integrated magnetics + LEDs, JLC-stocked).
- **PHY enable/reset** via **GPIO16** (matches WT32-ETH01's `power_pin: GPIO16` in ESPHome).
- Include the 49.9 Ω differential terminations and 0.1 µF AC-coupling caps to the magnetics, and 1 kΩ strap pulls per the WT32 schematic.
- **Do not route Ethernet under the Ag9905 or its keepout.**

## 4. Pin map (RMII-aware — this is the whole trick)

RMII steals most SPI-friendly pins, so the display lives on the remainder:

| Function | GPIO | Notes |
|---|---|---|
| RMII TXD0 | 19 | fixed by silicon |
| RMII TXD1 | 22 | fixed |
| RMII TX_EN | 21 | fixed |
| RMII RXD0 | 25 | fixed |
| RMII RXD1 | 26 | fixed |
| RMII CRS_DV | 27 | fixed |
| MDC / MDIO | 23 / 18 | fixed |
| REF_CLK_IN | 0 | 50 MHz osc, `CLK_EXT_IN` |
| PHY power_pin | 16 | high = PHY on (WT32-compatible) |
| **Display SCK** | 14 | remapped HSPI |
| **Display MOSI** | 13 | |
| **Display MISO** | 12 | strap-safe (input; leave floating-low at boot) |
| **TFT CS** | 15 | strap pin, fine as output after boot |
| **TFT DC** | 2 | strap pin, drive low only *after* reset (ESPhome handles) |
| **TFT RST** | 4 | |
| **Backlight** | 5 | PWM-able |
| **Touch CS (XPT2046)** | 33 | shares the display SPI bus |
| **Touch IRQ** | 34 | input-only pin — perfect for an interrupt |
| Boot button | 35 | to GND, input-only OK |
| Panel button (wall use) | 39 | to GND, input-only OK |
| UART0 (flash/log) | 1 / 3 | to CH340C |

Strap-pin audit: GPIO 0 (clock in), 2 (DC), 12 (MISO), 15 (CS) — all held in boot-safe states by the SPI/display idle levels; verify GPIO2 has no external pull-up (would enter download mode).

## 5. USB / programming

- **CH340C + USB-C receptacle** (JLC basic parts) on UART0, with 5.1 kΩ CC pull-downs on the receptacle and **the USB-C 5 V line isolated from the PoE 5 V rail** via a Schottky-diode OR — never feed 5 V into the Ag9905 output.
- EN reset button + boot button on GPIO0 via jumper, so you can force download mode if firmware bricks the clock pin.
- Add 4-pin ISP-consistent labelling: all 12 boards flash identically before mounting.

## 6. Bill of materials (per board, Rev A)

| Item | Part | Source | Est. cost |
|---|---|---|---|
| MCU module | ESP32-WROOM-32E | JLC basic | ~$3.20 |
| Ethernet PHY | LAN8720A + 49R9×4, straps | JLC extended | ~$1.80 |
| Magjack | HR911105A | JLC basic | ~$1.30 |
| Clock | 50 MHz oscillator (SG-8002-family, 3.3 V) | JLC extended | ~$0.70 |
| PoE PD | **Ag9905-MTB** | Silvertel/Mouser/DigiKey, **hand-mount** | ~€7.50 |
| Input diodes | 2× MB1S, SMAJ58A TVS | JLC basic | ~$0.40 |
| LDO | AMS1117-3.3 + bulk caps | JLC basic | ~$0.30 |
| USB | CH340C, USB-C receptacle, ESD array | JLC basic | ~$0.90 |
| Passives/power | RJ45 LEDs, polyfuse 2 A, headers, buttons | JLC | ~$1.50 |
| Display (separate purchase) | 2.8″ ILI9341 + XPT2046 SPI module | AliExpress/Amazon | ~$8.00 |
| **PCB fab + assembly (JLC)** | | | ~$5–7/board at qty 12 |
| **≈ Total per installed panel** | | | **≈ $30–33** |

(Verify Ag9905-MTB availability at Mouser/DigiKey/Farnell — listed in the Silvertel selector guide; all four Ag9900 variants are in distribution.)

## 7. PCB layout rules (the part that makes PoE boards fail)

1. **Two-layer, 1.6 mm, 1 oz copper** is fine at 100BASE-TX with the magjack's integrated terminations. JLC settings: HASL-LF (or ENIG if you prefer lead-free friendly pads for the Ag9905), no impedance control needed for this length.
2. **Isolation barrier:** respect the Ag9905 datasheet's creepage/clearance (≥ 6.4 mm input-to-output creepage is the conservative number — check the datasheet's isolation diagram). Put a **milled slot under the Ag9905** between input and output pins. Nothing routes under the module.
3. **Keep the PoE pair lengths matched** from jack → bridges → module; keep the RMII pairs short (< 25 mm ideal) and away from the 50 MHz clock trace, which gets a ground guard via fence.
4. **Ground:** solid pour on both layers; split the ground plane **under the magjack/Ag9905 input area** per the datasheet isolation requirement — do **not** stitch the isolated-input ground to logic ground.
5. **Board outline ~ 100 × 70 mm**, 4× M3 mounting holes at display-module corners so the ILI9341 module studs onto the front with 8-pin right-angle header + Dupont or a 2×8 socket strip.
6. Silkscreen every GPIO name at its header — you'll thank yourself on units 7–12.
7. Design rule for 12 units: add **panel-test pads** (5V, 3V3, GND, TX0, RX0) on the bottom edge so you can ring out a board without the display attached.

## 8. Rev B ideas (do NOT block Rev A on these)

- **I2S audio** for your Snapcast/intercom ambitions: the only remaining output pins are GPIO 1/3 (UART0-adjacent) and GPIO 17. Reserve three solder-jumper positions now; finalize when you pick the DAC (MAX98357A) and mic (INMP441). Moving backlight to a spare RMII pin is impossible — a GPIO expander (PCF8574 over I²C on GPIO 4/16… also tight) or swapping a display to a model with backlight-enumeration pins is the clean path. Honest answer: **Rev A is display/control only; audio waits for Rev B** unless you sacrifice the second button and UART logging.
- 6-pin Tag-Connect footprint for factory re-flashing.
- WS2812 status LED on GPIO 17 if audio never happens.

## 9. Firmware outline (ESPHome)

```yaml
esphome:
  name: nicepanel-poe
esp32:
  board: esp-wrover-kit       # WROOM-32E-safe profile
wifi:                         # DISABLED — power + reliability
  enable_on_boot: false
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
api:
ota:
  - platform: esphome
logger:
  baud_rate: 115200
spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  miso_pin: GPIO12
display:
  - platform: ili9341
    cs_pin: GPIO15
    dc_pin: GPIO2
    reset_pin: GPIO4
    backlight_pin: GPIO5
    rotation: 90
touchscreen:
  - platform: xpt2046
    cs_pin: GPIO33
    irq_pin: GPIO34
    transform: { mirror_x: false, mirror_y: true }
binary_sensor:
  - platform: gpio            # wall button
    pin: { number: GPIO39, inverted: true, mode: INPUT_PULLUP }
# + lvgl: pages for climate.setpoint, media_player.now_playing, intercom status
```

Everything else (thermostat logic, now-playing from the Jellyfin/Music Assistant media player entities, doorbell/intercom snapshots) runs on your HAOS box; the panel is a subscriber.

## 10. Bring-up & test plan (all 12 units)

1. **Bare board, no modules:** continuity 5V/3V3/GND; power via USB-C only (before any PoE exposure); confirm no shorts.
2. Attach Ag9905, feed **48 V from a bench supply through a known-good 802.3af injector**, measure 5.0 V ±5% at the rail, ripple < 50 mVpp with display running.
3. Flash a blink test over USB-C; then Ethernet test: `ping` each MAC from the HAOS box.
4. Display test firmware: color bars → touch crosshair calibration → full ESPHome image.
5. Burn-in each unit 24 h with a screen-fill loop before wall mounting.

## 11. Data sources to verify before ordering

- **Silvertel Ag9900 datasheet (V3.5, March 2026)** — silvertel.com — app circuit, creepage, smoothing-cap value (the numbers above are conservative placeholders from the datasheet family; confirm).
- **egnor/wt32-eth01 GitHub repo** — canonical WT32-ETH01 schematic + ESPHome config this design clones.
- **ESPHome Ethernet docs** — esphome.io/components/ethernet — the WT32-ETH01 block quoted above matches the published config.
- **ESPHome ILI9341 / XPT2046 / LVGL docs** for the display side.

---

*Rev A scope freeze: PoE power, wired Ethernet, ILI9341+XPT2041 touch display, USB-C flashing, two buttons. No audio — deliberate.*
