DIY Agriculture Rover Robot for Kids

DIY Agriculture Rover Robot for Kids | Sowing, Weeding, Spraying & Fertilizer – Arduino Project
🌾 Robo Farm Labs — Episode 10

Build a 4-in-1 DIY
Agriculture Rover Robot!

One robot that sows seeds 🌱, pulls weeds 🌿, sprays water 💧, and spreads fertilizer 🟣 — all by itself! Perfect for young engineers and future farmers.

🤖 Arduino Mega ⏱️ 3–4 Hours 🎓 Ages 11+ 💰 ~₹3,000 / $40 🌱 STEM + Agriculture
MODE: SOWING

Have you ever visited a farm and seen farmers toiling under the hot sun — planting seeds, pulling out weeds, and spraying crops row by row? Imagine if a little robot could do ALL of that for them! That's exactly what agricultural robots are doing in smart farms around the world today.

In this project, you'll build your very own 4-in-1 Agriculture Rover using an Arduino Mega. One robot, four superpowers: sowing seeds, pulling weeds, spraying water or pesticide, and spreading fertilizer. You switch between modes with a push of a button — and the rover gets to work!

🌾 Mission Briefing

How Does the Agriculture Rover Work?

Think of our rover like a tiny robotic farmer with four different "hats" it can wear. You press a button to choose the mode, and the rover rolls through the field doing that job. Here's what each mode does:

🌱
SOWING Mode

A servo motor opens a tiny seed hopper. As the rover drives forward, seeds drop into the soil one by one — like a tiny slot machine for plants!

🌿
WEEDING Mode

A rotating servo-powered claw digs a little into the soil, dislodging weed roots so they can be swept away. No more hand-pulling!

💧
SPRAYING Mode

A mini water pump fills a tube to a nozzle at the front. Mist goes on! The soil moisture sensor can even detect dry patches and trigger spraying automatically.

🟣
FERTILIZER Mode

A separate hopper servo opens to release granular fertilizer as the rover moves — spreading nutrients evenly across the crop rows.

🧠
The Brain of It AllAn Arduino Mega 2560 is in charge. It listens to a 4-way button switch to pick the mode, drives the 4 wheels using two L298N motor drivers, controls all 3 servos, fires the mini pump, and reads the soil moisture sensor to make smart decisions.
🛒 Shopping List

🧰Parts You'll Need

🧠
Arduino Mega 2560
More pins than Uno — perfect for 4 modules
⚙️
L298N Motor Driver × 2
Controls 4 DC wheels (2 motors per driver)
🔄
DC Gear Motors × 4 + Wheels
4WD chassis kit recommended
🦾
SG90 Servo Motor × 3
Seed hopper, weed claw, fertilizer gate
💧
Mini DC Water Pump + Tubing
3V–5V submersible pump type
🌡️
Soil Moisture Sensor
Triggers spray in auto mode
🖥️
16×2 LCD (I2C module)
Shows current mode on screen
🔘
Push Buttons × 4
One per mode: sow, weed, spray, fertilize
🔴
LEDs × 4 (different colors)
Mode indicator lights
🔊
Piezo Buzzer
Mode-change beep
🔋
7.4V LiPo / 2× 18650 Battery
Drives motors + Arduino
🍞
Breadboard + Jumper Wires
For prototyping connections
🪛
4WD Acrylic Chassis Kit
Two-deck platform with standoffs
🫙
Small Containers × 2
For seed hopper and fertilizer tank
💡
Money-Saving TipLook for a "Smart Agriculture Robot Kit" or "4WD Arduino Robot Chassis Bundle" online. These bundles include the chassis, motors, wheels, L298N driver, and sometimes servos all in one box — usually cheaper than buying each part separately.
🔌 Wiring Map

🔌Circuit Diagram

This map shows how all the modules connect to the Arduino Mega. Follow the wire colours when building — it makes debugging so much easier!

ARDUINO MEGA 2560 Digital: 2–13, 22–53 Analog: A0–A15 PWM: 2,3,4,5,6,7,8,9,10,11 I2C: SDA(20) SCL(21) L298N #1 Motors: FL + BL IN1–4, ENA, ENB VCC→ Battery L298N #2 Motors: FR + BR IN1–4, ENA, ENB VCC→ Battery SERVO × 3 Signal: D4,D5,D6 VCC 5V / GND MINI PUMP Via Relay: D7 SOIL SENSOR A0 / VCC / GND 16×2 LCD (I2C) SDA→D20 SCL→D21 MODE BUTTONS D22 D23 D24 D25 7.4V BATTERY VIN → Arduino + L298Ns Red=Power · Black=GND · Orange=Data/Signal · Green=PWM · Blue=I2C · Purple=Analog
VCC / Power GND Data / Signal PWM Motor Control I2C (SDA/SCL) Analog Sensor Servo Signal
🛠️ Pin-by-Pin

