Project Overview and Technical Analysis

1:55

Considering.

Analyzing the schematic.

Running design review.

Reviewing the bill of materials.

Project overview
This is a dual-tank water level monitoring and control board built around U1. Its main job is to:
  • read two ultrasonic level sensors through J11
  • optionally drive four 5 V relay modules RL1, RL2, RL3, RL4
  • expose an I2C expansion / display interface through J5 and J6
  • provide serial/programming access through J3
  • accept a 7 V to 30 V input at J4, then generate regulated 5 V and 3.3 V
So the project is not just a sensor reader. It is really an ESP32-based water monitoring and automation controller.
System architecture
The design breaks into four functional blocks:

Table


BlockMain partsRole
ProcessingU1, J1, J2, J3, IO0, EN1, R5, R6Main control, firmware, boot/reset access
Sensor I/OJ11Two ultrasonic sensor interfaces
PowerJ4, U2, L1, D5, C5, C6, U12, C9, C7, C8, C1Converts 7-30 V input to 5 V, then to 3.3 V
Outputs / indicatorsRL1, RL2, RL3, RL4, LED1, LED2, LED3, LED4, R7, R8, R9, R10Relay control and status indication
How the project works 1. Input power and regulation
The board accepts external supply on J4.
  • J4 pin 3 feeds the input of U2
  • U2 plus L1, D5, C5, and C6 form the buck converter stage
  • that stage produces the 5 V rail
  • the 5 V rail powers:
    • the relay modules RL1, RL2, RL3, RL4
    • sensor connectors J11
    • I2C/display connectors J5, J6
    • serial/programming header J3
    • input to U12
  • U12 then generates the 3.3 V rail
  • C7, C8, and C1 are placed on the 3.3 V rail as bulk/local decoupling
  • C9 is on the 5 V to U12 side
2. Controller and boot/reset support
U1 is the central controller.
Its key connections in this design are:
  • sensor timing inputs/outputs
    • IO19 -> SENSE_TRIGGER 1
    • IO5 -> SENSE_ECHO 1
    • IO27 -> SENSE_TRIGGER 2
    • IO13 -> SENSE_ECHO 2
  • I2C
    • IO21 -> I2C_SDA
    • IO22 -> I2C_SCL
  • relay control
    • IO26 -> RL1 input
    • IO25 -> RL2 input
    • IO33 -> RL3 input
    • IO32 -> RL4 input
  • UART
    • TXD0 and RXD0 go to J3
Boot and reset handling is simple:
  • R5 is a 10 kΩ pull-up on IO0
  • IO0 is a pushbutton to ground for boot mode selection
  • R6 is a 10 kΩ pull-up on EN
  • EN1 is a pushbutton to ground for reset
That gives the board a straightforward manual programming path.
3. Ultrasonic sensing section
The dual-sensor interface is centered on J11, a 6-pin header/socket arrangement.
Mapped signals:
  • Pin 1 -> 5 V
  • Pin 2 -> SENSE_TRIGGER 1
  • Pin 3 -> SENSE_ECHO 1
  • Pin 4 -> SENSE_TRIGGER 2
  • Pin 5 -> SENSE_ECHO 2
  • Pin 6 -> GND
This means the firmware on U1 can sequence the two sensors independently:
  • drive trigger pulse
  • measure echo pulse width
  • convert flight time to distance
  • infer tank level from sensor-to-water distance
4. Relay output section
The board includes four prebuilt relay modules:
Each relay module has:
  • VCC = 5 V
  • GND
  • IN = logic control from U1
  • indicator LED output, mirrored by on-board indicator pairs:
Those resistor values are 4.7 kΩ, so the status LEDs are likely intended as low-current indicators rather than bright panel indicators.
5. Expansion and interfacing
The design includes a few useful interfaces:
  • J5 and J6 carry:
    • SDA
    • SCL
    • 5 V
    • GND
These are likely intended for OLED display or other I2C peripherals.
  • J3 exposes:
    • 5 V
    • TXD0
    • RXD0
    • GND
    • GND
    • IO0
That is a practical debug / flashing / service header.
  • J1 and J2 break out much of U1, which is useful for prototyping, expansion, or maintenance.
