Arduino UNO Smart Waste Sorting System Using Ultrasonic Sensor, Moisture Sensor, Servo, Stepper Motor and LCD

 

Arduino UNO Smart Waste Sorting System | Automatic Garbage Segregation Project Using Sensors

The Arduino Uno Smart Waste Sorting System is an automated garbage segregation project designed to separate wet, dry, and metal waste using sensor-based detection and motorized mechanisms.

This Arduino-based smart dustbin system integrates an HC-SR04 ultrasonic sensor, moisture sensor module, inductive metal sensor, servo motor (SG90), stepper motor with ULN2003 driver, and 16x2 LCD display to efficiently detect and sort waste materials.

It is an ideal IoT-based waste management project for students, STEM learners, robotics enthusiasts, and smart city automation systems.


Project Overview – Arduino Smart Waste Segregation System

This Arduino UNO garbage segregation project includes:

  • Arduino UNO microcontroller

  • HC-SR04 for object detection

  • Moisture (rain/soil) sensor for wet waste detection

  • Inductive proximity sensor for metal detection

  • SG90 for directing waste

  • Stepper motor with ULN2003 for bin rotation

  • 16x2 LCD display (I2C interface)

  • 9V battery power supply

  • Breadboard and jumper wires


 How the Arduino Smart Waste Sorting System Works

1️⃣ Object Detection

The HC-SR04 ultrasonic sensor detects when waste is placed near the input section.

2️⃣ Waste Type Identification

  • The moisture sensor determines whether the waste is wet or dry.

  • The inductive sensor detects metal objects.

3️⃣ Automated Sorting Mechanism

  • The servo motor controls a flap mechanism to drop waste.

  • The stepper motor rotates the bin platform to the correct category (Wet / Dry / Metal).

  • The LCD display shows system messages such as:

    • “Wet Waste”

    • “Dry Waste”

    • “Metal Detected”

    • “Put Waste”

This fully automated system improves recycling efficiency and reduces manual waste segregation efforts.


Key Features of Arduino Waste Segregation System

  • Automatic wet, dry, and metal waste detection

  • Contact-based moisture sensing

  • Inductive metal detection system

  • Motorized rotating bin mechanism

  • Real-time LCD status updates

  • Energy-efficient embedded system design

  • Ideal for smart city and eco-friendly automation projects

  • Expandable to IoT-based monitoring system


 Applications of Smart Waste Sorting System

  • Smart dustbin automation

  • IoT-based waste management systems

  • School and college science exhibition projects

  • Sustainable environmental initiatives

  • Smart city garbage management

  • Automated recycling plants


Why This Arduino Waste Management Project is Important

This Arduino Smart Waste Segregation System helps learners understand:

  • Sensor interfacing with Arduino

  • Ultrasonic distance measurement

  • Moisture and metal detection logic

  • Servo and stepper motor control

  • Embedded systems programming

  • Automation in environmental engineering

It is an excellent engineering mini project, diploma project, final year project, or robotics exhibition model focused on sustainability and automation.


Future Upgrades (IoT Integration)

This system can be upgraded with:

  • ESP8266 for WiFi connectivity

  • ESP32 for advanced IoT applications

  • Cloud data logging system

  • GSM alert notifications

  • Mobile app waste monitoring dashboard

With IoT integration, the project becomes a Smart City Waste Monitoring and Management System.


Conclusion

The Arduino UNO Smart Waste Sorting System is a practical and innovative automation project that promotes sustainable waste management. By combining sensors, motors, and embedded programming, this system demonstrates real-world applications of robotics and smart environmental technology.

It is perfect for students, makers, and environmental engineers looking to build a sensor-based automated garbage segregation system.

Code:
#include <Stepper.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

#define POWER_PIN 6  // The Arduino pin that provides the power to the rain sensor
#define DO_PIN 0     // The Arduino's pin connected to DO pin of the rain sensor
#define SERVO_PIN 13 // Pin for the servo motor

// Ultrasonic
const int trigPin = 3;
const int echoPin = 2;
long duration;
int distance;

// Inductive Sensor
const int InductiveSensor = 7;

// Stepper Motor
int stepsPerRevolution = 2048;
int rpm = 10;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);

// Servo Motor
Servo myServo;

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

// Dry Object Detection Counter
int dryCounter = 0;
const int dryThreshold = 3; // Number of consecutive detections to confirm dry

// Stepper position tracker
int currentPosition = 0;
const int dryPosition = 0;
const int wetPosition = stepsPerRevolution / 3; // 120 degrees
const int metalPosition = stepsPerRevolution * 2 / 3; // 240 degrees

void setup() {
  myStepper.setSpeed(rpm);
  myServo.attach(SERVO_PIN); // Attach the Servo to pin 13
  pinMode(InductiveSensor, INPUT);
  pinMode(trigPin, OUTPUT); // Ultrasonic trig pin
  pinMode(echoPin, INPUT);  // Ultrasonic echo pin
  pinMode(POWER_PIN, OUTPUT);  // Rain sensor power pin
  pinMode(DO_PIN, INPUT);      // Rain sensor digital output pin
  lcd.init();               // Initialize LCD
  lcd.backlight();          // Turn on LCD backlight
  Serial.begin(9600);
}