🔗Complete Wiring Guide

Use this table to connect every wire. Match the colors to the legend above — always double-check before powering on!

🔵 L298N Motor Driver #1 (Front-Left + Back-Left wheels)

L298N #1 PinArduino Mega PinWire Color
ENAD2 (PWM)YELLOW
IN1D22BLUE
IN2D23GREEN
ENBD3 (PWM)YELLOW
IN3D24BLUE
IN4D25GREEN
12VBattery +RED
GNDGNDBLACK

🔵 L298N Motor Driver #2 (Front-Right + Back-Right wheels)

L298N #2 PinArduino Mega PinWire Color
ENAD4 (PWM)YELLOW
IN1D26BLUE
IN2D27GREEN
ENBD5 (PWM)YELLOW
IN3D28BLUE
IN4D29GREEN
12VBattery +RED
GNDGNDBLACK

🦾 Servos, Pump, Sensor & Display

ModulePin / SignalArduino Mega PinWire
Servo 1 – Seed HopperSignalD6ORANGE
Servo 2 – Weed ClawSignalD7ORANGE
Servo 3 – Fertilizer GateSignalD8ORANGE
All ServosVCC5VRED
All ServosGNDGNDBLACK
Mini Water Pump (via relay)Relay IND9BLUE
Soil Moisture SensorAnalog OUTA0PURPLE
LCD I2C – SDASDAD20 (SDA)YELLOW
LCD I2C – SCLSCLD21 (SCL)WHITE
Mode Button – SowDigitalD30GREEN
Mode Button – WeedDigitalD31ORANGE
Mode Button – SprayDigitalD32BLUE
Mode Button – FertilizeDigitalD33PURPLE
BuzzerSignalD10ORANGE
LED – Sow (Green)Anode (+ 220Ω)D34GREEN
LED – Weed (Red)Anode (+ 220Ω)D35RED
LED – Spray (Blue)Anode (+ 220Ω)D36BLUE
LED – Fert (Purple)Anode (+ 220Ω)D37PURPLE
⚠️
Safety First!The water pump draws more current than Arduino can supply directly — always use a relay module between the pump and D9. Never connect the pump straight to an Arduino pin or it may break.
🔧 Build Time

🔧Step-by-Step Build Instructions

1

Assemble the 4WD Chassis

Bolt the four DC gear motors into the chassis brackets. The two motors on the left side will be called "Left" and the two on the right "Right." Attach all four wheels and check they spin freely. Mount standoffs between the two acrylic decks — the bottom deck holds motors and battery, the top deck holds the Arduino and sensors.

2

Mount the Motor Drivers

Screw both L298N boards to the top deck on opposite sides. Connect the Left motor pair's red and black wires to L298N #1 OUTPUT terminals, and the Right motor pair to L298N #2 outputs. Plug the 12V battery+ into both L298N's VIN terminals (you can share one GND rail on the breadboard).

💡
Twist each motor wire pair together before connecting — it reduces electrical noise and makes wiring look neat!
3

Build the Seed Hopper

Take a small plastic cup or bottle cap and cut a tiny hole at the bottom (the "seed gate"). Glue Servo 1 to the side wall of the cup so its arm covers and uncovers the hole. When you send servo to 0°, the gate closes; at 90°, it opens and seeds drop. Hot-glue the hopper to the front-right corner of the top deck.

4

Attach the Weed Claw

Servo 2 goes on the underside of the front bumper rail (or a small bracket that extends forward). Glue 3–4 bent wire prongs to the servo arm — these are the "weed fingers." When the servo sweeps from 0° to 90° repeatedly, the claw scrapes across the top layer of soil, dislodging weeds.

5

Set Up the Spray System

Place the mini pump in a small water reservoir (a sealed plastic box or lunchbox works). Run the output tube along the chassis to a tiny plastic nozzle at the front of the rover. Secure the tube with cable clips or zip ties. Connect the pump to the relay module's NO and COM terminals — the relay is wired to Arduino pin D9.

6

