Project Startup


Worked for 3 mins
Thought for 16 sec
Managing assets.
Thought for 17 sec — Gathering documentation and schematics
Reading project docs.
Thought for 13 sec
Getting a schematic overview for ESP32.
Thought for 12 sec
Reading schematic details while tracing connections from U1.
Thought for 16 sec — Considering pin mappings
Reading schematic details for U1.
Thought for 47 sec — Creating project documentation
Updating 2 project docs.
Created 2 project docs

Firmware Starter — ESP32-S3-WROOM-1-N16R8

View Document

Firmware Starter — ESP32-S3-WROOM-1-N16R8 Platform & Toolchain
  • MCU: U1, ESP32-S3-WROOM-1-N16R8
  • Framework: Arduino-ESP32 through PlatformIO
  • Purpose: Safe board bring-up firmware. Peripheral rails default off; transmit-capable modules require explicit user action.
Pin Mapping
Low-speed power enables, isolation controls, buttons, presence inputs, and night-mode control are provided through TCA9535 expanders U23 and U32 on the system I2C bus. Their exact port roles are defined by the net names in the schematic and must remain default-off until configured.
platformio.ini Complete Starter Source — src/main.cpp Build & Flash
Set SW3 to DOWNLOAD or hold BOOT (SW2) while resetting (SW1) to enter the ROM bootloader. Return SW3 to NORMAL after ...

Board Bring-Up Plan

View Document

Board Bring-Up Plan Prerequisites
  • Bench supply with current limit, DMM, oscilloscope, USB current meter, thermal camera, USB data isolator, logic analyzer, known-good 1S protected packs, and ESD-safe workstation.
  • Use the Firmware Starter safe bring-up image.
  • Start without NFC, sub-GHz, display, removable storage, debug target, microphone, speaker, or expansion modules attached.
1. Visual and Unpowered Inspection
  • Verify orientation and soldering of U1–U38, D1–D5, Q1, F2/F3, polarized battery connectors, USB-C J1, microSD J3, and switches SW1–SW3.
  • Confirm no conductive debris beneath shielded modules or connectors.
  • Measure resistance from USB_VBUS, PACK_A_FUSED, PACK_B_FUSED, VBAT, VSYS, 3V3, 5V_BOOST, and 5V_TARGET to GND. Investigate readings below 10 ohms befo...
Can it have a keyboard
Yes. I’ll include a compact, glove-tolerant thumb QWERTY keyboard in the handheld concept, plus the existing directional controls and dedicated power/back keys. It will connect through the I/O expander as a scanned key matrix so it uses few ESP32 pins and can wake the device from sleep.
The concept image is saved, and I created the Firmware Starter and Board Bring-Up Plan.
Before placement, confirm this layout plan:
  • Main PCB: retain 160 × 100 mm, four layers, standard through-vias.
  • Keyboard: separate front-panel thumb-QWERTY matrix PCB connected through the I/O expander; directional, power, and back controls remain dedicated.
  • Top side: MCU, power stages, radios/modules, SD, connectors, switches, and tall components.
  • Bottom side: small passives only.
  • Edges: USB-C and SD accessible at the front; debug/expansion ports along one side; batteries and emergency-isolation interfaces opposite; antennas separated along the rear edge.
  • RF: dedicated NFC, sub-GHz, and ESP32 antenna keepouts.
  • Manufacturing: standard 1 oz copper, no HDI or microvias; compatible with mainstream prototype fabs.
Reply confirmed to start placement and routing, or specify a different board size or keyboard arrangement.

Waiting for input


Phase 1 Power Budget
Design envelope
The proof-of-concept uses two protected 1S Li-ion/LiPo packs, independently charged at 100 mA each, feeding a reverse-blocking TPS2121 mux. VBAT then feeds the existing BQ25895 system path. Exact operating figures must be replaced by prototype measurements before enclosure sealing.

Table


