Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Agriculture & Smart Farming

Weed Detection Robot: Camera and Servo Arm on Arduino

Weed Detection Robot: Camera and Servo Arm on Arduino

March 11, 2026 /Posted byJayesh Jain / 0

Weeding is one of the most labour-intensive farm tasks in India, consuming 25-40% of total crop production costs. A weed detection robot with camera and servo arm on Arduino uses computer vision to identify weeds from crop plants and mechanically removes them with a servo-driven arm, reducing herbicide use and labour costs. This project combines image processing, machine learning, and robotics – an excellent advanced project for engineering students and precision farming enthusiasts.

Table of Contents

  • Project Concept and Architecture
  • Hardware Components
  • Robot Chassis and Movement
  • Camera and Weed Detection Algorithm
  • Servo Arm Design
  • Arduino and Python Code
  • Frequently Asked Questions

Project Concept and Architecture

The weed detection robot operates as follows:

  1. Camera mounted on the robot scans the ground between crop rows
  2. Raspberry Pi runs a Python image classification model (TensorFlow Lite or OpenCV colour-based)
  3. When a weed is detected, the Pi sends coordinates to Arduino via Serial
  4. Arduino calculates servo arm positions using inverse kinematics
  5. 2-DOF servo arm extends to the weed location and cuts or pulls it
  6. Robot moves forward to the next position and repeats

This architecture separates the computational heavy lifting (Pi handles vision) from real-time mechanical control (Arduino handles servos), giving the best of both platforms.

Recommended: Raspberry Pi 5 Model 4GB RAM – Raspberry Pi 5 provides the processing power needed for real-time TensorFlow Lite weed classification at 10+ frames per second.
Recommended: Waveshare IMX219 8MP Camera for Raspberry Pi 5 (120 deg) – Wide 120-degree field of view captures a broad strip of crop row in each frame, increasing the robot forward speed.

Hardware Components

  • Raspberry Pi 5 (4GB) – vision processing
  • Arduino Mega 2560 – motor and servo control
  • Arducam IMX219 wide-angle camera (120 degree) – crop row scanning
  • 2x MG996R servo motors – 2-DOF weeding arm (shoulder + elbow)
  • 1x SG90 servo – wrist/cutting tool rotation
  • 2x N20 DC gear motors with encoders – differential drive chassis
  • L298N motor driver module – N20 motor control
  • 12V 5Ah LiPo or SLA battery – power supply
  • 2x Ultrasonic sensors (HC-SR04) – obstacle avoidance
  • 3D-printed or laser-cut chassis frame

Estimated BOM cost: Rs 8,000-15,000. The Raspberry Pi 5 is the most expensive component; a Pi 4 also works for this application.

Robot Chassis and Movement

Use a differential drive chassis with two powered rear wheels and a single front castor wheel. Track width of 200-250mm allows movement in standard crop row spacing (30cm for tomato, 45cm for brinjal). The chassis should be at most 180mm wide to fit between standard row spacing without touching plants.

Row guidance: use two IR sensors on either side of the chassis to detect the soil-mulch boundary and maintain row tracking without GPS. This simple approach works reliably for straight rows.

Camera and Weed Detection Algorithm

Two approaches for weed vs crop detection:

Approach 1: Colour-based (simpler, less accurate)

import cv2
import numpy as np

def detect_weeds_by_colour(frame):
    # Convert to HSV for better colour segmentation
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
    
    # Green range for crop plants (calibrate for your specific crop)
    crop_green = cv2.inRange(hsv, (35, 50, 50), (85, 255, 255))
    
    # Broad green-yellow range catches weeds with different hue
    weed_range = cv2.inRange(hsv, (25, 30, 30), (100, 255, 255))
    
    # Weeds = broad green MINUS crop green (different hue/intensity)
    weed_mask = cv2.subtract(weed_range, crop_green)
    weed_mask = cv2.dilate(weed_mask, None, iterations=3)
    
    # Find weed contours
    contours, _ = cv2.findContours(weed_mask, 
                                    cv2.RETR_EXTERNAL, 
                                    cv2.CHAIN_APPROX_SIMPLE)
    weeds = []
    for c in contours:
        if cv2.contourArea(c) > 500:  # Filter noise
            M = cv2.moments(c)
            if M["m00"] > 0:
                cx = int(M["m10"] / M["m00"])
                cy = int(M["m01"] / M["m00"])
                weeds.append((cx, cy))
    return weeds

Approach 2: TensorFlow Lite classifier (more accurate)
Train a MobileNetV2 model on a dataset of your specific crop and local weed species. The CWFID (Crop/Weed Field Image Dataset) is a free starting dataset for fine-tuning. Pi 5 runs TFLite at 10-15 FPS for 224×224 input resolution – sufficient for a slow-moving robot.

Servo Arm Design

A 2-DOF arm with 150mm link lengths provides a 300mm reach radius – sufficient to cover the full crop row width from the robot centreline. Mount a small rotating cutter (driven by the wrist servo) at the arm tip to sever weed stems at soil level. Alternatively, use a suction nozzle connected to a small 12V air pump to aspirate small weeds.

Arduino and Python Code

// Arduino Mega - servo arm control
#include <Servo.h>

Servo shoulder, elbow, wrist;

