
The aim of this project was to develop an automated waste segregation system that can identify dry, wet, and metal waste and direct it into the correct bin automatically. The system was built using an ESP32 microcontroller, sensors, and motor mechanisms.
Step 1: Planning and Component Selection
We first planned the working of the system and selected suitable components for detection and movement. The main components used were:
- ESP32 development board
- IR sensor
- Metal sensor
- Rain/moisture sensor
- 28BYJ-48 stepper motor with ULN2003 driver
- Servo motor
- 5V power supply
- Dustbin prototype structure
These components were chosen to create a simple and cost-effective automated solution.
Step 2: Hardware Setup

The physical prototype was assembled with separate compartments for dry, wet, and metal waste.
The IR sensor was placed near the waste entry point to detect object insertion. The metal and moisture sensors were used to identify the type of waste. The stepper motor was connected to rotate the dustbin platform, while the servo motor controlled the flap mechanism for dropping waste into the selected bin.
All components were properly connected to the ESP32 with common grounding and stable power supply.
Step 3: Programming
The system logic was programmed using Arduino IDE.
The code continuously reads sensor values. Once waste is detected:
- The IR sensor detects the object
- The metal sensor checks for metallic waste
- The moisture sensor identifies wet waste
- Based on the result, the stepper motor rotates to the correct bin
- The servo motor opens the flap to drop the waste
Libraries such as ESP32Servo and Stepper were used for motor control.
Step 4: Testing and Calibration
The prototype was tested using different waste materials such as metal objects, wet waste, and dry waste.
Sensor sensitivity and threshold values were adjusted for accurate detection. The motors were also tested to ensure smooth movement and correct positioning.
Step 5: Final Working
When waste is inserted into the system, it is automatically detected, classified, and directed into the appropriate bin. This reduces manual effort, improves hygiene, and makes waste segregation more efficient.