WiFi Water Flow Meter Design


Yes, move on to PCB layout and place the components.
I’ll set up a practical 4-layer PCB, size it for the ESP32/USB-C/power/RS485 blocks, then place components with the ESP32 antenna at the board edge, connectors accessible, and decoupling close to IC pins.
PCB layout placement is complete so far.
What I completed:
  • Resized the board to 100 mm × 80 mm with rounded corners.
  • Set a 4-layer stackup for better ESP32 RF grounding, cleaner power routing, and easier RS485/power routing.
  • Placed all 40 physical components on the top layer.
  • Put:
    • USB-C input/protection on the left edge.
    • ESP32 module near the top edge with antenna facing outward.
    • 12V boost converter near the sensor power connector.
    • RS485 interface near the RS485 field connector.
    • J2/J3 sensor connectors on the right edge.
    • UART programming header and LEDs along the bottom edge.
    • Decoupling/support passives close to their ICs.
Current review state:
  • Placement has no reported component overlap or board-boundary issue.
  • The remaining layout errors are airwires, which are expected because routing has not been performed yet.
What remains:
  • Review the placement visually.
  • If you approve the placement, the next step is PCB routing.
  • After routing, run final DRC and fix any routing/clearance issues.
Route with constraints
Check placement DRC
Adjust RS485 connector
Add mounting holes
Review placement view

Board Bring-Up Plan — ESP32 WiFi Water Flow Meter
Prerequisites
  • Equipment: multimeter, current-limited 5V supply or USB-C power meter, oscilloscope, USB-UART adapter, RS485/Modbus test sensor or simulator.
  • Firmware: see the firmware starter project file.
  • Safety: do not connect the external ultrasonic sensor until 12V rail is verified. ESP32 and MAX3485 are 3.3V logic only.
1. Visual Inspection
  • Verify U1 ESP32-WROOM-32E orientation and antenna area.
  • Verify U2 AMS1117 tab/pins, U3 MT3608, U4 MAX3485 orientation.
  • Verify D3 SS14 polarity: anode to BOOST_SW, cathode to 12V_SENSOR.
  • Verify USB-C connector J1 soldering and screw terminals J2/J3 pin labeling.
  • Check all passives: CC resistors R1/R2 = 5.1k, boost feedback R12 = 190k and R13 = 10k.
2. Power Rail Verification

Table


RailSourceExpected VoltageToleranceMeasure AtInitial Current LimitPass Criteria
VBUS_RAWJ1 USB-C VBUS before F15.0V+/-5%J1 VBUS / F1 pin 1250mA first powerNo short to GND
VBUSF1 protected 5V5.0V minus fuse drop+/-5%F1 pin 2, U2 VIN, U3 IN250mA first powerWithin 4.75V to 5.25V at light load
3V3U2 AMS1117-3.33.3V+/-3% typicalU2 VOUT, U1 3V3, U4 VCC250mA first power3.20V to 3.40V
12V_SENSORU3 MT3608 boost12.0V+/-5% targetJ2 pin 1, C9 positive250mA first power11.4V to 12.6V unloaded/light load
GNDCommon return0VN/AJ1/J2/J3 ground pinsN/AAll grounds continuous
Procedure:
  1. With power off, measure resistance from VBUS, 3V3, and 12V_SENSOR to GND. Investigate any near-short.
  2. Apply current-limited 5V at J1/USB-C.
  3. Verify VBUS, then 3V3, then 12V_SENSOR in that order.
  4. Check 12V boost ripple at C9 with an oscilloscope before connecting the sensor.
  5. After basic rails pass, raise current limit to at least 1A for WiFi and boost testing.
3. Critical Signal Verification

Table


