Sensor and power wiring
Current ESP32 master + ESP8266 slave architecture
LOW VOLTAGE / ISOLATED CONTROL
Master power distribution
Certified external 12 V DC adapter
↓ fused low-voltage feed
LM2596 buck converter · adjusted to 5 V
↓ 5 V + common GND
ESP32 VIN/5V · relay input side · JSN-SR04T
- Load-test the 5 V rail before connecting the ESP32.
- Relay, sensors, and ESP32 low-voltage interfaces share common GND.
- Do not place a bare 230 V AC/DC converter inside the controller enclosure.
ESP32 master sensors
Source JSN-SR04T
Municipal dry-contact sensor
Lower turbidity · conditioned ADC
- JSN: `VCC → 5 V`, `GND → GND`, `TRIG → configured output`.
- JSN `ECHO → 5-to-3.3 V divider/level shifter → configured input`.
- Municipal isolated contact connects configured GPIO to GND using configured pull-up/polarity.
- Turbidity output must stay within the ESP32 ADC range and use the reviewed ADC1 pin.
ESP8266 upper-tank node
Separate stable 5 V adapter
↓ 5 V + GND
ESP8266 NodeMCU + upper JSN-SR04T
Optional upper turbidity → A0
- Upper JSN: `TRIG → D1`; `ECHO → divider/level shifter → D2`.
- Confirm the exact NodeMCU board's A0 input range before connecting turbidity output.
- Slave sends sensor data to the ESP32 master over UDP `4210`.
Isolated control relays
ESP32 configured control outputs
↓ low-voltage relay inputs
START / STOP · independent OPEN / CLOSE pair for each installed valve
- START uses an isolated NO contact in parallel with the green Start button.
- STOP uses the approved isolated contact arrangement in the starter safety circuit.
- Each installed valve requires its own electrically and logically interlocked OPEN/CLOSE outputs.
Field-side power
Relay dry contacts
↓ isolated field circuit
Starter/contactor + motorized valve supply
- The PCB relay controls the starter/contactor circuit, not the pump motor directly.
- A 220 V valve needs rated contacts, fuse/protection, earthing, and segregated field wiring.
- Keep the physical Stop button and overload chain operational.
Build-time pin source
device.env.esp32_master
device.env.slave
Configured GPIO must match installed wiring
- Never choose a GPIO from this illustration alone.
- A configured pin of `-1` means optional hardware is unavailable.
- Ship real devices with every simulator state OFF.
Electrical safety: 230 V starter, contactor, valve, breaker, overload, and earthing work must be completed by a qualified electrician. Keep all mains/field wiring physically separated from ESP32, ESP8266, USB, sensor, and ADC wiring.