Build the Fertilizer Hopper

Similar to the seed hopper — use another small container with a gate controlled by Servo 3 (pin D8). Mount it on the back-left corner of the top deck so fertilizer drops near the rear wheels and gets pressed into the soil as the rover moves forward.

7

Mount the Arduino Mega + Accessories

Velcro or screw the Arduino Mega to the centre of the top deck. Place the breadboard beside it. Mount the LCD on the front edge so you can read the mode display easily. Push the four mode buttons through small holes in the top deck (or mount on a separate control panel board). Stick the LEDs in a row next to the buttons.

8

Insert the Soil Moisture Sensor

The soil sensor has two metal prongs — these poke into the ground while the rover moves. Mount it at the very front-bottom of the chassis using a small bracket so the prongs face downward. Route its three wires (VCC, GND, A0) up to the breadboard on the top deck.

9

Wire Everything Using the Pin Table

Follow the wiring table in the section above wire by wire. Use the color-coded system to keep things organised. Once all wires are connected, do one final check before connecting the battery — make sure no bare wires are touching each other.

⚠️
Before first power-on: ask an adult to review your wiring. A wrong connection can damage the Arduino or motor driver.
💻 Coding Time

💻The Arduino Code

Install these libraries first via Sketch → Include Library → Manage Libraries: Servo (built-in), LiquidCrystal_I2C.

agri_rover.ino Arduino C++
// ====================================================
//  🌾 DIY Agriculture Rover — Arduino Mega 2560
//  Modes: SOWING · WEEDING · SPRAYING · FERTILIZING
//  Robo Farm Labs — Kid-Friendly Commented Version
// ====================================================

#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// ----- LCD -----
LiquidCrystal_I2C lcd(0x27, 16, 2);

// ----- Servos -----
Servo servoSeed;       // Controls seed hopper gate
Servo servoWeed;       // Controls weed-digging claw
Servo servoFert;       // Controls fertilizer gate

// ----- Motor Driver Pins (L298N #1 — Left wheels) -----
const int ENA = 2, IN1 = 22, IN2 = 23;
const int ENB = 3, IN3 = 24, IN4 = 25;

// ----- Motor Driver Pins (L298N #2 — Right wheels) -----
const int ENC = 4, IN5 = 26, IN6 = 27;
const int END = 5, IN7 = 28, IN8 = 29;

// ----- Module Pins -----
const int PUMP_RELAY  = 9;   // Relay for water pump
const int SOIL_PIN    = A0;  // Soil moisture analog input
const int BUZZER      = 10;

// ----- Mode Buttons -----
const int BTN_SOW   = 30;
const int BTN_WEED  = 31;
const int BTN_SPRAY = 32;
const int BTN_FERT  = 33;

// ----- Mode LEDs -----
const int LED_SOW   = 34;
const int LED_WEED  = 35;
const int LED_SPRAY = 36;
const int LED_FERT  = 37;

// ----- State -----
int currentMode = 0;
// 0=IDLE  1=SOW  2=WEED  3=SPRAY  4=FERT

int DRIVE_SPEED  = 150;  // 0–255 (PWM speed)
int SOIL_DRY_VAL = 600; // Analog threshold: dry soil

unsigned long seedTimer = 0;
bool seedOpen = false;

// ===================== SETUP =====================
void setup() {
  // Motor pins
  int motorPins[] = {IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8};
  for(int i=0; i<8; i++) pinMode(motorPins[i], OUTPUT);
  pinMode(ENA, OUTPUT); pinMode(ENB, OUTPUT);
  pinMode(ENC, OUTPUT); pinMode(END, OUTPUT);

  // Module pins
  pinMode(PUMP_RELAY, OUTPUT);
  digitalWrite(PUMP_RELAY, LOW); // pump OFF at start
  pinMode(BUZZER, OUTPUT);

  // Button pins (INPUT_PULLUP = no external resistor needed)
  pinMode(BTN_SOW,   INPUT_PULLUP);
  pinMode(BTN_WEED,  INPUT_PULLUP);
  pinMode(BTN_SPRAY, INPUT_PULLUP);
  pinMode(BTN_FERT,  INPUT_PULLUP);

  // LED pins
  pinMode(LED_SOW,   OUTPUT);
  pinMode(LED_WEED,  OUTPUT);
  pinMode(LED_SPRAY, OUTPUT);
  pinMode(LED_FERT,  OUTPUT);

  // Servos
  servoSeed.attach(6);
  servoWeed.attach(7);
  servoFert.attach(8);
  servoSeed.write(0);   // close seed gate
  servoWeed.write(0);   // claw retracted
  servoFert.write(0);   // close fert gate

  // LCD
  lcd.init();
  lcd.backlight();
  showLCD("  AGRI ROVER  ", " Press a button!");

  // Start-up beep
  tone(BUZZER, 880, 100);
  delay(150);
  tone(BUZZER, 1100, 150);
  delay(300);
}

