WiFi Water Flow Meter Design


I moved the USB-C/input cluster clear of the ESP32 and the visible overlap issue should be resolved. The remaining review item is inside the BQ24074 charger footprint itself, not caused by component placement; I’m documenting that as a footprint-library issue rather than moving unrelated parts.
Layout placement is complete on a compact 60 × 50 mm, 4-layer board. I spread the resistors/passives, moved the USB-C connector clear of the programming header, swapped the charger to the cleaner BQ24074RGTT footprint, and the placement-focused review now shows no remaining placement/footprint/overlap errors.
I stopped before routing as planned; next step is trace routing once you approve this placement.
Route the USB and power traces with 4-layer stackup constraints.
I’ll route only the USB and power nets now, keeping the existing placement intact. I’ll confirm the 4-layer stackup, set appropriate width/clearance rules for USB 2.0 and power rails, clean any stale dangling traces, route, then run DRC on the routed nets.
The routing pass hit the platform timeout after the stackup/rules were applied. I’m checking whether any routes were committed, then I’ll either validate them or report the routing blockage cleanly.
I set the board to a 4-layer stackup with inner GND and power planes, added wider minimum trace rules for USB/power nets, and confirmed there were no dangling traces before routing.
The routing job timed out and did not commit usable routes; review still shows 91 airwires. The blocker appears to be platform routing timeout/board routing complexity, not missing stackup or rules.
Route USB pair
Route power nets
Check routing blockers
Improve placement
Review stackup rules

WiFi Water Flow Meter - Firmware Pin Map
MCU
  • U1: ESP32-S3-WROOM-1-N16R8
  • Firmware target: ESP-IDF or Arduino-ESP32 for ESP32-S3.
Pin Assignments

Table


FunctionESP32-S3 PinNetNotes
UART0 TXTXD0 / GPIO43UART0_TXProgramming/debug TX to J3
UART0 RXRXD0 / GPIO44UART0_RXProgramming/debug RX from J3
BootIO0ESP_BOOTPulled high by R4; SW2 pulls low for download mode
Enable / ResetENESP_ENPulled high by R3; C4 reset delay; SW1 pulls low
RS485 RXIO17RS485_RXFrom MAX3485 RO
RS485 TXIO18RS485_TXTo MAX3485 DI
RS485 DirectionIO7RS485_DEDrives MAX3485 DE and nRE together; high = transmit, low = receive
I2C SDAIO8I2C_SDASHT31 humidity/temperature sensor SDA; R22 pull-up
I2C SCLIO9I2C_SCLSHT31 humidity/temperature sensor SCL; R23 pull-up
WiFi LEDIO10WIFI_LEDDrive high to turn D5 on through R13
Flow LEDIO11FLOW_LEDDrive high to turn D6 on through R14
Charger CHGIO5CHG_STATUSBQ24074 open-drain charge status; low = charging
USB Power GoodIO6USB_PGOODBQ24074 open-drain PGOOD; low = valid USB input
StrapIO46ESP_GPIO46_STRAPPulled low by R5 for download boot compatibility
External Interfaces
RS485 Flow Sensor
  • Connector: J2
  • J2 P1: 12V_SENSOR
  • J2 P2: GND
  • J2 P3: RS485_A
  • J2 P4: RS485_B
  • Firmware should default RS485_DE low for receive. Set high only while transmitting, then return low after UART TX complete.
SHT31 Humidity/Temperature Sensor
  • I2C address: 0x44 because ADDR is tied to GND.
  • Use I2C fast mode up to 400 kHz; lower speed is acceptable.
  • ALERT and NRESET are intentionally unused.
Battery Charger Status
  • CHG_STATUS low: battery charging.
  • USB_PGOOD low: valid USB input present.
  • Both lines are open-drain with 100 kOhm pull-ups to 3.3 V.
Firmware Tasks
  1. Initialize UART0 for programming/debug.
  2. Initialize a second UART or assign RS485 traffic to configured UART pins IO17/IO18.
  3. Implement sensor protocol for the selected ultrasonic flow sensor, likely Modbus RTU.
  4. Accumulate total volume from flow-rate readings and store counters in NVS/flash periodically.
  5. Initialize I2C and read SHT31 temperature/humidity at a low duty cycle.
  6. Drive WiFi LED based on connection state and flow LED based on received flow activity.
  7. Monitor CHG_STATUS and USB_PGOOD for power state telemetry.
  • MCU

  • Pin Assignments

  • External Interfaces

  • RS485 Flow Sensor

  • SHT31 Humidity/Temperature Sensor

  • Battery Charger Status

  • Firmware Tasks