Initial release v1.1.0 — ESP32 automated telescope flat panel

Firmware (Arduino Nano ESP32 / PlatformIO):
- Native ASCOM Alpaca CoverCalibrator REST API on port 11111
- Alnitak serial protocol on USB at 9600 baud (simultaneous with WiFi)
- MG995 servo cover mechanism with non-blocking state machine (D9)
- LED brightness PWM via IRLZ44N MOSFET, LEDC channel 0 (D3)
- 12V dew heater PWM via IRLZ44N MOSFET, LEDC channel 1 (D5)
- mDNS + UDP Alpaca discovery, WiFi watchdog reconnect
- SERIAL_DEBUG flag to silence debug output in USB-only mode

INDI driver (C++ / libcurl / nlohmann-json):
- WiFi mode: HTTP Alpaca via libcurl
- USB mode: Alnitak serial via POSIX termios
- LightBoxInterface + DustCapInterface + dew heater number property

Python controller (PyQt6):
- Dark-themed desktop app for direct manual control
- AlpacaBackend (requests) + AlnitakBackend (pyserial)
- PollWorker QThread; cover, brightness, dew heater panels
- QSettings persistence; auto serial port discovery

Docs:
- system-diagram.svg, wiring-diagram.svg (browser-renderable SVG)
- BUILD_NOTES.md with BOM, LM2596 calibration, power-on checklist
- WIRING.md quick-reference, README.md, CHANGELOG.md
This commit is contained in:
Laurence 2026-05-17 08:51:29 +01:00
commit c32f00a2be
15 changed files with 3653 additions and 0 deletions

289
docs/BUILD_NOTES.md Normal file
View file