Design choices and why they matter Good choices Cascaded power architecture
Using U2 for 7-30 V -> 5 V, then U12 for 5 V -> 3.3 V is a sensible architecture.
Why it helps:
  • relay and sensor loads stay on 5 V
  • U1 gets a cleaner 3.3 V rail
  • the linear drop across U12 is moderate compared with dropping from 24 V directly
Clear functional partitioning
The schematic is logically modular:
  • sensing
  • controller
  • display/I2C
  • relay outputs
  • power
That makes firmware and troubleshooting easier.
Dedicated control outputs
Assigning separate GPIOs for each relay and each sensor channel keeps the firmware simple and deterministic.
Manual boot/reset support
Using IO0, EN1, R5, and R6 is a practical bring-up choice.
Trade-offs Buck + LDO vs all-buck rails
  • Pro: U12 can help clean up the 3.3 V rail after a noisier 5 V switching stage.
  • Con: U12 burns power as heat, especially if 3.3 V current rises.
Relay modules instead of integrated relay drivers
  • Pro: RL1-RL4 simplify design effort and may already include protection/isolation.
  • Con: modular relays increase size, power draw, and usually reduce PCB integration efficiency.
Generic passives in power stage
  • Pro: L1, C5, C6, C1, C7, C8, and C9 let the concept come together quickly.
  • Con: production success depends on final selection of ESR, ripple current, voltage rating, and inductor current rating, which are not fully captured by generic symbols alone.
Key dependencies Hardware dependencies
  • stable input supply on J4
  • correct switching supply behavior around U2, L1, D5, C5, C6
  • adequate 3.3 V regulation from U12
  • sensor electrical compatibility at J11
  • I2C peripheral compatibility at J5 and J6
Firmware dependencies
The firmware must handle:
  • trigger/echo timing for two sensors
  • filtering and sanity checking of distance data
  • relay control policy
  • possible display/UI over I2C
  • network connectivity and remote reporting if used through U1
Performance considerations 1. Sensor accuracy and timing
Ultrasonic sensing performance will depend heavily on:
  • mounting geometry
  • condensation, foam, splashing, and tank shape
  • cross-talk between the two sensors
  • timing separation between trigger events
If both sensors are triggered too closely together, echo pulses can interfere.
2. Noise coupling
Relay switching and the buck converter can inject noise into the system.
Risk sources:
  • U2 switching current loop
  • relay coil/transient behavior within RL1-RL4
  • shared ground return paths between power loads and U1
This matters because ultrasonic echo timing is sensitive to noisy digital thresholds.
3. Thermal behavior
At higher input voltages, total dissipation can become significant:
  • U2 handles the main voltage step-down
  • U12 dissipates (5 V - 3.3 V) * Iload
If Wi-Fi activity, display current, and other 3.3 V loads rise, U12 may run warm.
4. GPIO and voltage-domain safety
This is one of the most important practical concerns.
The sensor header J11 is powered from 5 V, while U1 is a 3.3 V device. If the attached ultrasonic modules drive echo lines to 5 V directly, those echo nets may require explicit level shifting or input protection, depending on the sensor module actually used.

Potential challenges


ChallengeWhy it matters
5 V sensor echo into 3.3 V logicCould overstress or misread U1 inputs
Power-stage generic partsFinal manufacturable choices for L1, C5, C6, C1, C7, C8, C9 still need validation
Relay noiseMay disturb sensor timing and wireless reliability on U1
High-input operationEfficiency and temperature become more important near the top of the 7-30 V range
Missing explicit pull-ups on I2C in visible schematicJ5 and J6 may rely on external pull-ups
Boot robustnessIO0 and EN handling are manual, so programming/reset workflow is not fully automated
Areas for improvement Electrical improvements
  • Add or verify echo line protection / level shifting between J11 and U1
  • Validate the full power stage around U2 with finalized, non-generic passives
  • Confirm input/output capacitor voltage ratings for C5, C6, C7, C8, C9, C1
  • Add explicit local high-frequency decoupling close to U1 if not already present elsewhere in layout/details not fetched here
Interface improvements
  • Add clearer external connector labeling for tank 1 / tank 2 functions on J11
  • Decide whether J5 and J6 are both required, or whether one standardized expansion port is enough
  • Consider adding automatic USB-UART programming support instead of relying mainly on J3, IO0, and EN1