SignalNetExpected StateMeasure AtNotes
ESP32 enableESP_ENHIGH near 3.3V after RC delayU1 EN / SW1RESET button pulls LOW
Boot strapESP_BOOTHIGH idle, LOW when BOOT pressedU1 IO0 / SW2LOW during reset enters UART bootloader
Flash voltage strapESP_IO12_BOOT_PDLOW at resetU1 IO12 / R5Required for normal 3.3V flash boot
RS485 directionRS485_DE_RELOW receive idleU4 DE and ~REFirmware drives HIGH for transmit
RS485 busRS485_A / RS485_BBiased differential idleJ3 pinsVerify polarity with sensor datasheet
4. Connector and Interface Tests

Table


ConnectorTypePins to VerifyTest Method
J1USB-C inputVBUS, GND, CC1, CC2Confirm 5.1k from each CC to GND and VBUS continuity through F1
J2Sensor powerPin 1 = 12V_SENSOR, Pin 2 = GNDMeasure 12V before attaching sensor
J3RS485Pin 1 = RS485_A, Pin 2 = RS485_BContinuity to U4 A/B and termination R6
J4UART programming3V3, GND, RXD0, TXD0, BOOT, ENCheck 3.3V logic levels only
5. Programming and Debug Interface

Table


InterfaceSignalsConnectorTool
ESP32 UART bootloader3V3, GND, UART0_RX, UART0_TX, ESP_BOOT, ESP_ENJ4PlatformIO / esptool.py
Procedure:
  1. Connect a 3.3V USB-UART adapter to J4.
  2. Enter bootloader: hold BOOT (SW2), tap RESET (SW1), release RESET, release BOOT.
  3. Run pio run -t upload from the firmware project.
  4. Open serial monitor at 115200 baud and confirm startup log.
6. Functional Validation

Table


TestComponentsInputExpected OutputPass Criteria
Power LEDU2, LED1, R93.3V rail presentLED1 onLED turns on with 3V3
WiFi connectU1, LED2Valid SSID/passwordLED2 solid after connectIP printed in serial log
RS485 loop/pollU1, U4, J3Sensor/simulator on RS485Modbus responsesNo Modbus timeout errors
Flow activityU1, LED3Nonzero flow readingLED3 onLED follows flow > threshold
12V sensor powerU3, J2Sensor attachedStable 12V12V remains in tolerance under load
7. Expected Measurements Reference

Table


MeasurementLocationExpected ValueInstrument
USB input current idleUSB-C power meter<300mA typical without sensorUSB-C power meter
3V3 railU1 3V33.3VMultimeter/scope
12V_SENSOR railJ2 pin 112VMultimeter/scope
RS485 A/B differentialJ3 pins 1/2Activity during pollOscilloscope
EN idleU1 EN3.3VMultimeter
GPIO0 idleU1 IO03.3VMultimeter
Known Bring-Up Notes
  • The 3.3V regulator is linear; monitor U2 temperature during sustained WiFi TX. If it runs hot, move to a 1A+ buck regulator in the next revision.
  • The exact ultrasonic sensor Modbus register map is still assumed. Update firmware once the sensor datasheet/model is confirmed.
  • RS485 termination R6 is populated as 120 ohm; if the sensor/cable already has termination and this board is not at the bus end, depopulate R6.
Pass/Fail Summary

Table


Test SectionResultNotes
Visual Inspection[ ] Pass / [ ] Fail
Power Rails[ ] Pass / [ ] Fail
Critical Signals[ ] Pass / [ ] Fail
Connectors[ ] Pass / [ ] Fail
Programming[ ] Pass / [ ] Fail
Functional Validation[ ] Pass / [ ] Fail
Board Status: [ ] Ready for deployment / [ ] Requires rework
  • Prerequisites

  • 1. Visual Inspection

  • 2. Power Rail Verification

  • 3. Critical Signal Verification

  • 4. Connector and Interface Tests

  • 5. Programming and Debug Interface

  • 6. Functional Validation

  • 7. Expected Measurements Reference

  • Known Bring-Up Notes

  • Pass/Fail Summary