

WaterValveX4
4-way water valve control with flow meter and I2C / GPIO pin headers
- Size
- 63.2 × 39.1 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 50
- Nets
- 33
- Pads
- 123
- Tracks, vias
- 213, 10
- Pours
- 2
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 28 Jun 2024
- Updated
- 2 Oct 2025
Overview
WaterValveX4 is an open-source printed circuit board by hansrune, from the hansrune/WaterValveX4 repository on GitHub. It is a 2-layer board of 63.2 × 39.1 mm with 50 parts on 33 nets, routed with 213 tracks and 10 vias.
It is built around the L7805 and IRLML2502. Its parts include 15 resistors, 12 diodes, 9 connectors, 4 transistors and 3 capacitors. It belongs with the audio and music boards and the ESP32 boards of this library.
Main components
2L7805
TO-220ST0℃~+125℃@(Tj) 1 1.2A 20V 2V@(1A) 42uV 500uA 5V 73dB@(120Hz) Fixed Positive Short Circuit Protection TO-220ST Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSOSENVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsIRLML2502
SOT-23-40℃~+150℃ 1 N-channel 1.25W 20V 4.2A 50mΩ@2.5V 600mV 66pF 740pF 8nC@10V SOT-23 MOSFETs ROHSGuangdong HottechMOSFETs
README
README.mdValve Controller X4
Work in progress / still a prototype...
A DYI 4x valve controller based on ESP32c3. This device is mainly intended for irrigation control, typically using 12V solenoid valves. You can also use ball valves with automatic return on power off.
This board is tested with ESPhome and ESPEasy firmware (build instructions below), and is easily used with home automation systems that support MQTT auto discovery, the native Home Assistant API, and the many controllers that ESPEasy supports
Introduction
Some of the main features and benefits
- 4x outputs
- For controlling up to four valves at a time
- Each valve should draw less than 1A - or you can add to the PCB trace thickness using wire
- Flow sensor input
- A flow sensor input is available
- Can be open collector / hall sensor. Pulled up to 3.3V level internally. 5V supply on terminal
- I2C support
- An I2C pin header with power supply is available to use with I2C sensors
- ... or you can use the same GPIO pins for any other purpose of your choise
- WiFi based
- This is almost a must have for most home automation systems
- OTA support
- Configuration backup, restore and bulk updates.
- Firmware of your choise
- ESPEasy with Domoticz over http. Device creation uses virtual sensors
- ESPEasy with Domotics and Home Assistant via MQTT. Device creation uses a MQTT configuration text file.
- ESPHome to Home Assistant via MQTT and auto discovery
- ESPHome to Domoticz via MQTT and auto discovery
- ... and as the hardware supports using both Arduino and ESP-IF development kits, almost any other firmware can be created.
- Seed Studio XIAO ESP32C3
- This device is shielded and comes with an external IPX antenna connector
- FCC and CE regulations approved
Setup and mounting
The main parts includes a simple flow sensor and a pressure reduction device:
The adapter parts are 3D prints
I use a long box with a closing / latched lid. This is designed for outdoor use. Will tolerate rain, but not frost.
Please note the bottom holes. In case water is leaked, it has a way to drain out of the box
Indicators
Each of the four valve outputs has a LED indicator at the back of the PCB
- LED D11 will indicate low level input from the flow meter
- LED D1
- no change indicates out of power, device death/freeze or other
- a duty cycle 1:1 will indicate a reset is ongoing
Implementation and design
The schematic diagram is available here. The KiCad EDA project is in the same folder
GPIO pin usage
| PIN | Capabilty | Function |
|---|---|---|
| GPIO2 | Acticve low output | LED D2 - not used |
| GPIO3 | Active high output | Valve 1 |
| GPIO4 | Active high output | Valve 2 |
| GPIO5 | Active high output | Valve 3 |
| GPIO6 | I2C | SDA |
| GPIO7 | I2C | SCL |
| GPIO8 | Active high output | Valve 4 |
| GPIO9 | Active low out | Status LED |
| GPIO10 | Pulled up input | Flow meter input |
| GPIO20 | RX / 1-wire | Serial or 1-wire sensor |
| GPIO21 | TX / 1-wire | Serial or 1-wire sensor |
Hardware - getting started
This project uses my KiCad-lib-ESP32 repository as a git submodule. To check this out, use the following:
git clone --recurse-submodules https://github.com/hansrune/WaterValveX4.git Materials used
This project uses the Seed Studio XIAO ESP32C3 RISC-V module. This tiny device has proven to be more reliable than most ESP8266 modules used in earlier versions. This module also comes with an IPX connector for connecting an external antenna, and is delivered with a simple external antenna for good range. This device is also EMI shielded and certified.
A 4x valve like the below attached with a washing machine attachment hose
A selection of 3D printable (STL and FreeCAD) adapters is available here
Any available 12V DC power supply delivering 2A or more should do for the control board and the valves.
There are many options and possible pinouts for DC-DC converters for the 12V to 5V conversion. A linear regulator (L7805) will need a heatsink, so a DC-DC converter is recommended.
The MOSFETs need a low Vgs trigger voltage, i.e. well under 3V on full load. I have used Si2302/N025P for the N-channel, SOT-23 package.
Resistors are 0805 size. Screw terminals are 3.5mm, which is a tight fit when ferrules are being used.
For more information, use this KiCad BOM
Hardware assembly
Soldering a prototype by hand is possible if you have a steady hand and a small solder iron tip. A microscope is recommended to inspect the solder joints properly.
Recommend to do the SMD parts first, then other components.
Hardware tests
You should test at least the following before adding the ESP32 module:
- Attach a battery and check that the valve can be operated both NO and NC
- Add power and check that 5V conversion is OK
- Apply 5V to GPIO 1, 5, 3 and 8 in turn to check that the output works with the indicators at the PCB back side
Firmwares
ESPHome
ESPHome firmware can be set up from this ESPHome configuration repository using the test_waterx4.yaml file as a template
Follow the README for instructions on what you will likely want to change.
By default, MQTT auto discovery is being used. This should work out of the box with Home Assistant, Domoticz and other that support Home Assistant MQTT Auto Discovery
In Home Assistant, the device has these controls. Valves are labelled a, b, c and d. The -1 is the controller instance
... and flow sensor / total counter:
ESPEasy
ESPEasy can be used with a number of different controllers / home automation systms. A custom firmware build description is available here
ESPEasy requires many settings. For configuration settings and rule files, you can upload the files from this page as a starting point. Please make sure to change name, unit number, controller IP addresses, NTP, syslog host and latitude/longitude. This configuration uses both a MQTT controller and a Domoticz controller. Change to what you need.
Bugs and tweaks
Version 2.0 of the PCB needs the flow sensor input components mounted as shown:
- A 1N4148 diode replaces R14 - cathode faces terminal connector
- A 5.1 kohm resistor replaces D7 - for a pull-up
- R12 is not mounted
Licensing
This project is licensed under the GNU General Public License v3.0 for the software, CERN-OHL-W for the hardware, and CC BY-SA for the documentation and ideas.
Parts
50| Qty | Value | Footprint | References |
|---|---|---|---|
| 8 | 1k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R6, R7, R8, R9, R10, R11, R13, R15 |
| 7 | LED | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D1, D2, D3, D5, D8, D10, D11 |
| 4 | 10k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R2, R4, R5, R12 |
| 4 | 1N4007 | Diode_THT:D_DO-41_SOD81_P3.81mm_Vertical_KathodeUp | D4, D6, D9, D12 |
| 4 | IRLML2502 | Package_TO_SOT_SMD:SOT-23_Handsoldering | Q1, Q2, Q3, Q4 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_3.2mm_M3_ISO14580_Pad | H5, H6, H7, H8 |
| 3 | 330 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R3, R16 |
| 3 | Screw_Terminal_01x03 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_PT-1,5-3-3.5-H_1x03_P3.50mm_Horizontal | J6, J7, J8 |
| 2 | 10uF | Capacitor_Tantalum_SMD:CP_EIA-3216-18_Kemet-A_Pad1.58x1.35mm_HandSolder | C1, C3 |
| 2 | Conn_01x04_Male | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J1, J5 |
| 1 | 100nF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C2 |
| 1 | 1N4148 | Diode_SMD:D_MiniMELF | D7 |
| 1 | Barrel_Jack | LOCAL1:BarrelJack1 | J2 |
| 1 | Conn_01x01_Male | Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical | J4 |
| 1 | Conn_01x03_Male | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J3 |
| 1 | L7805 | Package_TO_SOT_THT:TO-220-3_Vertical | U3 |
| 1 | Project_DCDC_01 | LOCAL1:DCDC_01 | U1 |
| 1 | Screw_Terminal_01x02 | TerminalBlock_Phoenix:TerminalBlock_Phoenix_PT-1,5-2-3.5-H_1x02_P3.50mm_Horizontal | J9 |
| 1 | SeedStudio XIAO ESP32 C3 v1 | LOCAL1:XIAO_ESP32C3_THT | U2 |
Similar boards
- 2 layers75.5 × 52.5 mm

