Arduino-Based Smart Waste Segregation System Using Metal, Plastic and Moisture Sensors with Stepper and Servo Control
Arduino Smart Waste Segregation System
Automatically classify and sort Metal, Plastic & Wet waste using sensors, a stepper motor, and a servo-controlled gate.
📋 Project Overview
This project builds an automated waste sorting bin that detects the material type of an object and physically rotates a compartment to the correct bin before dropping the item in. No manual sorting needed — the Arduino does it all.
Default fallback (no metal/wet) → Compartment 2
Rain/moisture sensor >500 → Compartment 0
⚡ How It Works — Step by Step
An item is placed into the input chamber of the device.
The Arduino reads the moisture sensor (A0) and proximity sensor (Pin 2) simultaneously.
If moisture >500 → wet. If proximity HIGH → metal. Otherwise → plastic.
The stepper motor rotates (2048 steps / 3 compartments) to align the correct bin slot.
The servo motor moves from 0° to 90°, opening the drop gate.
Servo returns to 0° (gate closes), system waits 2 seconds for the next detection cycle.
🛒 Components Required
📌 Pin Connections
| Component | Arduino Pin | Type | Notes |
|---|---|---|---|
| Rain / Moisture Sensor | A0 | Analog Input | Threshold: >500 = wet |
| Inductive Proximity Sensor | D2 | Digital Input | HIGH = metal detected |
| Servo Motor Signal | D3 (PWM) | Digital Output | 0°=closed, 90°=open |
| Stepper IN1 | D8 | Digital Output | ULN2003 driver |
| Stepper IN2 | D9 | Digital Output | ULN2003 driver |
| Stepper IN3 | D10 | Digital Output | ULN2003 driver |
| Stepper IN4 | D11 | Digital Output | ULN2003 driver |
| All GND | GND | Ground | Common ground |
| All VCC | 5V | Power | From Arduino 5V |
🔌 Circuit Diagram
🧪 Try the Simulation
💻 Arduino Code
/* * Arduino Smart Waste Segregation System * MakeMindz.com * * Sensors : Rain/Moisture (A0), Inductive Proximity (D2) * Actuators: SG90 Servo (D3), 28BYJ-48 Stepper via ULN2003 (D8-D11) * Logic : Wet→slot0 | Metal→slot1 | Plastic→slot2 */ #include <Servo.h> #include <Stepper.h> // ── Pin Definitions ── const int rainSensorPin = A0; const int proximitySensorPin = 2; const int servoPin = 3; const int stepperIn1 = 8; const int stepperIn2 = 9; const int stepperIn3 = 10; const int stepperIn4 = 11; // ── Stepper Setup ── const int stepsPerRevolution = 2048; Stepper myStepper(stepsPerRevolution, stepperIn1, stepperIn3, stepperIn2, stepperIn4); // ── Servo Setup ── Servo myServo; void setup() { Serial.begin(9600); pinMode(rainSensorPin, INPUT); pinMode(proximitySensorPin, INPUT); myServo.attach(servoPin); myServo.write(0); // Gate closed at start myStepper.setSpeed(10); // 10 RPM } void loop() { int rainValue = analogRead(rainSensorPin); int proximityValue = digitalRead(proximitySensorPin); if (rainValue > 500) { Serial.println("Wet material detected"); rotateCompartment(0); // Wet waste bin } else if (proximityValue == HIGH) { Serial.println("Metal detected"); rotateCompartment(1); // Metal bin } else { Serial.println("Plastic detected"); rotateCompartment(2); // Plastic bin } dropMaterial(); delay(2000); // Wait 2s before next cycle } void rotateCompartment(int compartment) { // 3 compartments → 120° apart = stepsPerRevolution / 3 int steps = compartment * (stepsPerRevolution / 3); myStepper.step(steps); } void dropMaterial() { myServo.write(90); // Open gate delay(1000); // Wait for item to fall myServo.write(0); // Close gate }
🛠️ Build Instructions
Build or repurpose a cylindrical container divided into 3 equal sections (120° each). Mount the stepper motor at the bottom centre to rotate the tray.
Attach the SG90 servo to the input opening so it controls a flap/gate. At 0° = closed, at 90° = open so items fall through.
Connect VCC→5V, GND→GND, and the Analog Out pin to Arduino A0. Place the sensor probes at the input chamber.
Connect VCC→5V, GND→GND, signal → D2. Position the sensor so it faces the input zone to detect metal objects.
Plug stepper's 5-wire connector into the ULN2003 board. Connect IN1→D8, IN2→D9, IN3→D10, IN4→D11. Power ULN2003 from 5V.
In Arduino IDE, both Servo.h and Stepper.h are built-in — no extra installation needed.
Open Arduino IDE, paste the code above, select Arduino UNO as the board, select the correct COM port, and click Upload.
Open Serial Monitor at 9600 baud. Place a metal object → should print "Metal detected". Try a wet sponge → "Wet material detected". Adjust the moisture threshold (500) if needed.
✨ Key Features & Applications
Features
- ✅ Multi-sensor waste classification
- ✅ Automated rotating compartment
- ✅ Servo-controlled drop gate
- ✅ Real-time serial feedback
- ✅ Modular, expandable design
- ✅ No external libraries needed
Applications
- 🗑️ Smart dustbin systems
- ♻️ Automated recycling units
- 🏙️ Smart city waste models
- 🌱 Environmental eng. projects
- 🤖 Robotics exhibitions
- 🎓 STEM / college projects
Comments
Post a Comment