@ -0,0 +1,289 @@
# ESP32 FlatPanel — Build Notes
## Bill of Materials
| # | Item | Qty | Notes |
|---|------|-----|-------|
| 1 | Arduino Nano ESP32 | 1 | ESP32-S3 based, USB-C |
| 2 | MG995 servo | 1 | Cover open/close (D9) |
| 3 | SG90 micro servo | 1 | Spare / future use |
| 4 | 28BYJ-48 stepper | 1 | Spare / future use |
| 5 | IRLZ44N N-ch MOSFET | 2 | Logic-level; one for LED, one for dew heater |
| 6 | 100 Ω resistor ¼W | 2 | Gate series resistors |
| 7 | 10 kΩ resistor ¼W | 2 | Gate pull-downs |
| 8 | LM2596 buck converter module | 1 | 12V → 5V for ESP32 + servo |
| 9 | 12V DC power supply ≥ 4A | 1 | LED 2A + dew 0.5A + servo 1A peaks |
| 10 | White LED strip 12V (high-CRI ≥ Ra90) | 1 | Length to match aperture |
| 11 | Frosted acrylic sheet 3mm | 1 | Cut to telescope OD |
| 12 | Resistive heating tape / nichrome mat 12V | 1 | ~24 Ω for 6W; see sizing table below |
| 13 | Stripboard / perfboard | 1 | For wiring the MOSFETs and resistors |
| 14 | JST-XH connectors or screw terminals | set | For detachable wiring |
| 15 | Heat shrink tubing assorted | pack | For all soldered joints |
| 16 | Kapton tape 10mm | 1 roll | Securing heater element to acrylic |
| 17 | M2/M3 screws, standoffs | set | Mounting ESP32 and stripboard |
| 18 | 1N4007 diode (optional) | 1 | Reverse polarity protection on 12V input |
| 19 | Multimeter | 1 | **Required** for LM2596 calibration |
### Dew heater element sizing
| Resistance | Power @ 12V | Suitable for |
|------------|-------------|--------------|
| 48 Ω | 3 W | Refractor up to 80mm |
| 24 Ω | 6 W | Refractor 80150mm (**recommended starting point**) |
| 16 Ω | 9 W | Newtonians 150250mm |
| 12 Ω | 12 W | Large apertures 250mm+ |
> PWM control means the average power is `P × (percent/100)`, so it is fine
> to overspec the element and run it at 3050%.
---
## Tools Required
- Soldering iron + solder (60/40 or lead-free)
- Wire strippers and cutters
- Multimeter (essential for LM2596 setup)
- Hot glue gun or epoxy (for mechanical parts)
- Small Phillips screwdriver
- Isopropyl alcohol + cotton swabs (flux cleanup)
- PlatformIO CLI or IDE for firmware flashing
---
## Step-by-Step Build Instructions
### Phase 1 — LM2596 Calibration ⚠ Do this FIRST before connecting anything else
1. Connect **only** the 12V PSU to the LM2596 `IN+` and `IN` terminals.
2. Set your multimeter to DC voltage, probes on `OUT+` and `OUT`.
3. Adjust the LM2596 trimmer pot (small brass screw):
- Clockwise → voltage **increases**
- Counter-clockwise → voltage **decreases**
4. Dial to **5.00 V ± 0.05 V**.
5. Disconnect the PSU. The buck is now calibrated and safe to use with the ESP32 and servo.
> Connecting the MG995 to an unregulated or high-voltage supply will burn out
> the servo electronics instantly.
---
### Phase 2 — Stripboard Layout
Recommended wire colour convention:
| Colour | Rail |
|--------|------|
| Red | 12 V positive |
| Orange | 5 V positive |
| Black | GND |
| Blue | PWM signal |
| Yellow | Servo signal |
| Grey | Load output (LED, Heater) |
Lay three horizontal bus strips along the top of the board:
- `12V` bus (red)
- `5V` bus (orange)
- `GND` bus (black)
Place both MOSFETs at the bottom edge of the board, flat faces to the right, legs bent 90° and inserted vertically:
```
IRLZ44N (flat face → you)
Pin 1: Gate ← 100Ω from ESP32 PWM, 10kΩ to GND
Pin 2: Drain → load negative (LED or Heater)
Pin 3: Source → GND bus
```
---
### Phase 3 — MOSFET-A (LED Panel) Wiring
1. Insert MOSFET-A into the stripboard.
2. Solder a 100 Ω resistor between **Gate** and the pad that will connect to **D3** on the ESP32.
3. Solder a 10 kΩ resistor between **Gate** and the **GND bus**.
4. Solder **Source** to the **GND bus**.
5. Run a wire from **Drain** to the negative lead of the LED strip (mark it grey/black).
6. Solder a wire from the positive lead of the LED strip to the **12V bus**.
> Test at this point: apply a 3.3V signal to D3 connection. The LED strip should illuminate.
> If it stays on at 0V, check the 10kΩ pull-down is correctly placed Gate→GND.
---
### Phase 4 — MOSFET-B (Dew Heater) Wiring
Repeat Phase 3 for MOSFET-B, using **D5** instead of D3, and the heating element instead of the LED strip.
The heater element positive lead connects to the 12V bus; negative to MOSFET-B drain.
---
### Phase 5 — MG995 Servo Wiring
The MG995 uses a standard 3-wire connector:
| Wire colour | Connection |
|-------------|------------|
| Brown or Black | GND bus |
| Red | **5V bus** (from LM2596 — NOT 3.3V or raw 12V) |
| Orange or Yellow | D9 on ESP32 |
> The MG995 draws up to 1A under load. Always power it from the regulated 5V
> rail. If the servo twitches or buzzes after connecting, re-check the LM2596
> output voltage — it should not drop below 4.8V under servo load.
---
### Phase 6 — ESP32 Power and Ground
1. Run a wire from the 5V bus to **VIN** on the Arduino Nano ESP32.
2. Run a wire from the GND bus to **GND** on the ESP32.
3. Do **not** power the ESP32 from the 3.3V pin — that is an output, not an input.
---
### Phase 7 — Firmware Configuration and Flash
1. Open `firmware/src/config.h` and edit:
```cpp
#define WIFI_SSID "your_network_name"
#define WIFI_PASSWORD "your_password"
```
2. Tune servo angles (power the servo and watch physical movement):
```cpp
#define SERVO_CLOSED 0 // panel in flat position
#define SERVO_OPEN 90 // panel clear of telescope
```
3. For USB-only operation (no WiFi debug output on the serial line):
```cpp
#define SERIAL_DEBUG false
```
4. Flash via PlatformIO:
```
cd flatpanel
pio run -t upload
```
---
### Phase 8 — First Power-On Checks (ordered sequence)
Work through this list in order. Stop if any step fails.
**Step 1 — Bench test buck converter**
- Measure 5V bus at LM2596 OUT+ with no loads connected.
- Must read 4.95.1V. Adjust if needed.
**Step 2 — ESP32 power**
- Connect ESP32 to 5V bus and GND bus only.
- Open a serial monitor at 9600 baud. You should see the boot message and a WiFi IP address printed.
- If nothing appears: check VIN wiring.
**Step 3 — WiFi / Alpaca API verification**
- Open a web browser and navigate to: `http://<IP>:11111/management/v1/configureddevices`
- You should see a JSON response including `"DeviceType":"CoverCalibrator"`.
**Step 4 — Servo test**
- Using a serial terminal at 9600 baud, send: `>O000` (open cover command)
- You should hear the servo move and receive: `*O19000`
- Send `>C000` to close. Adjust `SERVO_OPEN`/`SERVO_CLOSED` angles and reflash if needed.
**Step 5 — LED panel test**
- Send: `>B100` then `>L000`
- The LED strip should light up at ~39% brightness.
- Measure the voltage at MOSFET-A Drain — it should be near 0V when the LED is on (the load pulls it low).
**Step 6 — Dew heater test**
- Send: `>T050` (50% power)
- Wait 30 seconds. The heater element should be noticeably warm to the touch.
- Send: `>T000` to turn off.
**Step 7 — Full integration test**
- Launch `controller/flatpanel_controller.py` (`pip install PyQt6 requests pyserial` first).
- Connect in WiFi mode.
- Exercise all controls: cover, brightness slider, dew heater slider.
- Confirm the log shows successful commands and the status dots update.
---
### Phase 9 — Mechanical Assembly
1. **Flat panel diffuser**: cut the frosted acrylic to the outer diameter of your telescope tube. A friction fit or 3D-printed retaining ring works well.
2. **LED strip**: arrange in a spiral or grid on the rear of the acrylic. Secure with the adhesive backing or a thin layer of silicone.
3. **Dew heater**: run the heating element in a serpentine pattern across the face of the acrylic (the side facing the telescope). Secure with Kapton tape. Do not cover the diffuser surface with tape.
4. **Cover hinge**: mount the MG995 so it rotates the panel into and out of the optical path. A 3D-printed bracket is the cleanest approach. Set `SERVO_CLOSED` so the panel seats flush against the scope aperture.
5. **Enclosure**: mount the ESP32, stripboard, and LM2596 in a weatherproof ABS enclosure on the focuser end of the scope. Use cable glands for the 12V input, USB-C, servo lead, and LED/heater wires.
---
## Software Setup
### Windows — ASCOM
1. Download and install [ASCOM Platform 6.6+](https://ascom-standards.org/Downloads/Index.htm).
2. Download and install [ASCOM Remote](https://github.com/ASCOMInitiative/ASCOM.Remote/releases) — the Alpaca bridge.
3. In ASCOM Remote setup, add a new **CoverCalibrator** device:
- IP address: `esp32-flatpanel.local` (or the IP from the serial monitor)
- Port: `11111`
- Device number: `0`
4. In your capture software (N.I.N.A., SGPro, APT), choose **ASCOM CoverCalibrator** and select the ASCOM Remote device.
### Linux / Raspberry Pi — INDI
```bash
# Install dependencies
sudo apt install libindi-dev libcurl4-openssl-dev nlohmann-json3-dev cmake build-essential
# Build the custom INDI driver
cd flatpanel/indi-driver
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build -j$(nproc)
sudo cmake --install build
# Test standalone
indiserver indi_esp32_flatpanel
```
In **KStars / Ekos**:
- Profile Editor → add Aux device: `ESP32 FlatPanel`
- In the driver's Connection tab: select WiFi or USB mode, enter host/port or serial port.
### FlatPanel Controller App (all platforms)
```bash
pip install PyQt6 requests pyserial
# Run
python flatpanel/controller/flatpanel_controller.py
```
- Select **WiFi** or **USB** mode with the radio buttons.
- WiFi: enter the ESP32's hostname or IP and port 11111.
- USB: pick the COM port from the dropdown (click ⟳ to refresh).
- Click **Connect**.
---
## Troubleshooting
| Symptom | Likely cause | Fix |
|---------|-------------|-----|
| Servo twitches/buzzes constantly | 5V rail sags under load | Re-measure LM2596; verify 5V at servo connector under motion |
| LED stays on even at 0% | Gate pull-down missing | Solder 10kΩ Gate→GND on MOSFET-A |
| LED at wrong brightness or inverted | Firmware PWM inverted? | Check `LED_PWM_PIN` and `LED_PWM_CHANNEL` in config.h |
| No WiFi after flashing | Wrong SSID/password | Edit config.h, reflash |
| Alnitak `>P000` gets no response | `SERIAL_DEBUG true` corrupts line | Set `false`, reflash |
| Cover angle wrong | SERVO_OPEN/CLOSED values wrong | Tune in config.h, reflash |
| Dew heater not warming | R too high, or MOSFET-B wiring issue | Measure Drain voltage with heater on; should be near 0V |
| Python app can't find serial port | Driver not loaded (Windows) | Install CH340 or CP210x driver for ESP32 USB |
| Connection refused on port 11111 | ESP32 not on WiFi yet | Check serial monitor for boot messages |
| INDI driver build fails | Missing libindi headers | `sudo apt install libindi-dev` |
---
## Revision History
| Version | Date | Change |
|---------|------|--------|
| 1.0 | 2026-05-17 | Initial release: WiFi/Alpaca, servo, LED PWM |
| 1.1 | 2026-05-17 | Added USB/Alnitak mode, 12V dew heater, Python controller app |

282
docs/system-diagram.svg Normal file
View file

@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="860" height="520" viewBox="0 0 860 520">
<defs>
<!-- Arrow markers -->
<marker id="arr-blue" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#1565c0"/>
</marker>
<marker id="arr-green" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#2e7d32"/>
</marker>
<marker id="arr-grey" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#607d8b"/>
</marker>
<marker id="arr-red" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#c62828"/>
</marker>
<marker id="arr-orange" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#e65100"/>
</marker>
</defs>
<!-- Background -->
<rect width="860" height="520" fill="#fafafa"/>
<!-- Title -->
<text x="430" y="32" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="17" font-weight="bold" fill="#212121">
ESP32 FlatPanel — System Architecture
</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- PC Software block -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<rect x="20" y="55" width="230" height="230" rx="10"
fill="#e3f2fd" stroke="#1565c0" stroke-width="2"/>
<text x="135" y="79" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="13" font-weight="bold" fill="#0d47a1">
PC Software
</text>
<!-- N.I.N.A / ASCOM sub-box -->
<rect x="38" y="90" width="194" height="58" rx="6"
fill="#bbdefb" stroke="#1565c0" stroke-width="1"/>
<text x="135" y="114" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="11" font-weight="bold" fill="#0d47a1">
N.I.N.A. / SGPro / KStars
</text>
<text x="135" y="132" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#1565c0">
via ASCOM Remote / INDI driver
</text>
<!-- Controller sub-box (highlighted) -->
<rect x="38" y="162" width="194" height="58" rx="6"
fill="#1565c0" stroke="#0d47a1" stroke-width="1.5"/>
<text x="135" y="186" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="bold" fill="white">
FlatPanel Controller
</text>
<text x="135" y="204" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#bbdefb">
flatpanel_controller.py
</text>
<!-- OS label -->
<text x="135" y="258" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#555">
Windows / Linux / macOS
</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- ESP32 central block -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<rect x="300" y="130" width="210" height="230" rx="12"
fill="#f3e5f5" stroke="#6a1b9a" stroke-width="2.5"/>
<text x="405" y="157" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="13" font-weight="bold" fill="#4a148c">
Arduino Nano ESP32
</text>
<!-- Pin labels inside ESP32 box -->
<text x="405" y="181" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#6a1b9a">
WiFi • USB CDC
</text>
<line x1="320" y1="192" x2="490" y2="192" stroke="#ce93d8" stroke-width="1"/>
<text x="405" y="211" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
Alpaca REST :11111
</text>
<text x="405" y="228" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
Alnitak serial 9600 baud
</text>
<line x1="320" y1="238" x2="490" y2="238" stroke="#ce93d8" stroke-width="1"/>
<text x="405" y="257" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
D9 → servo PWM
</text>
<text x="405" y="273" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
D3 → LED brightness PWM
</text>
<text x="405" y="289" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
D5 → dew heater PWM
</text>
<text x="405" y="305" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
VIN ← 5V (LM2596)
</text>
<text x="405" y="321" text-anchor="middle"
font-family="Courier New, monospace" font-size="10" fill="#555">
GND → common ground
</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- Output blocks (right column) -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- MG995 Servo -->
<rect x="580" y="55" width="200" height="70" rx="8"
fill="#e8f5e9" stroke="#2e7d32" stroke-width="1.8"/>
<text x="680" y="82" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="bold" fill="#1b5e20">
MG995 Servo
</text>
<text x="680" y="100" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#388e3c">
Cover open / close mechanism
</text>
<text x="680" y="115" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#388e3c">
5V supply via LM2596
</text>
<!-- LED MOSFET + Panel -->
<rect x="580" y="150" width="200" height="70" rx="8"
fill="#fffde7" stroke="#f9a825" stroke-width="1.8"/>
<text x="680" y="177" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="bold" fill="#e65100">
IRLZ44N MOSFET-A
</text>
<text x="680" y="195" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#bf360c">
→ White LED Panel (12V)
</text>
<text x="680" y="211" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#bf360c">
PWM brightness 0255
</text>
<!-- Dew Heater MOSFET -->
<rect x="580" y="245" width="200" height="70" rx="8"
fill="#fce4ec" stroke="#c62828" stroke-width="1.8"/>
<text x="680" y="272" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="bold" fill="#b71c1c">
IRLZ44N MOSFET-B
</text>
<text x="680" y="290" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#c62828">
→ Dew Heater Element (12V)
</text>
<text x="680" y="306" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#c62828">
PWM power 0100 %
</text>
<!-- PSU + Buck -->
<rect x="580" y="340" width="200" height="90" rx="8"
fill="#ede7f6" stroke="#6a1b9a" stroke-width="1.8"/>
<text x="680" y="367" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="12" font-weight="bold" fill="#4a148c">
12V PSU (≥4A)
</text>
<text x="680" y="386" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#6a1b9a">
→ 12V rail: LED + dew heater
</text>
<text x="680" y="402" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#6a1b9a">
→ LM2596 buck → 5V rail
</text>
<text x="680" y="418" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#6a1b9a">
→ 5V: ESP32 VIN + servo
</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- Connection arrows: PC → ESP32 -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- WiFi (dashed blue) -->
<path d="M 250 119 C 280 119 275 185 300 185"
fill="none" stroke="#1565c0" stroke-width="2" stroke-dasharray="7,4"
marker-end="url(#arr-blue)"/>
<text x="263" y="153" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#1565c0" transform="rotate(-10, 263, 153)">
HTTP / Alpaca
</text>
<text x="263" y="165" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#1565c0" transform="rotate(-10, 263, 165)">
WiFi :11111
</text>
<!-- USB (solid green) -->
<path d="M 250 191 C 278 191 275 230 300 230"
fill="none" stroke="#2e7d32" stroke-width="2"
marker-end="url(#arr-green)"/>
<text x="258" y="223" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#2e7d32" transform="rotate(5, 258, 223)">
USB / Alnitak
</text>
<text x="258" y="235" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#2e7d32" transform="rotate(5, 258, 235)">
9600 baud serial
</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- ESP32 → outputs -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- → MG995 (D9) -->
<path d="M 510 185 C 545 185 545 90 580 90"
fill="none" stroke="#2e7d32" stroke-width="1.8"
marker-end="url(#arr-green)"/>
<text x="534" y="130" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#2e7d32">D9</text>
<!-- → LED MOSFET (D3) -->
<line x1="510" y1="220" x2="580" y2="185"
stroke="#f9a825" stroke-width="1.8" marker-end="url(#arr-orange)"/>
<text x="532" y="210" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#e65100">D3 PWM</text>
<!-- → Dew MOSFET (D5) -->
<line x1="510" y1="270" x2="580" y2="280"
stroke="#c62828" stroke-width="1.8" marker-end="url(#arr-red)"/>
<text x="522" y="268" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#c62828">D5 PWM</text>
<!-- PSU → ESP32 VIN (5V) -->
<path d="M 580 385 C 520 385 495 340 510 335"
fill="none" stroke="#e65100" stroke-width="1.8" stroke-dasharray="5,3"
marker-end="url(#arr-orange)"/>
<text x="490" y="373" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#e65100">5V VIN</text>
<!-- ══════════════════════════════════════════════════════════════════════ -->
<!-- Legend -->
<!-- ══════════════════════════════════════════════════════════════════════ -->
<rect x="22" y="310" width="230" height="130" rx="6"
fill="#f5f5f5" stroke="#ccc" stroke-width="1"/>
<text x="35" y="330" font-family="Segoe UI, Arial, sans-serif"
font-size="11" font-weight="bold" fill="#333">Legend</text>
<line x1="35" y1="348" x2="80" y2="348" stroke="#1565c0" stroke-width="2" stroke-dasharray="7,4"/>
<text x="88" y="352" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">WiFi / Alpaca (HTTP)</text>
<line x1="35" y1="368" x2="80" y2="368" stroke="#2e7d32" stroke-width="2"/>
<text x="88" y="372" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">USB / Alnitak (serial)</text>
<line x1="35" y1="388" x2="80" y2="388" stroke="#f9a825" stroke-width="2"/>
<text x="88" y="392" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">GPIO / PWM signal</text>
<line x1="35" y1="408" x2="80" y2="408" stroke="#e65100" stroke-width="2" stroke-dasharray="5,3"/>
<text x="88" y="412" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">Power supply (5V)</text>
<text x="35" y="432" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#777">
Both WiFi and USB active simultaneously
</text>
<!-- Version / note -->
<text x="430" y="505" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#999">
ESP32 FlatPanel v1.1 — github.com / your-repo
</text>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

313
docs/wiring-diagram.svg Normal file
View file

@ -0,0 +1,313 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="640" viewBox="0 0 960 640">
<defs>
<!-- Small filled resistor symbol via marker (not used rendered inline) -->
<marker id="a-red" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#c62828"/>
</marker>
<marker id="a-orange" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#e65100"/>
</marker>
<marker id="a-black" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#212121"/>
</marker>
<marker id="a-blue" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#1565c0"/>
</marker>
<marker id="a-yellow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#f9a825"/>
</marker>
<marker id="a-grey" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#616161"/>
</marker>
<marker id="a-purple" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
<polygon points="0 0,8 3,0 6" fill="#6a1b9a"/>
</marker>
</defs>
<!-- White background -->
<rect width="960" height="640" fill="white"/>
<!-- Title -->
<text x="480" y="30" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="17" font-weight="bold" fill="#212121">
ESP32 FlatPanel — Wiring Diagram
</text>
<text x="480" y="48" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#777">
Wire colours: red=12V orange=5V black=GND blue=PWM signal yellow=servo signal grey=load output
</text>
<!-- ═══════════════════════════════════════════════════════════ COMPONENTS -->
<!-- 12V PSU -->
<rect x="30" y="70" width="130" height="80" rx="8" fill="#fff8e1" stroke="#f57f17" stroke-width="2"/>
<text x="95" y="100" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#e65100">12V PSU</text>
<text x="95" y="118" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">≥ 4A</text>
<!-- Terminals -->
<circle cx="50" cy="140" r="5" fill="#c62828"/><text x="50" y="158" text-anchor="middle" font-size="9" fill="#333">12V+</text>
<circle cx="95" cy="140" r="5" fill="#212121"/><text x="95" y="158" text-anchor="middle" font-size="9" fill="#333">GND</text>
<circle cx="140" cy="140" r="5" fill="#c62828"/><text x="140" y="158" text-anchor="middle" font-size="9" fill="#333">12V+</text>
<!-- LM2596 Buck Converter -->
<rect x="210" y="70" width="140" height="80" rx="8" fill="#f9fbe7" stroke="#827717" stroke-width="2"/>
<text x="280" y="97" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#558b2f">LM2596 Buck</text>
<text x="280" y="113" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">Set to 5.0V first!</text>
<circle cx="225" cy="140" r="5" fill="#c62828"/><text x="225" y="158" text-anchor="middle" font-size="9" fill="#333">IN+</text>
<circle cx="255" cy="140" r="5" fill="#212121"/><text x="255" y="158" text-anchor="middle" font-size="9" fill="#333">IN</text>
<circle cx="305" cy="140" r="5" fill="#e65100"/><text x="305" y="158" text-anchor="middle" font-size="9" fill="#333">OUT+</text>
<circle cx="335" cy="140" r="5" fill="#212121"/><text x="335" y="158" text-anchor="middle" font-size="9" fill="#333">OUT</text>
<!-- Arduino Nano ESP32 -->
<rect x="370" y="200" width="180" height="260" rx="10" fill="#e3f2fd" stroke="#1565c0" stroke-width="2.5"/>
<text x="460" y="226" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#0d47a1">Arduino Nano ESP32</text>
<!-- Pin labels -->
<text x="460" y="252" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">D9 → servo</text>
<text x="460" y="268" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">D3 → LED MOSFET gate</text>
<text x="460" y="284" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">D5 → Dew MOSFET gate</text>
<line x1="385" y1="295" x2="535" y2="295" stroke="#90caf9" stroke-width="1"/>
<text x="460" y="315" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">VIN ← 5V</text>
<text x="460" y="331" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">GND ← common GND</text>
<line x1="385" y1="342" x2="535" y2="342" stroke="#90caf9" stroke-width="1"/>
<text x="460" y="362" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">USB-C → PC</text>
<text x="460" y="378" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">(Alnitak 9600 baud)</text>
<text x="460" y="400" text-anchor="middle" font-family="Courier New, monospace" font-size="9" fill="#555">WiFi → Alpaca :11111</text>
<!-- ESP32 terminals (left side going out to servo) -->
<circle cx="370" cy="252" r="5" fill="#f9a825"/> <!-- D9 servo -->
<circle cx="370" cy="268" r="5" fill="#1565c0"/> <!-- D3 LED PWM -->
<circle cx="370" cy="284" r="5" fill="#1565c0"/> <!-- D5 Dew PWM -->
<circle cx="370" cy="315" r="5" fill="#e65100"/> <!-- VIN 5V -->
<circle cx="370" cy="331" r="5" fill="#212121"/> <!-- GND -->
<!-- USB port symbol on right -->
<rect x="542" y="358" width="8" height="16" rx="2" fill="#666"/>
<text x="556" y="370" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#555">USB-C</text>
<!-- MG995 Servo -->
<rect x="30" y="290" width="140" height="80" rx="8" fill="#e8f5e9" stroke="#2e7d32" stroke-width="2"/>
<text x="100" y="320" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#1b5e20">MG995 Servo</text>
<text x="100" y="338" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#388e3c">Cover mechanism</text>
<circle cx="50" cy="360" r="5" fill="#212121"/><text x="50" y="378" text-anchor="middle" font-size="9" fill="#333">GND</text>
<circle cx="100" cy="360" r="5" fill="#e65100"/><text x="100" y="378" text-anchor="middle" font-size="9" fill="#333">5V</text>
<circle cx="150" cy="360" r="5" fill="#f9a825"/><text x="150" y="378" text-anchor="middle" font-size="9" fill="#333">Signal</text>
<!-- MOSFET-A (LED) -->
<rect x="210" y="290" width="140" height="100" rx="8" fill="#fff9c4" stroke="#f57f17" stroke-width="2"/>
<text x="280" y="317" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="11" font-weight="bold" fill="#e65100">IRLZ44N</text>
<text x="280" y="333" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#e65100">MOSFET-A (LED)</text>
<text x="280" y="349" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#777">Gate Drain Source</text>
<circle cx="235" cy="370" r="5" fill="#1565c0"/><text x="235" y="388" text-anchor="middle" font-size="9" fill="#333">Gate</text>
<circle cx="280" cy="370" r="5" fill="#616161"/><text x="280" y="388" text-anchor="middle" font-size="9" fill="#333">Drain</text>
<circle cx="325" cy="370" r="5" fill="#212121"/><text x="325" y="388" text-anchor="middle" font-size="9" fill="#333">Source</text>
<!-- MOSFET-B (Dew) -->
<rect x="210" y="430" width="140" height="100" rx="8" fill="#fce4ec" stroke="#c62828" stroke-width="2"/>
<text x="280" y="457" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="11" font-weight="bold" fill="#b71c1c">IRLZ44N</text>
<text x="280" y="473" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#b71c1c">MOSFET-B (Dew)</text>
<text x="280" y="489" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="9" fill="#777">Gate Drain Source</text>
<circle cx="235" cy="510" r="5" fill="#1565c0"/><text x="235" y="528" text-anchor="middle" font-size="9" fill="#333">Gate</text>
<circle cx="280" cy="510" r="5" fill="#616161"/><text x="280" y="528" text-anchor="middle" font-size="9" fill="#333">Drain</text>
<circle cx="325" cy="510" r="5" fill="#212121"/><text x="325" y="528" text-anchor="middle" font-size="9" fill="#333">Source</text>
<!-- LED Panel -->
<rect x="680" y="270" width="180" height="80" rx="8" fill="#fffde7" stroke="#f9a825" stroke-width="2"/>
<text x="770" y="300" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#e65100">LED Panel (12V)</text>
<text x="770" y="318" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">White high-CRI strip</text>
<text x="770" y="334" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">+ frosted acrylic</text>
<circle cx="710" cy="342" r="5" fill="#c62828"/><text x="710" y="360" text-anchor="middle" font-size="9" fill="#333">LED+</text>
<circle cx="760" cy="342" r="5" fill="#616161"/><text x="760" y="360" text-anchor="middle" font-size="9" fill="#333">LED</text>
<!-- Dew Heater Element -->
<rect x="680" y="420" width="180" height="80" rx="8" fill="#fbe9e7" stroke="#c62828" stroke-width="2"/>
<text x="770" y="450" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#b71c1c">Dew Heater</text>
<text x="770" y="468" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">Nichrome / heating tape</text>
<text x="770" y="484" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="10" fill="#777">~24Ω 6W @ 12V</text>
<circle cx="710" cy="492" r="5" fill="#c62828"/><text x="710" y="510" text-anchor="middle" font-size="9" fill="#333">H+</text>
<circle cx="760" cy="492" r="5" fill="#616161"/><text x="760" y="510" text-anchor="middle" font-size="9" fill="#333">H</text>
<!-- ═══════════════════════════════════════════════════════════════ WIRES -->
<!-- 12V rail: PSU 12V+ → LM2596 IN+ -->
<line x1="140" y1="140" x2="225" y2="140" stroke="#c62828" stroke-width="2.5" marker-end="url(#a-red)"/>
<!-- GND rail: PSU GND → LM2596 IN -->
<line x1="95" y1="140" x2="100" y2="175" stroke="#212121" stroke-width="2.5"/>
<line x1="100" y1="175" x2="255" y2="175" stroke="#212121" stroke-width="2.5" marker-end="url(#a-black)"/>
<text x="168" y="170" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#333">GND bus</text>
<!-- 5V rail: LM2596 OUT+ → ESP32 VIN -->
<line x1="305" y1="140" x2="340" y2="140" stroke="#e65100" stroke-width="2.5"/>
<line x1="340" y1="140" x2="340" y2="315" stroke="#e65100" stroke-width="2.5"/>
<line x1="340" y1="315" x2="370" y2="315" stroke="#e65100" stroke-width="2.5" marker-end="url(#a-orange)"/>
<text x="322" y="230" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#e65100"
transform="rotate(-90, 322, 230)">5V</text>
<!-- 5V rail: LM2596 OUT+ → MG995 VCC -->
<line x1="340" y1="330" x2="200" y2="330" stroke="#e65100" stroke-width="2.5"/>
<line x1="200" y1="330" x2="200" y2="360" stroke="#e65100" stroke-width="2.5"/>
<line x1="200" y1="360" x2="150" y2="360" stroke="#e65100" stroke-width="2.5" marker-end="url(#a-orange)"/>
<!-- GND rail: LM2596 OUT → ESP32 GND -->
<line x1="335" y1="175" x2="355" y2="175" stroke="#212121" stroke-width="2.5"/>
<line x1="355" y1="175" x2="355" y2="331" stroke="#212121" stroke-width="2.5"/>
<line x1="355" y1="331" x2="370" y2="331" stroke="#212121" stroke-width="2.5" marker-end="url(#a-black)"/>
<!-- GND rail: → MG995 GND -->
<line x1="355" y1="360" x2="100" y2="360" stroke="#212121" stroke-width="2.5" marker-end="url(#a-black)"/>
<!-- GND rail: → MOSFET-A Source -->
<line x1="325" y1="370" x2="325" y2="390" stroke="#212121" stroke-width="2.5"/>
<line x1="325" y1="390" x2="355" y2="390" stroke="#212121" stroke-width="2.5"/>
<line x1="355" y1="390" x2="355" y2="510" stroke="#212121" stroke-width="2.5"/>
<!-- GND rail: → MOSFET-B Source -->
<line x1="355" y1="510" x2="325" y2="510" stroke="#212121" stroke-width="2.5" marker-end="url(#a-black)"/>
<!-- Servo signal: ESP32 D9 → MG995 Signal -->
<line x1="370" y1="252" x2="200" y2="252" stroke="#f9a825" stroke-width="2" stroke-dasharray="6,3"/>
<line x1="200" y1="252" x2="200" y2="290" stroke="#f9a825" stroke-width="2" stroke-dasharray="6,3"/>
<line x1="200" y1="290" x2="170" y2="290" stroke="#f9a825" stroke-width="2" stroke-dasharray="6,3"/>
<line x1="170" y1="290" x2="170" y2="360" stroke="#f9a825" stroke-width="2" stroke-dasharray="6,3" marker-end="url(#a-yellow)"/>
<text x="220" y="248" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#f9a825">D9 servo</text>
<!-- LED PWM: ESP32 D3 → 100Ω → MOSFET-A Gate -->
<!-- Wire from ESP32 D3 terminal -->
<line x1="370" y1="268" x2="248" y2="268" stroke="#1565c0" stroke-width="2"/>
<line x1="248" y1="268" x2="248" y2="290" stroke="#1565c0" stroke-width="2"/>
<!-- 100Ω resistor symbol (small rect) -->
<rect x="237" y="290" width="22" height="10" rx="2" fill="#fff" stroke="#1565c0" stroke-width="1.5"/>
<text x="248" y="299" text-anchor="middle" font-family="Courier New, monospace" font-size="7" fill="#1565c0">100R</text>
<!-- Continue to gate -->
<line x1="248" y1="300" x2="248" y2="370" stroke="#1565c0" stroke-width="2"/>
<line x1="248" y1="370" x2="235" y2="370" stroke="#1565c0" stroke-width="2" marker-end="url(#a-blue)"/>
<!-- 10kΩ pull-down from gate node to GND -->
<line x1="248" y1="340" x2="230" y2="340" stroke="#1565c0" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="218" y="332" width="12" height="16" rx="2" fill="#fff" stroke="#999" stroke-width="1"/>
<text x="224" y="343" text-anchor="middle" font-family="Courier New, monospace" font-size="6" fill="#777">10k</text>
<text x="208" y="298" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#1565c0">D3</text>
<!-- Dew PWM: ESP32 D5 → 100Ω → MOSFET-B Gate -->
<line x1="370" y1="284" x2="185" y2="284" stroke="#1565c0" stroke-width="2"/>
<line x1="185" y1="284" x2="185" y2="510" stroke="#1565c0" stroke-width="2"/>
<!-- 100Ω resistor -->
<rect x="174" y="490" width="22" height="10" rx="2" fill="#fff" stroke="#1565c0" stroke-width="1.5"/>
<text x="185" y="499" text-anchor="middle" font-family="Courier New, monospace" font-size="7" fill="#1565c0">100R</text>
<line x1="185" y1="500" x2="185" y2="510" stroke="#1565c0" stroke-width="2"/>
<line x1="185" y1="510" x2="235" y2="510" stroke="#1565c0" stroke-width="2" marker-end="url(#a-blue)"/>
<!-- 10kΩ pull-down -->
<line x1="185" y1="470" x2="165" y2="470" stroke="#1565c0" stroke-width="1" stroke-dasharray="3,2"/>
<rect x="153" y="462" width="12" height="16" rx="2" fill="#fff" stroke="#999" stroke-width="1"/>
<text x="159" y="473" text-anchor="middle" font-family="Courier New, monospace" font-size="6" fill="#777">10k</text>
<text x="196" y="281" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#1565c0">D5</text>
<!-- 12V rail: PSU → 12V bus (vertical red rail on right) -->
<line x1="50" y1="140" x2="50" y2="165" stroke="#c62828" stroke-width="2.5"/>
<line x1="50" y1="165" x2="660" y2="165" stroke="#c62828" stroke-width="3"/>
<text x="550" y="160" font-family="Segoe UI, Arial, sans-serif" font-size="10"
font-weight="bold" fill="#c62828">12V rail</text>
<!-- 12V → LED Panel LED+ -->
<line x1="660" y1="165" x2="660" y2="310" stroke="#c62828" stroke-width="2.5"/>
<line x1="660" y1="310" x2="710" y2="310" stroke="#c62828" stroke-width="2.5" marker-end="url(#a-red)"/>
<!-- 12V → Dew Heater H+ -->
<line x1="640" y1="165" x2="640" y2="460" stroke="#c62828" stroke-width="2.5"/>
<line x1="640" y1="460" x2="710" y2="460" stroke="#c62828" stroke-width="2.5" marker-end="url(#a-red)"/>
<!-- MOSFET-A Drain → LED (load output wire) -->
<line x1="280" y1="370" x2="280" y2="410" stroke="#616161" stroke-width="2"/>
<line x1="280" y1="410" x2="620" y2="410" stroke="#616161" stroke-width="2"/>
<line x1="620" y1="410" x2="620" y2="342" stroke="#616161" stroke-width="2"/>
<line x1="620" y1="342" x2="760" y2="342" stroke="#616161" stroke-width="2" marker-end="url(#a-grey)"/>
<text x="430" y="406" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#616161">LED (via MOSFET-A drain)</text>
<!-- MOSFET-B Drain → Dew Heater H -->
<line x1="280" y1="510" x2="280" y2="555" stroke="#616161" stroke-width="2"/>
<line x1="280" y1="555" x2="635" y2="555" stroke="#616161" stroke-width="2"/>
<line x1="635" y1="555" x2="635" y2="492" stroke="#616161" stroke-width="2"/>
<line x1="635" y1="492" x2="760" y2="492" stroke="#616161" stroke-width="2" marker-end="url(#a-grey)"/>
<text x="430" y="551" font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#616161">H (via MOSFET-B drain)</text>
<!-- ═══════════════════════════════════════════════════════════════ LEGEND -->
<rect x="560" y="60" width="200" height="190" rx="8" fill="#f5f5f5" stroke="#bdbdbd" stroke-width="1.5"/>
<text x="660" y="82" text-anchor="middle" font-family="Segoe UI, Arial, sans-serif"
font-size="12" font-weight="bold" fill="#333">Wire Legend</text>
<!-- Red -->
<line x1="578" y1="100" x2="618" y2="100" stroke="#c62828" stroke-width="3"/>
<text x="626" y="104" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">12V positive</text>
<!-- Orange -->
<line x1="578" y1="120" x2="618" y2="120" stroke="#e65100" stroke-width="3"/>
<text x="626" y="124" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">5V positive</text>
<!-- Black -->
<line x1="578" y1="140" x2="618" y2="140" stroke="#212121" stroke-width="3"/>
<text x="626" y="144" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">GND / ground</text>
<!-- Blue solid -->
<line x1="578" y1="160" x2="618" y2="160" stroke="#1565c0" stroke-width="2"/>
<text x="626" y="164" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">PWM signal</text>
<!-- Yellow dashed -->
<line x1="578" y1="180" x2="618" y2="180" stroke="#f9a825" stroke-width="2" stroke-dasharray="6,3"/>
<text x="626" y="184" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">Servo signal</text>
<!-- Grey -->
<line x1="578" y1="200" x2="618" y2="200" stroke="#616161" stroke-width="2"/>
<text x="626" y="204" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">Load output</text>
<!-- Resistor symbol -->
<rect x="578" y="214" width="20" height="10" rx="2" fill="#fff" stroke="#555" stroke-width="1.5"/>
<text x="626" y="224" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">Resistor</text>
<!-- ═══════════════════════════════════════════════════════════ NOTES BOX -->
<rect x="560" y="265" width="380" height="140" rx="8" fill="#e3f2fd" stroke="#1565c0" stroke-width="1.5"/>
<text x="570" y="287" font-family="Segoe UI, Arial, sans-serif" font-size="11" font-weight="bold" fill="#0d47a1">
⚠ Build Order
</text>
<text x="570" y="305" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">
1. Set LM2596 to 5.0V BEFORE connecting servo or ESP32
</text>
<text x="570" y="321" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">
2. Add 10kΩ Gate→GND pull-downs on both MOSFETs
</text>
<text x="570" y="337" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">
3. Add 100Ω Gate series resistors on both MOSFETs
</text>
<text x="570" y="353" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">
4. Test LED MOSFET with 5V bench supply before 12V
</text>
<text x="570" y="369" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#333">
5. Flash firmware &amp; verify via Serial before full assembly
</text>
<text x="570" y="393" font-family="Segoe UI, Arial, sans-serif" font-size="10" fill="#777">
MOSFET IRLZ44N pinout (flat face towards you): Gate | Drain | Source
</text>
<!-- Footer -->
<text x="480" y="625" text-anchor="middle"
font-family="Segoe UI, Arial, sans-serif" font-size="9" fill="#999">
Not a certified schematic — verify all connections before powering on. v1.1
</text>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB