Building an Arduino Litter-Collecting Robot (SDG 14: Life Below Water)

An Arduino litter-collecting robot demonstrates how low-cost robotics can support environmental cleanup and pollution prevention before waste reaches vulnerable ecosystems. Plastic pollution has become one of the defining environmental challenges of the 21st century. Much of the waste that eventually enters rivers, lakes, and oceans begins as litter on streets, beaches, parks, and waterways. Preventing that waste from reaching aquatic ecosystems is one of the most practical interventions available for protecting marine life. This project demonstrates how to build an Arduino litter-collecting robot capable of navigating a small area, identifying nearby obstacles, and using a mechanical gripper to collect lightweight debris such as plastic bottles or small waste items. The system combines embedded electronics, robotics, and environmental engineering principles. While the platform presented here is a prototype, it illustrates how low-cost robotics systems could support environmental cleanup initiatives aligned with UN Sustainable Development Goal 14: Life Below Water.
Litter-collecting Arduino robot prototype designed to remove waste and protect marine environments supporting SDG 14 Life Below Water.
Arduino-based litter-collecting robot prototype designed to help remove plastic waste from the environment and support SDG 14: Life Below Water.

Table of Contents


Abstract

This project presents a prototype Arduino litter-collecting robot built around a microcontroller, ultrasonic proximity sensing, a motor-driver-based mobility system, and a servo-actuated gripper. The robot moves through a small environment, detects nearby objects, and attempts lightweight collection behavior based on a simple distance threshold.

From an engineering perspective, the platform demonstrates a basic environmental robotics system with sensing, navigation, actuation, and object-handling subsystems. From a sustainability perspective, it illustrates how low-cost embedded robotics can support pollution prevention by intercepting debris before it reaches rivers, coastlines, and marine ecosystems.


Prototype Repository

This project is published as an open prototype so that engineers, researchers, students, and advanced makers can reproduce and extend the design. All firmware, documentation, wiring notes, and example navigation data are available in the project repository.

GitHub Repository:
Arduino Litter Collecting Robot – Source Files and Documentation

The repository contains the complete prototype build materials:

  • Arduino control firmware (.ino)
  • bill of materials
  • setup guide
  • calibration notes
  • deployment notes
  • example navigation readings

Engineers can clone the repository, fork the design, or download the complete project using GitHub’s Download ZIP feature.

All materials are released under the MIT License to support reuse in research, education, and prototype engineering work.

Repository Structure

arduino-litter-collecting-robot/

README.md
LICENSE

BOM.csv

firmware/
  litter_collecting_robot.ino

docs/
  setup_guide.md
  calibration.md
  deployment_notes.md

data/
  example_navigation_readings.csv

hardware/

SDG Alignment

This project aligns most directly with SDG 14: Life Below Water, which focuses on protecting marine ecosystems and reducing ocean pollution.

Many marine pollutants originate on land. Litter that enters storm drains, rivers, and coastlines often travels long distances before reaching the ocean. Robotics systems capable of removing debris earlier in that pathway can reduce the volume of waste entering aquatic environments.

Additional connections include:

  • SDG 11: Sustainable Cities and Communities — through cleaner public environments and local resilience
  • SDG 12: Responsible Consumption and Production — through waste interception and material awareness

System Architecture

The litter-collecting robot can be understood as a compact environmental robotics system with four functional layers.

  • Sensing layer: ultrasonic proximity sensing detects nearby objects and obstacles.
  • Control layer: the Arduino reads sensor input and applies simple threshold-based navigation and collection logic.
  • Mobility layer: a motor driver controls the left and right drive motors for forward motion and stopping behavior.
  • Manipulation layer: a servo-actuated gripper attempts object capture when debris is detected within range.

The resulting perception-action loop can be summarized as:

Ultrasonic Sensor → Arduino → Navigation Logic → Motor Driver / Servo → Robot Motion and Gripper Action

This architecture demonstrates a minimal autonomous cleanup concept in which sensing informs immediate actuation. It does not perform true object classification, but it does provide a transparent foundation for future environmental robotics experiments.


Why an Arduino Litter-Collecting Robot Matters

Environmental cleanup is often treated as a purely manual activity. But robotics introduces the possibility of supplementing human cleanup efforts with systems that can navigate, detect, and act in small or constrained environments.

Even a modest prototype like this demonstrates several important ideas:

  1. pollution prevention can begin before waste reaches waterways
  2. robotics can be applied to environmental stewardship, not just industrial automation
  3. simple embedded systems can demonstrate useful cleanup logic without requiring complex AI
  4. prototype systems can help clarify what more advanced environmental robots would need in the future