void setup() {
  Serial.begin(115200);
  shoulder.attach(9);
  elbow.attach(10);
  wrist.attach(11);
  // Home position
  shoulder.write(90);
  elbow.write(45);
  wrist.write(90);
}

struct ArmTarget { int sx, ex; }; // shoulder, elbow angles

// Simple 2D inverse kinematics for planar arm
ArmTarget inverseKinematics(float x, float y) {
  float L1 = 150.0, L2 = 150.0; // Link lengths in mm
  float dist = sqrt(x*x + y*y);
  // Clamp to reachable workspace
  dist = constrain(dist, 50, L1+L2-10);
  
  float cos_e = (dist*dist - L1*L1 - L2*L2) / (2*L1*L2);
  float e_angle = acos(cos_e) * 180.0 / PI;
  float s_angle = atan2(y, x) * 180.0 / PI 
                  + asin(L2*sin(e_angle*PI/180.0)/dist)*180.0/PI;
  
  return {(int)s_angle, (int)e_angle};
}

void loop() {
  if(Serial.available() >= 8) {
    // Receive target coordinates from Raspberry Pi
    float x = Serial.parseFloat();
    float y = Serial.parseFloat();
    
    ArmTarget t = inverseKinematics(x, y);
    shoulder.write(constrain(t.sx, 0, 180));
    elbow.write(constrain(t.ex, 0, 160));
    delay(500); // Allow arm to reach position
    
    // Activate cutter for 1 second
    wrist.write(0); delay(1000); wrist.write(90);
    
    // Return to home
    shoulder.write(90); elbow.write(45);
    Serial.println("DONE");
  }
}

Frequently Asked Questions

What row spacing does the robot work in?

With a 180mm chassis width, the robot fits comfortably in 30cm+ row spacing covering most Indian vegetable crops. For smaller spacing (e.g. 20cm for spinach), a narrower chassis (120-140mm) is needed. Crops like sugarcane with 75-90cm spacing allow larger, heavier robots with more powerful weeding tools.

How does the robot distinguish weeds from crop seedlings?

For colour-based approaches, the robot is programmed for a specific crop’s colour profile – anything outside that profile at the expected plant locations is treated as a weed. For ML-based approaches, a trained classifier distinguishes based on leaf shape, texture, and colour simultaneously. Both approaches require calibration for each crop and growing stage.

What is the weeding capacity per hour?

A basic servo-arm robot moving at 3-5 cm/second with 2-second arm cycle time achieves approximately 0.01-0.02 acres per hour. This is much slower than manual weeding (0.05-0.1 acres/hour) but operates continuously without fatigue. Commercial agricultural robots (Ecorobotix, Naio Oz) achieve 1-3 acres/day. The DIY version is better suited for demonstration, research, and small test plots.

Can solar power run the robot all day?

A 20W solar panel combined with a 5Ah LiPo battery provides approximately 4-6 hours of continuous operation for a small robot drawing 3-5W average (servo actuations are intermittent). For full-day 8-hour operation, a 40W panel with 10Ah battery is more appropriate.

Are there any open-source weed detection datasets for Indian crops?

The Plant Village dataset includes disease images but limited weed data. The CWFID dataset covers sugar beet and spinach rows. For Indian crops, you may need to create your own dataset – photograph 200-500 examples each of your target crop and local weed species, label them, and fine-tune a MobileNetV2 model. Transfer learning from a pre-trained ImageNet model requires only 30-60 minutes of GPU training time.

Shop Agriculture & Smart Farming at Zbotic

Tags: agricultural robot India, automated weeding, camera servo Arduino, precision farming robot, weed detection robot
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Waterproof Connector for Outdo...
blog waterproof connector for outdoor electronics ip67 options india 598318
blog sumo robot build competition rules electronics india 2026 598323
Sumo Robot Build: Competition ...

Related posts

Svg%3E
Read more

Farm Drone Pilot Training: Course and Certification India

April 1, 2026 0
Table of Contents DGCA Requirements Choosing an RPTO Curriculum and Duration Costs Career Opportunities Practical Tips Commercial agricultural drone operations... Continue reading
Svg%3E
Read more

Crop Insurance Sensor: Weather Data for Claims India

April 1, 2026 0
Table of Contents How PMFBY Works Weather Data for Claims Claim-Ready Weather Station Documenting Damage Insurance Integration Cost-Benefit PMFBY protects... Continue reading
Svg%3E
Read more

Fertigation Controller: Drip Irrigation Nutrient Mixing

April 1, 2026 0
Table of Contents What Is Fertigation EC and pH Monitoring Automated Dosing System Nutrient Schedules Sensor Integration Economics Fertigation through... Continue reading
Svg%3E
Read more

Organic Farm Certification: Monitoring Requirements

April 1, 2026 0
Table of Contents Certification Process Monitoring Requirements Sensor Documentation Soil Health Monitoring Pest Management Records Cost and Premium NPOP organic... Continue reading
Svg%3E
Read more

Agri-Tech Startups India: Technology Partners for Farmers

April 1, 2026 0
Table of Contents India’s Agri-Tech Landscape Advisory Platforms Farm Management Companies Market Linkage Startups Precision Ag Startups Choosing Partners India’s... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now
Chat with us