ESP32-S3 Reasoning¶
Overview¶
The specific part used is ESP32-S3-WROOM-1-N16R8 (LCSC C2913202), with 16 MB QSPI flash, 8 MB OPI (octal) PSRAM, and an integrated PCB antenna. The -N16R8 suffix encodes the flash/PSRAM configuration.
Key Strengths¶
-
USB Native Support: Simplifies firmware upload and eliminates USB-serial converter requirements. Full-speed support with ESD protection and proper impedance control in the hardware.
-
Sufficient GPIO: Accommodates ADS1115, INA228, BMP388, LSM6DSOX IMU, opto-coupled UARTs, CAN transceiver, field driver PWM, and digital I/O without pin conflicts.
-
Ample RAM & Flash: 16 MB flash holds the firmware with room for OTA updates, the web file system, settings, and buffered sensor data. The 8 MB PSRAM holds every large buffer (sensor history ring, payload buffers, console queue, PID/CV/thermal logs, IMU ring, efficiency matrix). Internal RAM is reserved for FreeRTOS stacks and TLS handshakes.
-
WiFi Reliability: Supports AP and client mode with watchdog, reconnection logic, and captive portal setup. GPIO-pin recovery overrides let users recover from a failed firmware update or a lost password without re-flashing — see Troubleshooting → Forced recovery.
-
Low Power Sleep Modes: When ignition is off and uploads are complete, the firmware drops the CPU from 240 MHz to 80 MHz and throttles the alternator temperature probe. TempTask is deliberately left running (it reads fine at 80 MHz) but stretches its poll from every 5 s to once a minute while the engine is stopped and no dashboard is connected. Together these cut idle current well below full-speed operation. The WiFi Standby (Keep Reachable) setting (Client mode only) sets what the radio does: on by default, it stays associated in modem-sleep, about 1 mA more than fully off, so the dashboard remains reachable at anchor; turned off, WiFi shuts down entirely. The measured power figures and the full state machine are in Operating Modes & Power.
-
Adequate Processing Power: Dual-core Xtensa LX7 @ 240 MHz handles:
- Real-time control loop firing on every fresh CH1 ADC sample (a fresh sample arrives about every 13 ms, up to about 30 ms in the worst case, as the channel takes its turns in the ADS1115 round-robin)
- Voltage loop: proportional and derivative terms recomputed on that same control tick, integral stepped every
VoltageLoopInterval(100 ms by default, measured about 105 ms and up to ~125 ms) - Thermal derating loop, run on that same control tick against a probe reading that refreshes about every 5 s
- NMEA 2000 CAN parsing
- Field PWM generation
- Web server, SSE dispatch, real-time plots
- Core 0 runs a dedicated TempTask (DS18B20) and httpsTask (all TLS uploads, OTA, weather), leaving Core 1 free for the control loop. Watchdog timeout is 16 s on Core 1.
Hardware: Power Pins and Decoupling¶
| Pin | Net | Notes |
|---|---|---|
| 2 (3V3) | 3V3 | Single supply, 3.3 V from TLV62569 — see Switching Power Supply |
| 1, 40, 41 (GND) | GND | Multiple ground pins all bonded to main GND plane |
| 3 (EN) | Net-(U19-EN) | Pulled through R98 (330 Ω) to the RESET wire (RJ3 cable 4 pin 13) for manual reset |
The S3 has only one external supply rail (3.3 V) and no separate analog supply. Module-level decoupling is handled inside the WROOM-1; the external bypass caps next to the 3V3 pin are C26 (4.7 µF) and C28 (1 µF).
Hardware: GPIO Allocation (V9 build)¶
| GPIO | Module pin | Function | Direction |
|---|---|---|---|
| IO1 | 39 | IGNITION_ISO (engine ignition wake input via VO615A opto) | IN |
| IO2 | 38 | Status LED (GPIO2 net, drives an indicator LED) | OUT |
| IO4 | 4 | FIELD_ENABLE — through R50 (10 kΩ) into the wired-AND node it shares with the INA228 ALERT output and the ON/OFF switch wire, which enables the gate driver's 12 V supply (MT3608) via U15 (see Alternator Field Drive). Driven HIGH to allow field drive, LOW to cut it; this is the line every protection pulls down | OUT |
| IO5 | 5 | WakeFromDeepSleep (active-low to GND via switch panel) | IN |
| IO6 | 6 | UART_RX2_ISOL — NMEA0183 RX (via HCPL2531 ch 2) | IN |
| IO7 | 7 | UART_RX1_ISOL — Victron VE.Direct RX (via HCPL2531 ch 1) | IN |
| IO8 | 12 | EXTRA_OPTICAL_GPIO1_ISOL (spare opto input via VO615A) | IN |
| IO9 | 17 | I2C_SDA — shared bus to ADS1115, INA228, BMP388, LSM6DSOX | bidir |
| IO10 | 18 | I2C_SCL — same bus | OUT |
| IO11 | 19 | Unused — routed only to the unpopulated J3 debug header | — |
| IO13 | 21 | TEMP_DQ — DS18B20 OneWire data (via 100 Ω series + 1 nF filter) | bidir |
| IO14 | 22 | OUT_PWM — alternator field PWM to LM5109A HI input | OUT |
| IO16 | 9 | GPIO16 — CAN RX from ISO1050 | IN |
| IO17 | 10 | GPIO17 — CAN TX to ISO1050 | OUT |
| (USB D-) | 13 | ESP32_D- → USB-C via 22 Ω + USBLC6 | bidir |
| (USB D+) | 14 | ESP32_D+ → USB-C via 22 Ω + USBLC6 | bidir |
| IO21 | 23 | BuzzerControl — to BC847 base via R38 | OUT |
| IO39 | 32 | HIGH/LOW_ISO (mode-select opto input) | IN |
| IO40 | 33 | FORCEFLOAT_ISO (mode-select opto input) | IN |
| IO42 | 35 | BMSLogic_ISO (BMS enable opto input) | IN |
| IO3 | 15 | EXTRA6 net, broken out via 330 Ω (R101) to J3 pin 11 — configured by firmware as the fast alternator-current input (ADC1 channel 2, hardware-timed continuous sampling). Fed by the fast-sampling tap (Analog Inputs); the firmware stops sampling the channel if it reads full scale for 10 s with alternator current below 50 A, and retries every 5 min | IN |
| IO12, IO15, IO18, IO38 | 20, 8, 11, 31 | EXTRA_3 / EXTRA_4 / EXTRA_5 / EXTRA7 (uncommitted, broken out via 330 Ω to J3 pins 8, 9, 10 and 12) | — |
| IO41 | 34 | FactoryReset (active-low GND-style switch via 330 Ω) | IN |
| IO45 | 26 | WifiReset (active-low GND-style switch via 330 Ω) | IN |
| IO46 | 16 | AP/ClientMode (active-low GND-style switch via 330 Ω) | IN |
| IO0 | 27 | Boot mode select — broken out via 330 Ω to RJ3 cable 3 pin 8 for programming | IN |
| RXD0 / TXD0 | 36 / 37 | UART0 — not connected on the board; the serial console runs on the native USB port (USB Serial/JTAG) instead | — |
| IO35, IO36, IO37, IO47, IO48 | 28, 29, 30, 24, 25 | Reserved by module — octal SPI PSRAM lines, must not be routed | — |
Why every off-board GPIO has a 330 Ω series resistor: R56, R58, R71, R98, R100, R101, R102, R104, R105, R106 and R107 are all 330 Ω 0402 series resistors between the ESP32 pin and the connector. They limit fault current to ~10 mA if a user shorts an output to GND or applies 3.3 V to an unprotected input. This protects the ESP32 internal ESD clamps and is a routine practice for any GPIO exposed at a field connector.
Why IO35/36/37/47/48 are unconnected: On the N16R8 module these pins are bonded internally to the octal SPI interface that connects the ESP32 to the on-package PSRAM. They are not available for user use, even though some package diagrams show them. Attempting to use them will corrupt PSRAM access and crash the chip immediately.
Hardware: Reset and Boot¶
| Function | Mechanism |
|---|---|
| Power-on reset | Internal POR — no external supervisor IC |
| Manual reset | Connect the Cable 4 RESET wire (pin 13) to pin 16, which pulls the EN pin low through R98 |
| Programming mode (ROM download mode) | Connect IO0 (Cable 3 pin 8) to Cable 4 pin 16 before reset. Disconnect IO0 after RESET is released. |
In normal operation IO0 is held high by R43 (10 kΩ to 3.3 V), which selects boot from SPI flash. The board does not auto-toggle IO0/RESET because the native USB programming path doesn't require it (the S3's USB Serial/JTAG interface resets it into download mode on host command). The manual override exists as a fallback for the rare case where firmware has locked up and can't enter download mode on USB request.
Hardware: RF Layout¶
- Antenna is the integrated PCB trace on the WROOM-1 module substrate.
- The module's antenna end hangs off the edge of the board, so there is no board copper under or beside the antenna and no keep-out zone to keep.
- WiFi performance through the wooden enclosure is excellent: wood is nearly transparent to 2.4 GHz, unlike a metal box. This was an explicit selection criterion.
See Also¶
- Switching Power Supply: the 3.3 V rail that powers the module
- USB-C: programming interface
- Data Cables & Pinout: off-board pinout for each GPIO function
- Digital Inputs: opto and ground-style input circuits behind IGNITION_ISO, BMSLogic_ISO, and the four switch inputs