Simple Automatic Arduino Watering System (Volume Based, Arduino UNO/NANO)
by Vellvoid in Circuits > Arduino
37 Views, 1 Favorites, 0 Comments
Simple Automatic Arduino Watering System (Volume Based, Arduino UNO/NANO)
Deterministic. Calibrated. Repeatable. A timer-based system delivering exact milliliter dosing | no moisture sensors required.
Design Philosophy
Same time → same volume → predictable plant response. (Moisture sensors drift. Calibration doesn't.)
System Specs
- Pump calibration: 4.93 ml/sec
- Watering schedule: 2 doses per day
- Base volume: 140 ml/day → 70 ml per dose (Week 0)
- Weekly growth ramp: +10% per week (multiplicative)
- Control method: Timer-based (no sensor)
Arduino Code [COPY PASTA]
Volume-based dosing with weekly ramp
Circuit Simulation
Interactive wiring – open, copy and simulate directly:
PARTS
Step 1 – Parts & Cost Overview
Two build paths:
• Option A: Breadboard (beginner-friendly, no soldering)
• Option B: Soldered perfboard (clean & permanent)
Core Components (Required)
- Arduino Uno or Nano – €4–25
- Mini DC Water Pump (5–12V) – €6–12
- NPN Transistor (e.g. 2N2222) or Logic MOSFET – €0.50–2
- Flyback Diode (1N4007 or 1N5819) – €0.20
- 1kΩ Resistor – €0.10
- External Power Supply (5–12V depending on pump) – €8–15
- Silicone Tubing – €3–6
- Water Reservoir (container) – €0–10
Option A – Breadboard Build (Beginner)
- Breadboard – €4–8
- Jumper wires (male-male) – €4–6
Estimated total cost: €30–60 depending on Arduino choice
Option B – Soldered Permanent Build
- Perfboard / Prototyping PCB – €3–6
- Soldering iron (if not owned) – €20–40
- Solder wire – €5–10
- Heat shrink tubing – €5
- Small project enclosure – €6–15
Estimated total cost: €35–80 depending on tools
Optional Upgrades
- Real-Time Clock Module (RTC) – €4–8
- LCD Display – €6–12
- MOSFET instead of NPN (higher efficiency) – €2
- Inline water filter – €5
Realistic Budget Range:
Basic working system: ~€35–50
Clean permanent enclosure build: ~€50–80
Understanding the System Architecture
Before connecting any wires, it’s important to understand how the system works.
Core Logic
- Arduino → Controls timing and calculates water volume
- Transistor / MOSFET → Acts as a power switch for the pump
- Flyback Diode → Protects the circuit from voltage spikes
- Water Pump → Moves water from the reservoir to the plant
- External Power Supply → Provides sufficient current for the pump
Why Not Connect the Pump Directly to the Arduino?
The Arduino output pin can supply only about 20–40 mA.
A small DC pump often requires 200–500 mA.
Direct connection would overload the microcontroller and may permanently damage it.
Power Flow Overview
Arduino
Pin 7 (Control Signal)
→
Transistor
Electronic Switch
→
Water Pump
Load
→
External PSU
Power Source
Important: Arduino GND and Power Supply GND must be connected together. This is called a common ground.
Breadboard Wiring (Beginner Version)
Step 3 – Breadboard Wiring (Beginner Friendly)
Goal: Build the circuit on a breadboard (no soldering).
The Arduino sends a small control signal. The transistor switches the pump power safely.
Photo 1 – Breadboard + Parts Overview
Tip: The two long side rails are usually power rails (+ and –). The middle gap separates left and right rows.
What you will build
Arduino Pin 7 → (small signal) → Transistor → (switches power) → Pump → External Power Supply
Step-by-step wiring (do it in this order)
- Place the transistor on the breadboard.
- Keep it near the center gap so each leg is on its own row.
- Connect Arduino GND to the breadboard GND rail.
- (This is your “ground line”.)
- Connect the external power supply GND to the SAME GND rail.
- This common ground is mandatory.
- Wire the transistor switch path:
- Transistor Emitter → GND rail
- Transistor Collector → Pump negative (–)
- Wire pump power:
- Pump positive (+) → External power supply +
- Wire the control signal from Arduino:
- Arduino Pin 7 → 1kΩ resistor → Transistor Base
Transistor legs (Base / Collector / Emitter)
Important: Pin order depends on your transistor model. Use the datasheet or your Tinkercad diagram.
Add the protection diode (required)
Place the diode directly across the pump terminals (Anode on + of the Pump, Cathode on - of the Pump).
Stripe (band) of the diode must face the pump + / power +.
Photo 3 – Diode placement (stripe direction)
The diode protects your transistor + Arduino from the pump’s voltage spike when switching off.
Before you power it on (quick checklist)
- Common ground: Arduino GND and PSU GND (Li-ion or Powersupply) connected together
- Diode stripe points to pump +
- Pump + goes to external PSU + (not to Arduino 5V)
- No loose wires touching random rows
Typical beginner mistakes (and what happens)
- Pump runs constantly: transistor legs are mixed up (Base/Collector/Emitter wrong)
- Pump never runs: no common ground OR wrong pin 7 wiring OR pump PSU off
- Arduino resets / weird behavior: missing diode OR powering pump from Arduino
First Safe Test (Before Real Watering)
Step 4 – First Safe Test (Before Real Watering)
Before connecting your plant, we test the pump for 5 seconds only.
Use a cup or empty container for testing.
Upload This Test Code
What Should Happen
- Pump runs for 5 seconds
- Pump stops automatically
- Arduino stays powered and stable
If Something Is Wrong
- Pump runs constantly: transistor legs are wrong
- Pump never runs: missing common ground or wrong pin wiring
- Arduino resets: missing diode or weak power supply
Pump Calibration (Measure Ml Per Second)
Step 5 – Pump Calibration (Measure ml per Second)
Before using the full watering logic, we must measure how much water your pump delivers per second.
What You Need
- Measuring cup (with ml scale)
- Stopwatch (phone is fine)
- Container for water
Upload This Calibration Code
Calibration Procedure
- Place pump tube into measuring cup.
- Upload the calibration code.
- Measure how many milliliters were pumped in 10 seconds.
- Divide measured ml by 10.
Example:
You measured 49 ml in 10 seconds.
49 ml ÷ 10 sec = 4.9 ml/sec
Insert Value Into Final Code
const float ML_PER_SEC = 4.9;
Important Notes
• Always calibrate with the final hose length.
• Height difference affects flow rate.
• Repeat measurement twice for accuracy.
Activate the Full Watering System
Step 6 – Activate the Full Watering System
Now we upload the final system logic with calibrated volume dosing and automatic weekly growth scaling.
Final Watering Code
What This Code Does
- Calculates total daily water volume
- Increases volume by 10% per week
- Splits daily amount into two doses
- Runs pump only as long as needed (based on ml/sec)
Before You Let It Run Long-Term
• Ensure tubing is securely attached
• Check for leaks
• Verify pump stops after each cycle
• Make sure reservoir cannot run dry
Downloads
Troubleshooting (If Something Is Not Working)
Step 7 – Troubleshooting (If Something Is Not Working)
If your system doesn’t behave as expected, don’t panic.
Almost every issue comes from one of the points below.
Problem 1 – Pump Runs Constantly
Cause: Transistor legs are connected incorrectly.
Fix:
- Check Base, Collector, Emitter orientation
- Compare with your transistor datasheet
- Make sure resistor is between Arduino Pin 7 and Base
Problem 2 – Pump Never Turns On
Cause: Missing common ground or wiring error.
Fix:
- Arduino GND and Power Supply GND must be connected together
- Check that pump + goes to external PSU + (not Arduino 5V)
- Verify Pin 7 is correct in the code
Problem 3 – Arduino Resets or Acts Weird
Cause: Missing flyback diode or weak power supply.
Fix:
- Check diode placement (stripe must face pump +)
- Use proper external power supply
- Do NOT power pump directly from Arduino
Problem 4 – Water Amount Is Wrong
Cause: Pump not calibrated correctly.
Fix:
- Repeat Step 5 calibration
- Measure exactly 10 seconds
- Use the correct ml/sec value in the code
Quick Sanity Checklist
✔ Common ground connected
✔ Diode stripe facing pump +
✔ Resistor between Arduino and transistor
✔ Pump powered by external supply
✔ Correct ML_PER_SEC value
If it still doesn’t work: disconnect everything and rebuild it slowly.
Most problems come from one misplaced wire.