void loop() {
  getDistance();

  // Check for metal detection first
  int inductiveValue = digitalRead(InductiveSensor);
  if (inductiveValue == HIGH) { // Metal detected
    processMetal();
    return; // Exit loop after processing metal
  }

  // If no metal detected, check distance
  if (distance > 5) { // No object detected
    lcd.setCursor(0, 0);
    lcd.print("Put Waste       "); // Clear remaining characters
    dryCounter = 0; // Reset dry counter
    returnStepperToDry();
  } else if (distance <= 5) { // Ultrasonic condition met
    int rain_state = getRainState();

    Serial.print("Inductive Sensor Value: ");
    Serial.println(inductiveValue); // Debugging to monitor inductive sensor state

    if (inductiveValue == LOW && rain_state == LOW) { // Non-metal, water detected
      processWet();
    } else if (inductiveValue == LOW && rain_state == HIGH) { // Non-metal, no water
      dryCounter++;
      if (dryCounter >= dryThreshold) {
        processDry();
      }
    }
  }
}

void getDistance() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distance = duration * 0.034 / 2;

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

int getRainState() {
  digitalWrite(POWER_PIN, HIGH);  // turn the rain sensor's power ON
  delay(10);                      // wait 10 milliseconds

  int rain_state = digitalRead(DO_PIN);

  digitalWrite(POWER_PIN, LOW);  // turn the rain sensor's power OFF

  if (rain_state == HIGH)
    Serial.println("Dry");
  else
    Serial.println("Wet");

  return rain_state;
}

void processMetal() {
  Serial.println("Metal Detected");
  lcd.setCursor(0, 0);
  lcd.print("Metal Detected "); // Clear remaining characters

  moveStepperTo(metalPosition); // Move to metal container
  delay(1000);

  myServo.write(180); // Servo to 180 degrees
  delay(500);

  myServo.write(0); // Servo back to 0 degrees
  delay(500);

  returnStepperToDry();
  Serial.println("Metal processing complete");
}

void processWet() {
  Serial.println("Wet Object Detected");
  lcd.setCursor(0, 0);
  lcd.print("Wet Object     "); // Clear remaining characters

  moveStepperTo(wetPosition); // Move to wet container
  delay(1000);

  myServo.write(180); // Servo to 180 degrees
  delay(500);

  myServo.write(0); // Servo back to 0 degrees
  delay(500);

  returnStepperToDry();
}

void processDry() {
  Serial.println("Dry Object Detected");
  lcd.setCursor(0, 0);
  lcd.print("Dry Object     "); // Clear remaining characters

  moveStepperTo(dryPosition); // Ensure stepper is at dry container
  delay(1000);

  myServo.write(180); // Servo to 180 degrees
  delay(500);

  myServo.write(0); // Servo back to 0 degrees
  delay(500);
}

void moveStepperTo(int targetPosition) {
  int stepsToMove = targetPosition - currentPosition;
  myStepper.step(stepsToMove);
  currentPosition = targetPosition;
}

void returnStepperToDry() {
  if (currentPosition != dryPosition) {
    moveStepperTo(dryPosition);
    Serial.println("Stepper returned to dry position");
  }
}


 

IOT & SMART SYSTEM PROJECTS

  1. IoT Weather Monitoring System (NodeMCU ESP8266 + DHT11 + Rain Sensor)
  2. ESP8266 NodeMCU Smart Health & Environment Monitoring System with Pulse, Temperature and Motion Sensors
  3. ESP32 Wi-Fi Weight Sensor with HX711
  4. Smart RFID Access Control System Using ESP32 Dev Board and UHF RFID Reader Module
  5. Smart IoT Motor Control System Using ESP32 Dev Board and L298N Motor Driver Module
  6. Smart Waste Management System Using Arduino Nano, Ultrasonic Sensor & GSM Module – Solar Powered IoT Solution
  7. Raspberry Pi Zero W and GSM SIM900 Based Ultrasonic Distance Measurement System
  8. Arduino UNO Smart Surveillance System with ESP8266 WiFi, PIR Motion Sensor & Camera Module
  9. Arduino UNO Environmental Monitoring System with OLED & 16x2 I2C LCD Display
  10. Arduino UNO-Based Smart Home Automation System with Flame and IR Sensors 
  11. Arduino Nano-Based Landslide Detection System with GSM Alerts – Smart Disaster Monitoring Project
  12. Arduino Nano Rain-Sensing Stepper Motor System
  13. Arduino Based Automatic Tire Inflator Using Pressure Sensor, Relay Module and LCD Display
  14. Arduino-Based Automatic Cooker Using Servo Motors, DC Stirrer Motor, Temperature Sensor and Relay-Controlled Heater
  15. Arduino Sketch for Plastic Bottle and Can Reverse Vending Machine

 TRAFFIC & SMART CITY PROJECTS
  1. RFID-Based Smart Traffic Control System (Arduino Mega)
  2. Arduino UNO Traffic Light Control System – Smart LED Signal Project
  3.  Arduino UNO Controlled Traffic Light System with Joystick Interface