System improvements
  • Add tank calibration parameters in firmware
  • add fault detection:
    • missing sensor
    • out-of-range readings
    • stuck echo
    • relay state mismatch
  • add local alarm outputs or status codes
  • add nonvolatile logging and cloud telemetry if desired via U1
Scalability and future enhancements
This design scales fairly well because U1, J1, and J2 leave room for expansion.
Possible next steps:
  • support more tanks through additional sensor interfaces or I2C/SPI expanders
  • add flow sensing and pump state feedback
  • add local display/UI using J5 or J6
  • replace modular relays RL1-RL4 with more compact integrated driver circuitry in a later revision
  • add surge, reverse-polarity, and fuse protection ahead of J4
  • add watchdog and failsafe firmware modes for unattended installations
Real-world applications
This board is well suited for:
  • household water tank monitoring
  • pump automation and refill control
  • cistern / reservoir level supervision
  • agricultural irrigation storage monitoring
  • industrial utility tank telemetry
  • IoT water infrastructure dashboards
Bottom line
This is a practical ESP32-based sensing + control platform with:
  • dual ultrasonic measurement
  • 4-channel relay actuation
  • dual-rail power conversion
  • I2C expansion
  • manual programming/debug support
Its strongest design choice is the combination of monitoring plus control in one board. Its main technical risks are sensor voltage compatibility, power-stage validation, and noise management.
If you want, I can also turn this into:
  • a block diagram
  • a pin/function map
  • a power-tree summary
  • or a design review with likely issues and fixes
Show a block diagram
Map every ESP32 pin
Review likely issues
48 days

