Introduction
Separating wet and dry trash is crucial for recycling, but it’s a messy job. In this advanced Plzpapa Robotic Kit project, we build an Automatic Waste Segregator equipped with a sensitive Water Level Sensor. This smart bin can detect even small traces of liquid or moisture in the trash and automatically sorts it into the correct compartment.
How It Works:
This intelligent system uses a two-step verification process:
- Object Detection: An Ultrasonic Sensor acts as a proximity detector, waking up the system when waste is thrown in.
- Liquid Analysis: The waste lands on a Water Level Sensor plate.
- Conductivity Check: The sensor measures the conductivity of the object. Since wet items (like fruit peels or tea bags) conduct electricity better than dry items (like paper or plastic), the sensor sends a signal to the Arduino.
- Auto-Sorting: If liquid is detected, the Servo Motor directs the waste to the Wet Bin. If the object is dry, it is sorted into the Dry Bin.
Key Features:
- High Sensitivity: Detects water, juice, or moisture instantly using the Water Level Sensor.
- Hands-Free Sorting: Fully automated process powered by Arduino.
- Servo Mechanism: Precise 180-degree motor control for accurate separation.
- Eco-Friendly: Encourages proper waste disposal habits in children and adults alike.
Components Required
To build this Smart Waste Segregator (Dry & Wet Dustbin) with Plzpapa Robotic Kit, we used the following parts from the Plzpapa Basic Robotic Kit:
- Arduino Uno
- Ultrasonic Sensor
- Servo Motor
- Water Level Sensor
Wiring (Taarein Jorna)
1. Ultrasonic Sensor:
- [VCC] to 5V
- [Trig] to Pin8
- [ECHO] to Pin9
- [GND] to GND
2. Servo Motor
- Brown Wire to GND
- Red Wire to 5V
- Orange Wire to Arduino Pin 7
3. Water Level Sensor
- Water Sensor (+) : Arduino 5V
- Water Sensor (-) : Arduino GND
- Water Sensor (S) : Arduino Pin A0 (Signal Pin)
Code
#include <Servo.h>
Servo myservo;
// --- PINS ---
const int trigPin = 8;
const int echoPin = 9;
const int waterSensorPin = A0; // Water Level Sensor Pin
// --- SETTINGS ---
// Water Sensor ki reading 0 se shuru hoti hai.
// Agar kachra geela hoga to reading 100-300 se upar jaye gi.
// Hum ne '100' threshold rakha hai (Isay adjust kar saktay hain).
int wetThreshold = 100;
int Ultra_Distance = 15; // 15cm range
// Variables
long duration;
int distance = 0;
int waterValue = 0;
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
myservo.attach(7);
myservo.write(90); // Normal Position (Middle)
Serial.println("System Ready: Water Sensor Mode");
}
void loop() {
// 1. Ultrasonic Distance Check
distance = 0;
for(int i=0; i<2; i++) {
digitalWrite(trigPin, LOW);
delayMicroseconds(7);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration * 0.034 / 2) + distance;
delay(10);
}
distance = distance / 2;
// 2. Agar Kachra Aya (15cm se qareeb)
if (distance < Ultra_Distance && distance > 1) {
Serial.println("Waste Detected! Checking for Liquid...");
delay(1500); // Thora wait taake kachra sensor par sahi se gir jaye
// 3. Water Sensor Reading Check
waterValue = 0;
// Hum 3 dafa check karein ge taake ghalti na ho
for(int i=0; i<3; i++) {
waterValue = waterValue + analogRead(waterSensorPin);
delay(50);
}
waterValue = waterValue / 3; // Average reading
Serial.print("Water Level Reading: ");
Serial.println(waterValue);
// 4. Decision (Faisla)
if (waterValue > wetThreshold) {
// --- WET WASTE (Right Side) ---
Serial.println("==> LIQUID Detected (Wet Waste)");
myservo.write(10); // Right Side
delay(3000);
}
else {
// --- DRY WASTE (Left Side) ---
Serial.println("==> NO Liquid (Dry Waste)");
myservo.write(170); // Left Side
delay(3000);
}
// 5. Reset
myservo.write(90);
distance = 0;
waterValue = 0;
delay(1000);
}
}