ROBOTICS PROJECTS
  1. Arduino UNO Smart Obstacle Avoiding Robot (Ultrasonic + IR + GSM)
  2. Arduino-Powered Autonomous Obstacle Avoidance Robot with Servo Control
  3. Arduino Nano Bluetooth Controlled Line Follower Robot Using L298N Motor Driver
  4. Arduino UNO Bluetooth Controlled 4WD Robot Car Using L298N Motor Driver
  5. Arduino UNO Multi-Sensor Obstacle Avoidance & Bluetooth Controlled Robot Car Using L298N
  6. Raspberry Pi Motor Control Robot (L298N + Li-ion)
  7. RC Car Simulation with L298N Motor Driver and Joystick Control using Arduino (CirkitDesign Simulation)
  8. Raspberry Pi Robotic Arm Control System with Camera Module and Motor Driver – Smart Automation & Vision-Based Robotics Project
  9. ESP32-Based 4WD Robot Car Using Dual L298N Motor Drivers – Circuit Diagram and IoT Control Project

LORA & WIRELESS COMMUNICATION PROJECTS
  1. Arduino LoRa Communication Project Using Adafruit RFM95W LoRa RadioArduino Nano with RFM95 SX1276 LoRa
  2. Arduino Nano with RFM95 LoRa SX1276 Module – Long Range Wireless Communication Project
  3. Arduino Nano Digital Clock Using DS3231 RTC and TM1637 4-Digit Display – Circuit Diagram and Project Guide

 LED, LIGHTING & DISPLAY PROJECTS
  1. Arduino UNO Controlled NeoPixel Ring Light Show
  2. Wi-Fi Controlled NeoPixel Ring (ESP8266)
  3. Chained NeoPixel Rings with Arduino – Addressable RGB LED Control Project
  4. Arduino Nano-Controlled Lighting System with Gesture and Sound Interaction
  5. Raspberry Pi GPIO Multi-LED Control System – Beginner-Friendly Embedded Electronics Project
  6. 4 Channel Relay Module with Arduino UNO

 SENSOR & DETECTION PROJECTS
  1. Arduino UNO Color Sensor + Proximity System (TCS3200 + Inductive)
  2. Arduino Color Detection Project Using Adafruit TCS34725 RGB Color Sensor
  3. Arduino Gas Leakage Detection and Safety Alert System Using MQ-2 Gas Sensor
  4. MQ-135 Air Quality Detector Using Arduino | Cirkit Designer Simulation Project
  5. Pulse Sensor Using Arduino – Complete Guide with Simulation 
  6. HX711 Load Sensor Demo Using Arduino | Digital Weight Measurement Project
  7. Track Time with DS1307 RTC and Display on Arduino Uno with 16x2 LCD | Cirkit Designer Project
  8. Parking Sensor Simulator using Arduino Uno and HC-SR04 Ultrasonic Sensor

 FUN & INTERACTIVE PROJECTS
  1. Pong Game with Arduino UNO and OLED Display – Project Explanation
  2.   Arduino UNO Bluetooth-Controlled Servo Motor System
  3. Arduino UNO-Based Interactive Touch and Distance Sensing System with LED Indicators and Servo Control

 INDUSTRIAL / AUTOMATION PROJECTS

  1. Arduino UNO Smart Waste Sorting System Using Ultrasonic Sensor, Moisture Sensor, Servo, Stepper Motor and LCD
  2. Arduino-Based Smart Waste Segregation System Using Metal, Plastic and Moisture Sensors with Stepper and Servo Control
  3. ESP32-Based Digital Weighing Scale Using 50kg Load Cell, HX711 Module and 16x2 LCD Display
  4. Arduino-Based Smart Toll Gate Automation System with RFID, GSM, Ultrasonic Sensor and LCD Display

  5. Arduino-Based Automatic Pill Dispenser Machine with LCD Display, Servo Motor and Buzzer Reminder

  6. Arduino UNO Smart Water Quality Monitoring System with pH Sensor, Turbidity Sensor and LCD Display

  7. Arduino-Based Ocean Cleaning Boat Robot with Dual IBT-2 Motor Drivers and Conveyor Belt System

  8. IoT-Based Accident Detection and Health Monitoring System Using Raspberry Pi with GSM, GPS and Camera Integration

  9. Raspberry Pi RFID and Keypad Based Smart Door Lock System with LCD Display and L298N Motor Driver

  10. Smart Shopping Trolley Using Arduino UNO & RFID | Automatic Billing System

  11. Arduino UNO Based Automatic Liquid Hand Sanitizer & Soap Dispenser System

  12. Arduino Based Robotic Weeding Machine with Ultrasonic Obstacle Detection and L298N Motor Driver

  13. Arduino UNO Based Biometric Electronic Voting System with LCD Display and Fingerprint Authentication

  14. Arduino UNO Based Electronic Voting System with ILI9341 TFT Display

Comments