U12
AMS1117-3.3
IO14
ULTRASOUND TRIGGER 2
IO0
IO18
IO19
IO19
IO13
IO35
Relay3
IO2
TXD
IO5
CMD
TXD
IO22
VN
IO35
SD1
Relay3
IO23
IO0
ULTRASOUND ECHO 2
RL2 STATUS
SD3
IO34
SD1
IO15
VP
Relay2
IO15
Relay1
IO4
IO5
IO17
VP
Relay4
TXD
SD0
RL4 STATUS
IO5
EN
IO27
RXD
Relay1
SD3
SDA
IO18
RXD
RL2 STATUS
Relay3
SD0
IO34
SDA
SCL
IO22
IO17
EN
Relay4
EN
CLK
IO13
IO21
IO23
IO4
Relay2
ULTRASOUND TRIGGER 1
SDA
Relay4
CLK
ULTRASOUND ECHO 1
IO16
SD2
SCL
IO27
RL1 STATUS
RL3 STATUS
IO22
ULTRASOUND ECHO 1
IO14
SCL
VN
Relay1
RXD
IO2
IO13
Relay2
ULTRASOUND TRIGGER 1
IO16
RL4 STATUS
IO0
ULTRASOUND ECHO 2
IO21
ULTRASOUND TRIGGER 2
SD2
IO0
CMD
IO19
IO27
IO12
IO21
RL1 STATUS
RL3 STATUS
IO12
J3
5V
J6
J4
5V
5V
3V3
5V
J5
5V
5V
5V
3V3
3V3
3V3
5V
3V3
5V
3V3
3V3
7-30V
7-30V
5V
5V
R9
Resistance
4.7kΩ
M3
J1
C5
Capacitance
680uF
LED2
R5
Resistance
10kΩ
LED1
R10
Resistance
4.7kΩ
POWER SECTION
RL1
RL2
OLED DISPLAY
LED4
C7
Capacitance
10uF
R7
Resistance
4.7kΩ
LED3
IO0
J11
D5
R8
Resistance
4.7kΩ
C6
Capacitance
220uF
U2
Manufacturer Part Number
LM2596S-5.0/NOPB
C9
Capacitance
10uF
C8
Capacitance
10uF
MODULAR RELAY 4X
C1
Capacitance
10uF
RL4
R6
Resistance
10kΩ
ULTRASONIC SENSOR CONNECTOR
EN1
RL3
J2
M4
U1
Manufacturer Part Number
ESP32-WROOM-32D
L1
Inductance
33uH


  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    Wirelessly connects nets on schematic. Used to organize schematics and separate functional blocks. To wirelessly connect net portals, give them same designator. #portal
  • Power Net Portal
    Wirelessly connects power nets on schematic. Identical to the net portal, but with a power symbol. Used to organize schematics and separate functional blocks. To wirelessly connect power net portals, give them the same designator. #portal #power
  • Generic Resistor
    A generic fixed resistor ideal for rapid circuit topology development. Its footprint automatically adapts based on the selected package case code—supporting 0402, 0603, 0805, 1203, and many other standard SMD packages, as well as axial horizontal and vertical configurations. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0 ohm, 10 ohm, 100 ohm, 1.0k ohm, 10k ohm, 100k ohm, 1.0M ohm 1.1 ohm, 11 ohm, 110 ohm, 1.1k ohm, 11k ohm, 110k ohm, 1.1M ohm 1.2 ohm, 12 ohm, 120 ohm, 1.2k ohm, 12k ohm, 120k ohm, 1.2M ohm 1.3 ohm, 13 ohm, 130 ohm, 1.3k ohm, 13k ohm, 130k ohm, 1.3M ohm 1.5 ohm, 15 ohm, 150 ohm, 1.5k ohm, 15k ohm, 150k ohm, 1.5M ohm 1.6 ohm, 16 ohm, 160 ohm, 1.6k ohm, 16k ohm, 160k ohm, 1.6M ohm 1.8 ohm, 18 ohm, 180 ohm, 1.8K ohm, 18k ohm, 180k ohm, 1.8M ohm 2.0 ohm, 20 ohm, 200 ohm, 2.0k ohm, 20k ohm, 200k ohm, 2.0M ohm 2.2 ohm, 22 ohm, 220 ohm, 2.2k ohm, 22k ohm, 220k ohm, 2.2M ohm 2.4 ohm, 24 ohm, 240 ohm, 2.4k ohm, 24k ohm, 240k ohm, 2.4M ohm 2.7 ohm, 27 ohm, 270 ohm, 2.7k ohm, 27k ohm, 270k ohm, 2.7M ohm 3.0 ohm, 30 ohm, 300 ohm, 3.0K ohm, 30K ohm, 300K ohm, 3.0M ohm 3.3 ohm, 33 ohm, 330 ohm, 3.3k ohm, 33k ohm, 330k ohm, 3.3M ohm 3.6 ohm, 36 ohm, 360 ohm, 3.6k ohm, 36k ohm, 360k ohm, 3.6M ohm 3.9 ohm, 39 ohm, 390 ohm, 3.9k ohm, 39k ohm, 390k ohm, 3.9M ohm 4.3 ohm, 43 ohm, 430 ohm, 4.3k ohm, 43K ohm, 430K ohm, 4.3M ohm 4.7 ohm, 47 ohm, 470 ohm, 4.7k ohm, 47k ohm, 470k ohm, 4.7M ohm 5.1 ohm, 51 ohm, 510 ohm, 5.1k ohm, 51k ohm, 510k ohm, 5.1M ohm 5.6 ohm, 56 ohm, 560 ohm, 5.6k ohm, 56k ohm, 560k ohm, 5.6M ohm 6.2 ohm, 62 ohm, 620 ohm, 6.2k ohm, 62K ohm, 620K ohm, 6.2M ohm 6.8 ohm, 68 ohm, 680 ohm, 6.8k ohm, 68k ohm, 680k ohm, 6.8M ohm 7.5 ohm, 75 ohm, 750 ohm, 7.5k ohm, 75k ohm, 750k ohm, 7.5M ohm 8.2 ohm, 82 ohm, 820 ohm, 8.2k ohm, 82k ohm, 820k ohm, 8.2M ohm 9.1 ohm, 91 ohm, 910 ohm, 9.1k ohm, 91k ohm, 910k ohm, 9.1M ohm #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor ideal for rapid circuit topology development. You can choose between polarized and non-polarized types, its symbol and the footprint will automatically adapt based on your selection. Supported options include standard SMD sizes for ceramic capacitors (e.g., 0402, 0603, 0805), SMD sizes for aluminum electrolytic capacitors, and through-hole footprints for polarized capacitors. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF, 10pF, 100pF, 1000pF, 0.01uF, 0.1uF, 1.0uF, 10uF, 100uF, 1000uF, 10000uF 1.1pF, 11pF, 110pF, 1100pF 1.2pF, 12pF, 120pF, 1200pF 1.3pF, 13pF, 130pF, 1300pF 1.5pF, 15pF, 150pF, 1500pF, 0.015uF, 0.15uF, 1.5uF, 15uF, 150uF, 1500uF 1.6pF, 16pF, 160pF, 1600pF 1.8pF, 18pF, 180pF, 1800pF 2.0pF, 20pF, 200pF, 2000pF 2.2pF, 22pF, 220pF, 2200pF, 0.022uF, 0.22uF, 2.2uF, 22uF, 220uF, 2200uF 2.4pF, 24pF, 240pF, 2400pF 2.7pF, 27pF, 270pF, 2700pF 3.0pF, 30pF, 300pF, 3000pF 3.3pF, 33pF, 330pF, 3300pF, 0.033uF, 0.33uF, 3.3uF, 33uF, 330uF, 3300uF 3.6pF, 36pF, 360pF, 3600pF 3.9pF, 39pF, 390pF, 3900pF 4.3pF, 43pF, 430pF, 4300pF 4.7pF, 47pF, 470pF, 4700pF, 0.047uF, 0.47uF, 4.7uF, 47uF, 470uF, 4700uF 5.1pF, 51pF, 510pF, 5100pF 5.6pF, 56pF, 560pF, 5600pF 6.2pF, 62pF, 620pF, 6200pF 6.8pF, 68pF, 680pF, 6800pF, 0.068uF, 0.68uF, 6.8uF, 68uF, 680uF, 6800uF 7.5pF, 75pF, 750pF, 7500pF 8.2pF, 82pF, 820pF, 8200pF 9.1pF, 91pF, 910pF, 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor suitable for rapid circuit topology development. The footprint automatically adapts based on the selected package, supporting standard SMD sizes (e.g., 0402, 0603, 0805) as well as well-known inductor packages such as SDR1806, PA4320, SRN6028, and SRR1260. Standard inductor values: 1.0 nH, 10 nH, 100 nH, 1.0 µH, 10 µH, 100 µH, 1.0 mH 1.2 nH, 12 nH, 120 nH, 1.2 µH, 12 µH, 120 µH, 1.2 mH 1.5 nH, 15 nH, 150 nH, 1.5 µH, 15 µH, 150 µH, 1.5 mH 1.8 nH, 18 nH, 180 nH, 1.8 µH, 18 µH, 180 µH, 1.8 mH 2.2 nH, 22 nH, 220 nH, 2.2 µH, 22 µH, 220 µH, 2.2 mH 2.7 nH, 27 nH, 270 nH, 2.7 µH, 27 µH, 270 µH, 2.7 mH 3.3 nH, 33 nH, 330 nH, 3.3 µH, 33 µH, 330 µH, 3.3 mH 3.9 nH, 39 nH, 390 nH, 3.9 µH, 39 µH, 390 µH, 3.9 mH 4.7 nH, 47 nH, 470 nH, 4.7 µH, 47 µH, 470 µH, 4.7 mH 5.6 nH, 56 nH, 560 nH, 5.6 µH, 56 µH, 560 µH, 5.6 mH 6.8 nH, 68 nH, 680 nH, 6.8 µH, 68 µH, 680 µH, 6.8 mH 8.2 nH, 82 nH, 820 nH, 8.2 µH, 82 µH, 820 µH, 8.2 mH #generics #CommonPartsLibrary
  • Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • RMCF0805JT47K0
    47 kOhms ±5% 0.125W, 1/8W Chip Resistor 0805 (2012 Metric) Automotive AEC-Q200 Thick Film #forLedBlink
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink

ESP32 Dual Ultrasonic Water Level Monitoring System

ESP32 Dual Ultrasonic Water Level Monitoring System thumbnail
This project is designed to measure water level of two tanks using ultrasonic sensors interfaced with the ESP32 microcontroller. The design leverages the processing power and wireless connectivity of the ESP32 to accurately monitor water levels and support automated water management processes. Key components include two ultrasonic sensors for precise distance measurement, robust voltage regulation using an LM2596 buck converter, and reliable power management circuits. Its modular design approach facilitates easy expansion and integration with other systems, making it an ideal solution for both DIY enthusiasts and professionals in automated fluid control and IoT applications.

Pricing & Availability

Distributor

Qty 1

Arrow

$4.74–$6.32

Digi-Key

$9.03–$10.04

LCSC

$2.50–$3.16

Mouser

$8.62–$8.79

TME

$7.55

Verical

$4.42–$7.34

Controls