DIY Fertilizer-Spraying Farm Robot

DIY Fertilizer-Spraying Farm Robot | Fun Arduino Robotics Project for Kids
🚜 Kid-Friendly Robotics Project

Build a Fertilizer-Spraying Farm Robot That Feeds Your Plants

A fun, beginner-friendly DIY project using Arduino, two motors, and a mini pump to build a rolling robot that drives along your plants and sprays them with fertilizer — like a tiny tractor!

UNO

Robots That Help Plants Grow 🌾

Farmers spend hours walking rows of crops to feed them fertilizer by hand. Our Farm Spray Bot automates part of that job: it rolls forward on two wheels and sprays a fine mist of liquid fertilizer through a pump-powered nozzle. It's a hands-on introduction to smart farming (agri-tech) that teaches real robotics skills — motors, pumps, circuits, and code — all while building something that could genuinely help a garden or small farm.

How Does the Robot Work?

Three simple systems work together to move, decide, and spray.

1. The Wheels — DC Motors

Two gear motors drive the robot forward along the row of plants, steered by a motor driver board.

2. The Brain — Arduino

The Arduino board runs the program that tells the motors when to drive and when to trigger the pump.

3. The Mouth — Pump & Nozzle

A mini water pump pushes liquid fertilizer from the bottle, out through a tube, and into a fine spray.

What You'll Need 🧰

Most parts are common robotics-kit pieces you can reuse in future builds.

  • 🔷
    Arduino Uno BoardThe brain of our robot
  • ⚙️
    L298N Motor Driver ModuleControls the two wheel motors
  • 🛞
    2x DC Gear Motors + WheelsDrives the robot forward
  • 🎯
    1x Caster / Support WheelKeeps the chassis balanced
  • 💧
    Mini 5V Submersible Water PumpPushes fertilizer through the tube
  • 🔌
    5V Relay ModuleSafely switches the pump on/off
  • 🍶
    Small Plastic BottleFertilizer reservoir
  • 🪈
    Silicone Tubing + Spray NozzleCarries and sprays the liquid
  • 🧱
    Chassis (Cardboard or Acrylic)The robot's body/base
  • 🔋
    Battery Pack (4xAA or 7.4V Li-ion)Powers the motors and pump
  • 🌱
    Soil Moisture Sensor (optional)Sprays only when soil is dry
  • 🔗
    Jumper Wires & Glue GunConnects and mounts everything
🛟

Safety First, Grown-Ups Needed!

  • Build with an adult, especially when using a glue gun or handling wiring near water.
  • Test the sprayer with plain water first, not real fertilizer, until everything works properly.
  • If you do add real fertilizer later, ask an adult to help choose a safe, diluted, plant-friendly formula and wear gloves.
  • Keep the pump's electrical connections away from spilled liquid at all times.

The Circuit Diagram 🔌

Here's how the motor driver and pump relay connect to the Arduino. Color-coded wires make it easy to follow!

Arduino Uno 5V GND D5 D6 D8 D9 D10 D11 L298N Motor Driver Left Motor Right Motor Relay Pump
Power (5V) Ground Motor Speed (PWM) Direction / Relay Signal Pump Power
PartPinConnects to Arduino
L298NENA (speed)D5
L298NENB (speed)D6
L298NIN1 / IN2D8 / D9
L298NIN3 / IN4D10 / D11
Relay ModuleIND7
Soil Sensor (optional)AOA0