LoadRailSleep/OffTypical ActivePeak Design Allowance
ESP32-S3 module3.3 V20 µA180 mA500 mA
Outdoor display + backlight3.3 V switched0100 mA180 mA
Onboard microSD3.3 V switched050 mA200 mA
NFC module3.3 V switched080 mA150 mA
Sub-GHz module3.3 V switched035 mA150 mA
IR transmitter/receiver3.3 V switched030 mA200 mA pulsed
UI, haptic, indicators, translators3.3 V5 µA80 mA200 mA
U31 ADC + U32 expander3.3 V<1 mA2 mA10 mA
Digital microphone3V3_MIC_SW01 mA5 mA
Removable storage bay3V3_STORAGE_SW080 mA300 mA
External target/USB-host allowance5 V switched0250 mA500 mA
8 Ω speaker amplifierVSYS_AUDIO_SW0program dependent500 mA limited allowance
Pack A chargerUSB_VBUS0100 mA100 mA
Pack B chargerUSB_VBUS0100 mA100 mA
Rail totals
  • Updated 3.3 V simultaneous design peak: approximately 1.90 A including the removable storage bay.
  • The 3.3 V regulator remains a 2 A-class design and is now close to its theoretical peak; firmware must avoid all optional 3.3 V loads being active simultaneously, and hardware validation must confirm thermal/transient margin.
  • Existing switched 5 V target allowance: 500 mA peak.
  • Audio allowance directly from VSYS: 500 mA peak, based on an 8 Ω speaker and firmware volume limiting.
  • USB charging load: 200 mA total before system consumption.
Battery-side worst case
At a depleted-cell design voltage of 3.0 V:
  • 3.3 V rail: (3.3 V × 1.90 A) / (3.0 V × 0.90) ≈ 2.32 A.
  • 5 V rail: (5 V × 0.50 A) / (3.0 V × 0.85) ≈ 0.98 A.
  • Audio allowance on VSYS: approximately 0.50 A.
  • Combined theoretical allowance: approximately 3.8 A, excluding converter transient and quiescent current.
The TPS2121 is programmed near 4 A and each bay is fused at 4 A. This is a protection ceiling, not a recommended continuous operating point. Firmware interlocks and measured load profiles are required to retain transient and thermal margin.
Charging and USB input budget
  • U29 and U30 are fixed at 100 mA per bay using 10 kΩ PROG resistors.
  • With both packs charging, 200 mA is consumed before the active system load.
  • On a default-current USB source, high-current peripherals must remain off unless advertised current and thermal conditions permit them.
  • U2 charging must remain disabled; otherwise the muxed VBAT node could create uncontrolled cross-charging behavior.
Energy estimate
For two installed 5000 mAh, 3.7 V packs, ideal parallel energy inventory is 37 Wh, but the packs are not hard-paralleled and usable runtime depends on mux selection, pack mismatch, cutoff thresholds, and conversion losses.
  • At a representative 2.5 W mixed-use load, a nominal two-pack runtime is roughly 11–13 h after reserve and conversion losses.
  • High display brightness, radio transmission, target power, audio output, and storage writes can reduce runtime substantially.
  • Multi-week standby still requires all optional rails off and total always-on current well below 100 µA; this target must be measured because the BQ25895, fuel gauge, mux, ADC, and expanders remain present.
Required firmware interlocks
  1. Do not run maximum display, radio transmit, target 5 V, storage write, and audio output simultaneously.
  2. Restrict audio amplitude and use an 8 Ω speaker.
  3. Power optional rails only for the duration needed.
  4. Enable storage bus isolation only after storage power is stable.
  5. Reduce active loads when both charge channels are running from a low-current USB source.
  6. Log pack A, pack B, and muxed VBAT readings to detect imbalance or a missing pack.
Validation
Measure every block in off, idle, receive, transmit/write, and worst-case transient states. Verify:
  • TPS2121 switchover droop and reverse-current behavior.
  • Fuse, connector, and copper temperature rise.
  • 3.3 V regulator transient response near 2 A.
  • VSYS droop during speaker peaks.
  • USB input current with zero, one, and two packs charging.
  • Runtime and cutoff behavior with mismatched pack state of charge.
  • Design envelope

  • Rail totals

  • Battery-side worst case

  • Charging and USB input budget

  • Energy estimate

  • Required firmware interlocks

  • Validation