// ===================== LOOP =====================
void loop() {
  checkButtons();   // Did the user press a mode button?

  switch (currentMode) {
    case 1: modeSow();       break;
    case 2: modeWeed();      break;
    case 3: modeSpray();     break;
    case 4: modeFertilize(); break;
    default: stopAll();      break;
  }
}

// ============= BUTTON READING =============
void checkButtons() {
  if (digitalRead(BTN_SOW)   == LOW) { setMode(1); delay(300); }
  if (digitalRead(BTN_WEED)  == LOW) { setMode(2); delay(300); }
  if (digitalRead(BTN_SPRAY) == LOW) { setMode(3); delay(300); }
  if (digitalRead(BTN_FERT)  == LOW) { setMode(4); delay(300); }
}

void setMode(int m) {
  stopAll();
  currentMode = m;
  updateLEDs(m);
  tone(BUZZER, 1200, 120);
  String names[] = {"","SOWING","WEEDING","SPRAYING","FERTILIZE"};
  showLCD("MODE SELECTED:", names[m]);
  delay(800);
}

// ============= MODE 1: SOWING =============
void modeSow() {
  driveForward(120); // drive slowly while sowing
  showLCD("MODE: SOWING", "Seeds dropping!");

  // Open seed gate every 800ms (1 seed drop per step)
  if (millis() - seedTimer > 800) {
    seedTimer = millis();
    seedOpen = !seedOpen;
    servoSeed.write(seedOpen ? 90 : 0);
  }
}

// ============= MODE 2: WEEDING =============
void modeWeed() {
  driveForward(100);
  showLCD("MODE: WEEDING", "Claws out!");

  // Sweep weed claw back and forth
  servoWeed.write(0);  delay(300);
  servoWeed.write(80); delay(300);
}

// ============= MODE 3: SPRAYING =============
void modeSpray() {
  int soilVal = analogRead(SOIL_PIN);
  driveForward(130);

  if (soilVal > SOIL_DRY_VAL) {
    // Soil is DRY — turn pump on!
    digitalWrite(PUMP_RELAY, HIGH);
    showLCD("SPRAY: DRY SOIL", "Pump ON!  💧");
  } else {
    // Soil is wet enough — skip this patch
    digitalWrite(PUMP_RELAY, LOW);
    showLCD("SPRAY: SOIL OK", "Pump OFF  ✓");
  }
}

// ============= MODE 4: FERTILIZING =============
void modeFertilize() {
  driveForward(110);
  showLCD("MODE: FERTILIZE", "Nutrients out!");
  // Open fertilizer gate continuously while in this mode
  servoFert.write(70);
}

// ============= MOTOR HELPERS =============
void driveForward(int speed) {
  // Left motors forward
  analogWrite(ENA, speed); analogWrite(ENB, speed);
  digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
  // Right motors forward
  analogWrite(ENC, speed); analogWrite(END, speed);
  digitalWrite(IN5, HIGH); digitalWrite(IN6, LOW);
  digitalWrite(IN7, HIGH); digitalWrite(IN8, LOW);
}

void stopAll() {
  // Stop motors
  digitalWrite(IN1,LOW); digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW); digitalWrite(IN4,LOW);
  digitalWrite(IN5,LOW); digitalWrite(IN6,LOW);
  digitalWrite(IN7,LOW); digitalWrite(IN8,LOW);
  // Close all attachments
  servoSeed.write(0);
  servoWeed.write(0);
  servoFert.write(0);
  digitalWrite(PUMP_RELAY, LOW);
}

// ============= DISPLAY HELPERS =============
void showLCD(String line1, String line2) {
  lcd.clear();
  lcd.setCursor(0, 0); lcd.print(line1);
  lcd.setCursor(0, 1); lcd.print(line2);
}