- 4 layers60 × 28 mm

- 8 layers120 × 60 mm

DFTBoard
juliancoy/zynqPCB
An 8-layer board in Kicad built upon Xilinx Zynq Chip. Includes sound output, HDMI, DDR3, and Arduino Uno style header for screen connection
299 parts75MIT - 2 layers92.5 × 82.8 mm

Rifle and sensors
DAlexis/caustic-lasertag-system
Caustic project is a full-featured indoor and outdoor lasertag system
268 parts16 - 4 layers122.2 × 115.1 mm

Scan controller kicad
fwachsmuth/Filmkorn-Raw-Scanner
The Filmkorn Raw Scanner, turning 8mm and 16mm films into lossless 12-bit CinemaDNG
170 parts13MIT - 2 layers68 × 81.5 mm

- 2 layers42.3 × 24.5 mm

- 2 layers158 × 34 mm

Questions
How big is the WaterValveX4 PCB?
It measures 63.2 × 39.1 mm and has 2 copper layers, 1.6 mm thick.
What parts does the WaterValveX4 use?
50 parts, built around the L7805 and IRLML2502. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the WaterValveX4 KiCad files?
From the hansrune/WaterValveX4 repository on GitHub, at the commit this page was made from: the board is KiCad/WaterValveX4.kicad_pcb and its schematic KiCad/WaterValveX4.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the WaterValveX4 design in my own project?
Its repository states no licence, so its author keeps all rights: ask hansrune before reusing the design.