

Auto Water UNO
Automatic watering control algorithm for Arduino-based systems.
- Size
- 68.6 × 53.3 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 27
- Nets
- 38
- Pads
- 100
- Tracks, vias
- 122, 6
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 9 Apr 2025
- Updated
- 2 Sep 2026
Overview
Auto Water UNO is an open-source printed circuit board by prkerrigan, from the prkerrigan/AutoWater repository on GitHub. It is a 2-layer board of 68.6 × 53.3 mm with 27 parts on 38 nets, routed with 122 tracks and 6 vias.
It is built around the DHT11 and DMG1012T. Its parts include 10 connectors, 4 diodes, 4 transistors and 1 IC. It belongs with the ESP8266 boards of this library.
Main components
2DHT11
SIP-4-20℃~+60℃ 1mA 3.3V~5.5V 5%RH~95%RH ±2℃ ±5%RH SIP-4 Temperature and Humidity Sensor ROHSAosong ElecTemperature And Humidity SensorDMG1012T
SOT-523-55℃~+150℃ 1 N-channel 1V 20V 280mW 300mΩ@4.5V、400mΩ@2.5V、500mΩ@1.8V 5.37pF 60.67pF 630mA 736.6pC@4.5V 9.68pF SOT-523 MOSFETs ROHSDiodes IncorporatedMOSFETs
README
README.mdAutoWater
Automatic watering control algorithm for Arduino-based systems.
This repository contains C++ code implementing an automatic watering controller intended to run on Arduino-compatible boards. The controller reads soil moisture sensors and controls pumps/valves via MOSFETs or relays. It includes configurable thresholds, scheduling, and safety checks to avoid over-watering and to recover from sensor noise.
Features
- Read soil moisture sensors (analog or digital)
- Control up to 4 pumps/valves via MOSFETs (low-side switching)
- Hysteresis and moving-average filtering to reduce sensor noise
- Minimum-on and minimum-off timing to protect pumps
- Optional scheduling support (time-based watering windows)
- Serial logging for debugging
Hardware (Arduino UNO + 4 pumps)
This project was developed for an Arduino UNO controlling four pump motor switches (MOSFETs) from digital pins.
Typical hardware components:
- Arduino Uno
- Soil moisture sensor(s) (capacitive recommended)
- 4 x logic‑level N-channel MOSFETs or a 4‑channel MOSFET driver to switch pump power (low-side switching)
- 12V (or appropriate) DC pumps — powered from a separate supply sized for pump current
- Common ground between Arduino and pump power supply
- Optional flyback suppression (diode/RC/T VS) or snubber network across pumps
- Optional float sensor for tank low-level detection
IMPORTANT safety notes
- Do NOT drive pumps directly from Arduino pins. Use MOSFETs or relays and a separate power supply for pumps.
- Ensure the MOSFETs are logic-level (fully enhanced at 5V gate drive) and rated for the pump current and voltage.
- Provide flyback/EMI suppression for the pumps (RC snubber or TVS). Many DC motor pumps produce voltage spikes; add protection to avoid damaging the MOSFET or Arduino.
- Use fuses and proper wiring practices for mains-powered or high-current systems.
Example wiring (4 pumps):
- Soil moisture sensors: analog input pins (A0, A1, ...)
- Pump control (low-side MOSFET gate): digital pins D4, D5, D6, D7
- MOSFET source -> ground (common ground with Arduino)
- MOSFET drain -> negative pump terminal; pump positive terminal -> external power supply positive
- Optional float/level sensor: digital input (with pull-up/pull-down as required)
- Serial: USB to host for logs and configuration
Example pin mapping
- pumpPins[0] = 4
- pumpPins[1] = 5
- pumpPins[2] = 6
- pumpPins[3] = 7
- moistureSensor = A0
Building and Uploading
You can build and upload the code using the Arduino IDE or PlatformIO.
Arduino IDE:
- Open the .ino or main .cpp file in the Arduino IDE.
- Select
Arduino/Genuino Unoas the board and the correct serial port. - Click Upload.
PlatformIO (VSCode):
- Open the project in VSCode with PlatformIO installed.
- Configure
platformio.iniforboard = uno. PlatformIO: Uploadto compile and flash.
Configuration
Configure pins and algorithm parameters in the config.h or top of the main sketch:
- Sensor pins (e.g.,
A0) - Pump control pins (e.g.,
D4..D7) - Moisture thresholds (dry/wet)
- Hysteresis and smoothing window size
- Minimum pump on/off durations
- Optional schedule windows
Example parameter names and sample values you may find in the code:
MOISTURE_DRY_THRESHOLD = 600MOISTURE_WET_THRESHOLD = 400MIN_PUMP_ON_MS = 30000// 30 secondsMIN_PUMP_OFF_MS = 300000// 5 minutes
Adjust these values for your sensors and soil type.
Minimal example sketch
// Example: minimal sketch showing pin defs and a simple control loop
const int moisturePin = A0;
const int pumpPins[4] = {4, 5, 6, 7};
const int MOISTURE_DRY = 600;
const int MOISTURE_WET = 400;
const unsigned long MIN_ON_MS = 30000UL;
const unsigned long MIN_OFF_MS = 300000UL;
unsigned long pumpOnTime[4] = {0,0,0,0};
unsigned long pumpOffTime[4] = {0,0,0,0};
bool pumpState[4] = {false,false,false,false};
void setup() {
Serial.begin(9600);
for (int i = 0; i < 4; ++i) pinMode(pumpPins[i], OUTPUT), digitalWrite(pumpPins[i], LOW);
}
void loop() {
int reading = analogRead(moisturePin);
Serial.print("Moisture: "); Serial.println(reading);
unsigned long now = millis();
bool needsWater = (reading >= MOISTURE_DRY);
This is a very small example to demonstrate pin mapping and timing constraints; adapt it to your full algorithm (filtering, hysteresis, averaging, scheduling).
Algorithm Overview
Each cycle, the controller:
- Reads the soil moisture sensor (optionally averaging several samples).
- Applies hysteresis to decide whether the soil is dry or wet.
- Enforces minimum on/off times before switching pump state to protect hardware.
- Optionally respects a schedule (only water during configured windows).
- Logs events over Serial for debugging and telemetry.
Safety & Limitations
- Test with a dry run (disable pump driver) before connecting pumps to verify sensor behavior.
- Ensure pump wiring and MOSFET selection follow safety guidelines and the pump manufacturer's recommendations.
- Add fuses and current protection as appropriate for your pump.
- The code assumes reliable sensor readings; adding redundancy or float switch protection is recommended for production systems.
Contributing
Contributions and improvements are welcome. Please open issues or PRs with:
- Hardware compatibility notes
- Improvements to the control algorithm
- Additional safety checks or telemetry
License
This project is provided under the MIT License. See LICENSE (or add one) for details.
Contact
Repository owner: prkerrigan
Parts
27| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | DMG1012T | Package_TO_SOT_SMD:SOT-523 | Q1, Q2, Q3, Q4 |
| 4 | D_Schottky | Diode_SMD:D_SOD-523 | D1, D2, D3, D4 |
| 4 | Motor_DC | Connector_Phoenix_SPT:PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_Vertical | M1, M2, M3, M4 |
| 4 | MountingHole_3.2mm | Arduino_MountingHole:MountingHole_3.2mm | MH1, MH2, MH3, MH4 |
| 1 | Analog | Connector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_Vertical | J3 |
| 1 | Barrel_Jack | Connector_Phoenix_SPT:PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_Vertical | J9 |
| 1 | DHT11 | Sensor:Aosong_DHT11_5.5x12.0_P2.54mm | U1 |
| 1 | Digital/PWM | Connector_PinSocket_2.54mm:PinSocket_1x10_P2.54mm_Vertical | J2 |
| 1 | Digital/PWM | Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical | J4 |
| 1 | ESP-01 WiFi IO | Connector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_Vertical | J10 |
| 1 | Power | Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical | J1 |
| 1 | Sense 1 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J5 |
| 1 | Sense 2 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J6 |
| 1 | Sense 3 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J7 |
| 1 | Sense 4 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J8 |
Questions
How big is the Auto Water UNO PCB?
It measures 68.6 × 53.3 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Auto Water UNO use?
27 parts, built around the DHT11 and DMG1012T. 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 Auto Water UNO KiCad files?
From the prkerrigan/AutoWater repository on GitHub, at the commit this page was made from: the board is pcb-KiCAD/Auto_Water_UNO.kicad_pcb and its schematic pcb-KiCAD/Auto_Water_UNO.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Auto Water UNO design in my own project?
Its repository states no licence, so its author keeps all rights: ask prkerrigan before reusing the design.
Similar boards
- 2 layers135 × 100 mm

- 4 layers

- 4 layers94.3 × 52.8 mm

Jetbot mini
NVIDIA-AI-IOT/jetbot_mini
While developing the schematic and layout designs, I used some footprints from SnapEDA; in order to avoid dealing with licensing issues, I will not redistribute those files on this Github and instead link to where you…
188 parts23 - 2 layers95.3 × 69.9 mm

Pi compute device
marcbperez/pi-compute-device
A portable device built with the Raspberry Pi Compute module.
67 parts11Apache-2.0 - 6 layers44.5 × 36 mm

- 4 layers99.2 × 94.2 mm

- 4 layers100 × 95 mm

PCK Controller
PecaJosef/PCK-CNC
PCK-CNC is an open-source CNC router designed to offer precision, reliability, and affordability. This machine combines high-performance features with an accessible design that caters to both beginners and CNC…
278 parts3GPL-3.0 - 2 layers50 × 63 mm

Zenith Development Board
zenitheesc/Zenith-Development-Board
The Zenith Development Board was developed to serve as a first project for the new members of the group.
69 parts3MIT