Skip to the content
PCBKitNew board
2 layers68.6 × 53.3 mmAuto Water UNO, the printed circuit board in 3D

Auto Water UNO

prkerrigan/AutoWater

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

2

README

README.md

AutoWater

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:

  1. Open the .ino or main .cpp file in the Arduino IDE.
  2. Select Arduino/Genuino Uno as the board and the correct serial port.
  3. Click Upload.

PlatformIO (VSCode):

  1. Open the project in VSCode with PlatformIO installed.
  2. Configure platformio.ini for board = uno.
  3. PlatformIO: Upload to 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 = 600
  • MOISTURE_WET_THRESHOLD = 400
  • MIN_PUMP_ON_MS = 30000 // 30 seconds
  • MIN_PUMP_OFF_MS = 300000 // 5 minutes

Adjust these values for your sensors and soil type.

Minimal example sketch

cpp
// 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:

  1. Reads the soil moisture sensor (optionally averaging several samples).
  2. Applies hysteresis to decide whether the soil is dry or wet.
  3. Enforces minimum on/off times before switching pump state to protect hardware.
  4. Optionally respects a schedule (only water during configured windows).
  5. 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
QtyValueFootprintReferences
4DMG1012TPackage_TO_SOT_SMD:SOT-523Q1, Q2, Q3, Q4
4D_SchottkyDiode_SMD:D_SOD-523D1, D2, D3, D4
4Motor_DCConnector_Phoenix_SPT:PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_VerticalM1, M2, M3, M4
4MountingHole_3.2mmArduino_MountingHole:MountingHole_3.2mmMH1, MH2, MH3, MH4
1AnalogConnector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalJ3
1Barrel_JackConnector_Phoenix_SPT:PhoenixContact_SPT_2.5_2-V-5.0-EX_1x02_P5.0mm_VerticalJ9
1DHT11Sensor:Aosong_DHT11_5.5x12.0_P2.54mmU1
1Digital/PWMConnector_PinSocket_2.54mm:PinSocket_1x10_P2.54mm_VerticalJ2
1Digital/PWMConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ4
1ESP-01 WiFi IOConnector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_VerticalJ10
1PowerConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ1
1Sense 1Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ5
1Sense 2Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1Sense 3Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ7
1Sense 4Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ8

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 mmHotPlate V1.0, the printed circuit board in 3D

    HotPlate V1.0

    aitesam961/Reflow_Hotplate

    A reflow Hotplate for DIY SMD assembly

    89 parts23GPL-3.0
  • 4 layersBldc, the printed circuit board in 3D

    Bldc

    maruta/Compact-SimpleFOC-Board

    Design file of Compact SimpleFOC Controller Board

    66 parts23MIT
  • 4 layers94.3 × 52.8 mmJetbot mini, the printed circuit board in 3D

    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 mmPi compute device, the printed circuit board in 3D

    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 mmDefcon-34-v3, the printed circuit board in 3D

    Defcon-34-v3

    bunnie/dc34-core-hw

    Core module hardware design

    187 parts10CERN-OHL-W-2.0
  • 4 layers99.2 × 94.2 mmESP32 ind EVB V3, the printed circuit board in 3D

    ESP32 ind EVB V3

    gmarocco/ESP32indEVB

    ESP32indEVB

    271 parts4
  • 4 layers100 × 95 mmPCK Controller, the printed circuit board in 3D

    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 mmZenith Development Board, the printed circuit board in 3D

    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