Solenoid water valve 12 V (normally closed) with ESP32

Supply 12 V Bus GPIO
+-

Pins and ESP32 wiring

PinRoleESP32 pinNotes
+Not wired to the ESP32—12 V supply +. Switch it with a MOSFET or relay, never from an ESP32 pin
-Not wired to the ESP32—To the MOSFET drain. Add a flyback diode across the coil

Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.