Step-by-Step Instructions 🛠️

  1. 1

    Build the chassis

    Cut or assemble your base (cardboard or acrylic works great), and mount the two gear motors on the back with the caster wheel up front for balance.

  2. 2

    Attach the wheels

    Push the wheels onto the motor shafts and check that both spin freely without rubbing the chassis.

  3. 3

    Wire the motor driver

    Connect both motors to the L298N's output terminals, then wire ENA, ENB, IN1–IN4 to the Arduino as shown in the diagram.

  4. 4

    Set up the spray system

    Place the mini pump inside the reservoir bottle, connect its output to your tubing, and attach the nozzle at the front of the robot.

  5. 5

    Wire the relay and pump

    Connect the pump's power line through the relay module, and wire the relay's signal pin to Arduino pin D7.

  6. 6

    Connect the battery pack

    Power the L298N's motor supply and the pump circuit from your battery pack. Double-check + and - before switching on!

  7. 7

    Upload the code

    Copy the sketch below into the Arduino IDE, select "Arduino Uno" as your board, choose the right port, and click Upload.

  8. 8

    Test with water first

    Fill the reservoir with plain water and run a test drive on a table or tray to make sure the wheels move and the pump sprays correctly.

  9. 9

    Take it to the garden

    Once everything works, add diluted plant-safe fertilizer (with an adult's help) and let your robot roll along a row of plants!

The Arduino Code 💻

This sketch drives the robot forward, pauses every few seconds to spray fertilizer through the pump, then keeps rolling. Copy it into the Arduino IDE.

farm_spray_bot.ino Arduino Uno
// Farm Spray Bot — drives forward and sprays fertilizer
#define ENA 5
#define ENB 6
#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11
#define RELAY_PIN 7
#define SOIL_SENSOR_PIN A0

#define DRIVE_TIME_MS 3000   // drive for 3 seconds
#define SPRAY_TIME_MS 1500   // spray for 1.5 seconds
#define DRY_SOIL_THRESHOLD 550 // lower reading = wetter soil

void setup() {
  pinMode(ENA, OUTPUT);
  pinMode(ENB, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, LOW);
  Serial.begin(9600);
}

void loop() {
  driveForward();
  delay(DRIVE_TIME_MS);
  stopMotors();

  int soilReading = analogRead(SOIL_SENSOR_PIN);
  Serial.print("Soil reading: ");
  Serial.println(soilReading);

  if (soilReading > DRY_SOIL_THRESHOLD) {
    sprayFertilizer();
  }
}

void driveForward() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
  analogWrite(ENA, 180);  // speed 0-255
  analogWrite(ENB, 180);
}

void stopMotors() {
  analogWrite(ENA, 0);
  analogWrite(ENB, 0);
}

void sprayFertilizer() {
  Serial.println("Spraying...");
  digitalWrite(RELAY_PIN, HIGH);  // turns pump on
  delay(SPRAY_TIME_MS);
  digitalWrite(RELAY_PIN, LOW);   // turns pump off
}
🚜

Did You Know?

Real farms use giant versions of this idea called "precision agriculture" robots and drones, which use sensors and GPS to spray only the exact spots that need fertilizer — saving water and money while helping crops grow healthier!

Make It Even Smarter 🚀

Add an Obstacle Sensor

Mount an ultrasonic sensor up front so the robot stops or turns before bumping into a plant pot.

Follow a Line

Add an IR line-follower sensor so the robot automatically drives along a painted or taped row.

Control It by Phone

Swap in an ESP32 board with Wi-Fi or Bluetooth so you can drive and trigger the spray from your phone.

Farm Spray Bot FAQ

Can I use this robot with real fertilizer right away?

Test with plain water first! Once the robot works reliably, ask an adult to help pick a safe, properly diluted, plant-friendly fertilizer before switching liquids.

Do I need the soil moisture sensor?

No, it's optional. Without it, you can simply set the robot to spray at timed intervals instead of checking soil dryness.

Why do we need a relay for the pump?

The Arduino's pins can't safely supply enough current to run a motor or pump directly. The relay acts like a safe switch, letting the Arduino control a separate, stronger power source.

Can this robot work indoors for houseplants?

Yes! Just make sure there's a flat, dry path for it to roll along and keep an eye on cords and furniture in its way.

Built with 🌿 for young makers who want technology to help things grow.
Remember: always test with water first, and get an adult's help before using real fertilizer.

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course