KiCad hardware design for ESP32-based soil moisture monitoring system.
This repository contains the PCB design and schematics for an irrigation moisture sensor system. The board interfaces with resistance-based moisture sensors (I recommend Irrometer Watermark Sensors) and DS18B20 temperature sensors.
The board uses an SMX moisture sensor interface board to interact with up to 6 moisture sensors. The SMX board transmits AC power to the sensors which substantially reduces mineral accumulation and extends the life of the sensors. Because moisture sensors are sensitive to temperature, the board also can take in data from DS18B20 temperature sensors through 2 available 1-Wire bus inputs.
The ESP 32 firmware combines moisture sensor and soil temperature outputs to calculate soil tension values for use in irrigation systems. The firmware can be configured with wifi credentials so the user can access the board's web server which will display sensor values. The firmware can also be configured with mqtt message server credentials allowing the board to transmit sensor data in formatted json via wifi to your main irrigation controller. I am using the SIP controller for my main irrigation system.
*Board fabrication done by PCBWay whom I can't say enough good things about: excellent website, great communication, and outstanding quality. Their KiCad plugin makes design file uploads super easy.
Firmware for this hardware is available in a separate repository: moisture-sensor-esp32
MoistureSensor1.kicad_pro: KiCad project fileMoistureSensor1.kicad_sch: Schematic designMoistureSensor1.kicad_pcb: PCB layoutMoistureSensor1BOM.csv: Bill of Materialsgerber/: Production files for PCB fabricationparts/: Custom component footprints and symbols
- ESP32 DevKit-compatible footprint
- WiFi connectivity for MQTT publishing
- 3.3V logic level
- 6x Moisture Sensor Channels: Relay-controlled power
- 2x OneWire Buses: For DS18B20 temperature sensors
- Expansion header: Output to expand the number of moisture and temperature sensors.
- Moisture Sensors: 6 channels with relay control
- Frequency Input: GPIO 21 (shared)
- OneWire Buses: GPIO 13, GPIO 14
- OneWire Relay Control: GPIO 12, GPIO 26
- Status LED: GPIO 2
- 5V input via USB or terminal
- 3.3V signal regulation for ESP32
- Relay-switched 5V outputs for moisture and temperature sensors
See MoistureSensor1BOM.csv for complete component list.
Key components:
- ESP32 DevKit module. I've used this one.
- SMX moisture sensor interface
- DS18B20 temperature sensors
- Resistance-based moisture sensors (external)
- 5V power supply
- Layers: 2-layer PCB
- Dimensions: 111x58mm
- Connectors: Wire terminals for sensors, USB C or Wire terminals for power
Gerber files for PCB fabrication are included in the gerber/ directory. These can be uploaded to PCB manufacturers like:
- PCBWay (my favorite)
- Solder ESP32 DevKit module (or use pin headers for socketing)
- Install relay modules
- Connect terminals for sensor interfaces
- Verify 3.3V and 5V power rails before powering ESP32
- Flash firmware from moisture-sensor-esp32
- KiCad: Version 7.0 or later recommended
- Open
MoistureSensor1.kicad_proto view/edit the design
This hardware design is licensed under CC BY-SA 4.0.
You are free to share and adapt this work, provided you give appropriate credit and distribute your contributions under the same license.
Ian Harris - GitHub
- Firmware: moisture-sensor-esp32

