Wattplot Live ↗ Edit on GitHub ↗

System diagrams

The four diagrams that explain the Wattplot controller: the system block, the power flow, the state machine, and the assembly sequence. All rendered as scalable SVG so they stay sharp at any size and stay editable as code.

MCU (ESP32-S3)
Power supply
Actuator path
Solenoid path
Sensors
Comms (WiFi, HA, web)

1 · System block diagram

Every component, every signal. ESP32-S3 in the center; power from the top, motor + solenoid to the sides, sensors at the bottom, WiFi to the upper-right. Lines are color-coded: power, signal (analog/digital), control.

Solar panel 620 W bifacial · 35° tilt MC4 → fused PV+ PV+ MPPT charge controller Sunapex 10A · bulk/abs/float LiFePO4 chemistry mode LiFePO4 battery 12 V · 100 Ah · 5A fuse SOC tracked via divider +12 V (fused) 5 V buck MP1584 3.3 V LDO AMS1117 5V 3.3V ESP32-S3-DevKitC-1 N16R8 · 16 MB flash · 8 MB PSRAM GPIO1 → HBridge IN1 GPIO2 → HBridge IN2 GPIO4 ← IPROPI motor GPIO5 ← IPROPI solenoid GPIO6 ← soil moisture GPIO7 ← battery V DRV8871 (U5a) 12 V · 3.6 A peak IN1/IN2 + nFAULT IPROPI → GPIO4 (ADC) → Linear actuator Linear actuator 24" stroke, 200 lb panel tilt 0–35° IN1,IN2 IPROPI 12 V → motor DRV8871 (U5b) 12 V · 1.5 A trip IN1 only · IN2 to GND → 12 V solenoid 12 V solenoid irrigation valve ~1 A continuous IN1 IPROPI 12 V → solenoid DS18B20 ×3 panel · soil · canopy air 1-Wire, 4.7 k pull-up Capacitive soil 0–3 V analog, 6" deep mapped → % moisture INA219 ×2 motor current + panel V/I I²C 0x40 / 0x41 1-Wire analog I²C WiFi 2.4 GHz · mDNS → HA / web / OTA 2.4 GHz v3.1 · limit switches removed · current-based endstop detection via Motor IPROPI

2 · Power flow

Volts and amps from panel to load. The 5 V rail feeds the MCU and the H-bridge nFAULT inputs. The 3.3 V rail powers the ESP32-S3. The 12 V battery rail feeds both H-bridges. Battery voltage is divided to ~1.09 V and read on GPIO7 to track state of charge.

Panel OCV ~40 V Imp ~9 A 10 A fuse MPPT bulk/abs/float LiFePO4 mode Battery 12 V · 100 Ah 5 A fuse 10 mΩ internal R 5 V buck 3 A 3.3 V LDO 1 A Direct 12 V to H-bridges ESP32 5V 3.3V 12V 100k / 10k ÷ 11.0 to GPIO7 ADC read ≈ V_batt / 11 ADC Note: power budget ≈ 600 mA continuous on 5 V rail. 3.3 V LDO caps at ~1 A. Don't add a second relay or a fan without re-budgeting.

3 · State machine

The controller has four states. Normal runs the PI loop. Monitoring waits 15 min to see if the wind passes. Folding drives to 0° until current-spike indicates endstop. Locked holds for 30 min before re-checking. Boot defaults to Folding (safe).

Normal PI loop on i_motor Monitoring 15 min wind watch Folding drive to 0° (home) Locked 30 min hold Fault (silent) nFAULT → stop i_motor > 0.5 × safe 15 min && still windy at_zero endstop hit 30 min, wind gone i_motor > 0.5 × safe hard: i_motor > safe + 0.3 → Folding (any state) boot at_zero / at_max are set by the endpoint_detector interval (100 ms) which watches motor IPROPI for current-spike debounced over 200 ms.

4 · Assembly sequence (mini build)

Six-step build. Total: 3–4 hours, ~$193 in parts. The bed and panel are separate sub-assemblies; join them at step 5. Do all electrical work in step 6 with the battery DISCONNECTED and the panel covered with an opaque tarp.

1 Cut + assemble the bed 4 cedar 1×6×18" walls + base 2 cedar 2×2×12" corner posts (internal) 12 #8 × 1¼" exterior screws 2 Mount hinges on south wall 2 brass hinges, 1.5" × 1.5" centered, 4" from each end screws: 4 × #6 × ½" brass 3 Attach panel sub-assembly bolt to hinge knuckles · orient panel north 4 Mount the kickstand actuator 12 V linear, 4" stroke, 200 lb clevis pin each end · bed + frame panel range: 0–35° (structural max) 5 Breadboard the controller ESP32-S3 + 2× DRV8871 + sensors USB-C flash · verify pin map.html test bench: bench PSU, not battery 6 Connect power (with panel covered) battery last · MPPT first · verify V on every rail 7 OTA + Home Assistant flash via WiFi (esphome) add to HA · api encryption key tune PI constants · watch logs 8 Calibrate endstops run Folding state · watch i_motor tune endstop_current_threshold default 0.80 A — verify in field 9 Fill bed, plant, test soil + probes · 24h soak · first irrigation cycle

All four diagrams are SVG, hand-editable. Propose a change on GitHub or open an issue.