The value of the build is not that it solves litter pollution at scale. Its value is that it translates an environmental challenge into an engineering system that can be tested, evaluated, and improved.


What This Project Does

This Arduino litter-collecting robot:

  • moves through a small area using a differential-drive chassis
  • detects nearby objects using an ultrasonic sensor
  • stops when an object enters a defined collection range
  • activates a servo-based gripper to attempt collection
  • provides a simple perception-action control loop for environmental robotics experimentation
  • can be extended with line tracking, vision, wireless communication, or mapping

In practical terms, the platform functions as a small environmental cleanup robot prototype suitable for education, robotics experimentation, and sustainability-oriented design work.


Bill of Materials

  • Arduino Uno or Arduino Nano
  • L298N motor driver module
  • 2 DC gear motors
  • robot chassis with wheels
  • ultrasonic distance sensor (HC-SR04)
  • servo motor for gripper
  • robotic gripper or claw
  • rechargeable battery pack (7.4V Li-ion recommended)
  • breadboard or compact wiring arrangement
  • jumper wires

Optional enhancements:

  • line tracking sensors
  • camera module
  • Bluetooth or Wi-Fi module

Engineering Specifications

Parameter Specification
Microcontroller Arduino Uno (ATmega328P) or equivalent
Drive system Two-wheel differential drive
Motor control L298N dual H-bridge motor driver
Object sensing HC-SR04 ultrasonic distance sensor
Manipulator Single-servo gripper or claw
Power source 7.4V Li-ion battery pack recommended
Collection threshold Approximately 15 cm in the reference code
Control model Threshold-based perception-action loop
Deployment scope Small-scale educational and prototype cleanup environments

Mobility System

The robot uses a differential-drive configuration in which two motors independently control the left and right wheels. This allows the robot to move forward, reverse, and rotate without requiring a steering linkage.

The L298N motor driver provides sufficient current handling for small DC motors and allows the Arduino to control motor direction and, when desired, motor speed through digital logic and PWM signals.

This configuration is common in educational robotics because it is mechanically simple, easy to wire, and flexible enough for navigation experiments.


Object Detection

The ultrasonic sensor measures the distance between the robot and nearby objects. When the robot approaches debris within a predefined threshold, the system stops and activates the gripper mechanism.

This approach is simple but effective for prototype systems. It uses proximity as a proxy for object presence, not true object classification.

More advanced systems could incorporate:

  • camera-based object recognition
  • machine learning models
  • multi-sensor navigation

In its current form, the robot does not distinguish litter from non-litter. That limitation is important, but it also keeps the system transparent and easier to build and evaluate.


Wiring Overview

Motor Driver (L298N)

  • IN1 → Arduino pin 8
  • IN2 → Arduino pin 9
  • IN3 → Arduino pin 10
  • IN4 → Arduino pin 11
  • ENA → PWM pin 5 (optional speed control)
  • ENB → PWM pin 6 (optional speed control)

Ultrasonic Sensor

  • VCC → 5V
  • GND → GND
  • Trig → pin 12
  • Echo → pin 13

Servo Gripper

  • Signal → pin 3
  • Power → 5V
  • Ground → GND

Use a stable power supply and ensure the battery pack can support simultaneous motor and servo load without excessive voltage drop.


Firmware Design Goals

The firmware in this project is designed to do more than simply move forward until an object appears. It attempts to incorporate basic robotics control ideas such as:

  • explicit distance measurement
  • motor state separation
  • servo-based collection behavior
  • clear operational branching between navigation and manipulation
  • serial output for debugging

These design choices make the build easier to test, easier to extend, and better suited for future upgrades such as obstacle avoidance, route planning, or sensor fusion.


Advanced Arduino Code

The firmware below improves on the simplest possible collector design by adding timeout handling for ultrasonic sensing, explicit startup positioning for the gripper, and clearer serial output for operational review.

#include <Servo.h>

#define trigPin 12
#define echoPin 13

#define motorLeft1 8
#define motorLeft2 9
#define motorRight1 10
#define motorRight2 11

Servo gripper;

long measureDistance() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);

  digitalWrite(trigPin, LOW);

  long duration = pulseIn(echoPin, HIGH, 30000);
  if (duration == 0) {
    return -1; // timeout
  }

  long distance = duration * 0.034 / 2;
  return distance;
}

void moveForward() {
  digitalWrite(motorLeft1, HIGH);
  digitalWrite(motorLeft2, LOW);
  digitalWrite(motorRight1, HIGH);
  digitalWrite(motorRight2, LOW);
}