void updateLEDs(int m) {
  digitalWrite(LED_SOW,   m == 1);
  digitalWrite(LED_WEED,  m == 2);
  digitalWrite(LED_SPRAY, m == 3);
  digitalWrite(LED_FERT,  m == 4);
}
🧠
How the Code ThinksThe loop() function does two things every millisecond: checks if you pressed a button (to switch mode), then runs the matching mode function. The moisture sensor reading in SPRAY mode is the coolest part — it's like giving the rover a nose to smell dry soil!
✅ Launch Checklist

Testing Your Rover

A

Motor Direction Test

Before attaching the modules, call driveForward(150) directly in setup and check all four wheels spin in the SAME forward direction. If one spins backwards, swap that motor's two wires on the L298N OUTPUT terminal.

B

Servo Range Test

Upload a small test sketch that sweeps each servo from 0° to 90°. Confirm the seed gate opens/closes and the weed claw digs and retracts properly. Adjust the angle values in the code if needed.

C

Moisture Sensor Calibration

Open Serial Monitor (Serial.begin(9600) + Serial.println(analogRead(A0))). Put the sensor prongs in dry soil and note the number. Put in wet soil — note that number. Set SOIL_DRY_VAL in the code to a value between those two readings.

D

Full Field Run!

Fill the seed hopper with small seeds (mung beans, coriander, sesame work great!). Press the SOW button and set the rover on a prepared soil patch. Watch it plant! Repeat with each mode. Congratulations — you just ran an automated farm!

🚀 Level Up!

🚀Cool Upgrades to Try Next

📡

Add GPS Navigation

Mount a NEO-6M GPS module and program the rover to follow a set of GPS waypoints across a real field automatically.

📱

Bluetooth Remote Control

Add an HC-05 Bluetooth module and control the rover from a free Arduino Bluetooth app on your phone.

☁️

Wi-Fi + Data Dashboard

Swap to an ESP32 and log soil moisture readings to a Google Sheet or a Blynk dashboard in real-time.

👁️

Camera + Plant Disease AI

Mount an ESP32-CAM and train a TensorFlow Lite model to spot diseased leaves — the rover could flag them for treatment!

☀️

Solar Charging Panel

Strap a small 5V solar panel to the top deck to charge a power bank that keeps the rover running all day on sunlight!

🔭

Ultrasonic Obstacle Avoidance

Add an HC-SR04 ultrasonic sensor to the front so the rover automatically stops and turns when it hits the field boundary or an obstacle.

❓ Curious Minds

Frequently Asked Questions

What does an agriculture rover robot do?
An agriculture rover is a wheeled robot that moves through a farm or garden doing tasks like planting seeds, removing weeds, spraying water or pesticide, and spreading fertilizer — all without a human doing the backbreaking work! Our rover does all four in one machine.
Why do we use Arduino Mega and not Arduino Uno?
The Arduino Uno only has 14 digital pins. With 4 motor control pins per L298N (×2 drivers), 3 servos, 1 pump relay, 4 mode buttons, 4 LEDs, 1 buzzer, I2C LCD, and a soil sensor — we need WAY more pins! The Mega gives us 54 digital pins, plenty for everyone.
Can a kid build this project?
Yes! With an adult's help for soldering and wiring, kids aged 11 and up can assemble this rover step by step. The code is fully commented so you understand each line as you go. Start with the motor test before adding all the modules.
How much does it cost to build this rover?
Roughly ₹2,500–₹4,000 (about $30–$50 USD). Buying a "4WD Arduino Robot Kit" bundle online saves money since it includes the chassis, motors, wheels, and often one L298N driver in a single box.
Why is a relay needed for the water pump?
The Arduino's digital pins can only supply about 40mA of current — that's enough for an LED but not a motor or pump. A relay is an electrically-controlled switch: the Arduino tells it to open or close, and it switches a separate, higher-current circuit that powers the pump safely.
Can I add GPS or Wi-Fi to the rover?
Absolutely! Once the basics are working, you can add a NEO-6M GPS module for automatic field navigation, or an HC-05 Bluetooth chip for remote control from your phone, or replace the Arduino Mega with an ESP32 for full Wi-Fi control and data logging.

🌾 You're a Future Agri-Tech Engineer!

Real companies like John Deere, Mahindra, and dozens of startups build robots just like this one — only bigger and more expensive! You've just understood the exact same principles they use.

Keep experimenting. Add a GPS. Add a camera. Grow actual plants with your rover. The farm of the future is yours to build!

⚠️ Always work on electronics projects with adult supervision. Double-check wiring before powering on. Keep water and electronics separate until everything is secured.

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