void stopRobot() {
  digitalWrite(motorLeft1, LOW);
  digitalWrite(motorLeft2, LOW);
  digitalWrite(motorRight1, LOW);
  digitalWrite(motorRight2, LOW);
}

void collectObject() {
  stopRobot();

  gripper.write(30);
  delay(1500);

  gripper.write(90);
  delay(500);
}

void setup() {
  Serial.begin(9600);

  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  pinMode(motorLeft1, OUTPUT);
  pinMode(motorLeft2, OUTPUT);
  pinMode(motorRight1, OUTPUT);
  pinMode(motorRight2, OUTPUT);

  gripper.attach(3);
  gripper.write(90);

  Serial.println("Arduino Litter Collecting Robot Starting");
}

void loop() {
  long distance = measureDistance();

  Serial.print("Distance: ");
  Serial.println(distance);

  if (distance > 0 && distance < 15) {
    Serial.println("Object detected. Attempting collection.");
    collectObject();
  } else {
    moveForward();
  }

  delay(100);
}

Operational Logic

The control logic follows a simple loop:

  1. robot moves forward
  2. ultrasonic sensor scans for nearby objects
  3. if an object is detected within range, the robot stops
  4. the gripper closes to attempt collection
  5. the gripper returns to its nominal position
  6. the robot resumes navigation

This control model is intentionally transparent and easy to modify. It provides a foundation that can later be extended into more sophisticated behaviors such as obstacle avoidance, binning logic, or route planning.


Engineering Considerations

Environmental robotics projects must account for several practical factors:

  • terrain variability
  • battery life
  • debris size and weight
  • navigation accuracy
  • gripper geometry and reach
  • mechanical stability during collection attempts

Prototypes like this help test ideas before deploying more sophisticated systems. The purpose is not to claim full autonomy, but to illustrate how sensing, mobility, and manipulation subsystems can be combined into a functional cleanup concept.


Validation and Testing

To bring this project closer to engineering-grade documentation, validation should include:

  1. verify that the motors rotate in the intended directions
  2. confirm that ultrasonic distance readings remain stable across repeated measurements
  3. test the object-detection threshold against different object sizes and distances
  4. verify that the gripper opens and closes consistently
  5. observe whether the robot stops early enough to make collection physically possible
  6. measure battery performance under simultaneous motor and servo load

If the robot fails to collect objects consistently, the problem may be mechanical rather than algorithmic. Common causes include gripper geometry, target size, chassis speed, sensor placement, and surface friction.


Suggested Performance Metrics

For a more rigorous evaluation, the platform can be assessed using a few simple metrics:

  • detection reliability: whether nearby objects are consistently detected within the intended range
  • collection success rate: how often the gripper captures the target object successfully
  • navigation stability: whether the robot maintains controlled forward motion without erratic behavior
  • battery endurance: how long the system can operate under realistic load
  • false trigger rate: how often the robot attempts collection on non-target obstacles

Even informal measurement of these metrics improves the engineering credibility of the prototype.


Applications

Small litter-collecting robots could support several use cases:

  • beach cleanup initiatives
  • urban litter removal experiments
  • storm drain debris monitoring
  • educational robotics programs
  • environmental research projects

Even when deployed only as prototypes, these systems help translate sustainability goals into engineering experiments that can be tested, observed, and improved.


Future Improvements

Several upgrades could significantly enhance this prototype:

  • computer vision for litter recognition
  • autonomous path planning
  • GPS-based environmental mapping
  • solar charging systems
  • mesh networks for coordinated robot fleets

Moving from a simple proximity-based collector to a more intelligent system would require advances in sensing, classification, mobility control, and mission planning.


Reproducibility

All firmware, documentation, and supporting build materials necessary to reproduce the prototype are included in the project repository. The design intentionally relies on widely available educational robotics hardware so that it can be rebuilt in classrooms, labs, and independent engineering environments.

The platform is intended as a reference implementation rather than a field-ready cleanup robot. Engineers adapting it for extended use should validate battery runtime, drivetrain durability, outdoor conditions, gripper reliability, and navigation consistency under real operating conditions.


Conclusion

Environmental robotics represents an emerging frontier where embedded systems, automation, and sustainability intersect.

This Arduino litter-collecting robot demonstrates how relatively simple hardware can illustrate the core principles of autonomous environmental cleanup systems.

While this prototype is intentionally modest, the broader concept reflects an important idea: engineering tools can play a meaningful role in protecting ecosystems and reducing pollution before it reaches vulnerable environments such as rivers and oceans.

Leave a Comment

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

Scroll to Top