Arduino UNO-Based Waste Segregation System with Multiple Sensors and Actuators
View and Edit Project In Cirkit Designer
Waste Segregation System Circuit Documentation
Summary
The Waste Segregation System is designed to automatically sort waste into three categories: wet, dry, and metal. The system utilizes an Arduino UNO as the central processing unit, interfacing with various sensors to detect the type of waste. A servo motor and a stepper motor are employed to facilitate the physical segregation of waste. The circuit is powered by a 7.4V power source, and the Arduino UNO regulates the 5V supply for the low-power components.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
YL-83 Rain Sensor - Detection Board
- A sensor board used to detect rainwater.
Rain/Snow Sensor - Board
- A sensor board that can detect rain or snow using analog and digital outputs.
LJC18A3-B-Z/BY Capacitive Proximity Sensor
- A capacitive type proximity sensor that can detect metallic and non-metallic objects.
IR Sensor
- An infrared sensor used for object detection.
Buzzer
- An electronic buzzer for audible alerts.
Stepper Motor One
- A stepper motor used for precise control of angular or linear position, velocity, and acceleration.
Servo Motor 9G
- A small and lightweight servo motor for precise control of motion.
7.4V Battery
- A power source for the stepper motor.
Wiring Details
Arduino UNO
- 5V: Powers the IR sensor and Rain/Snow Sensor Board.
- GND: Common ground for IR sensor, Rain/Snow Sensor Board, Buzzer, and Servo Motor 9G.
- A0: Connected to the analog output of the Rain/Snow Sensor Board.
- D2: Connected to the digital output of the IR sensor.
- D3: Connected to the signal pin of the LJC18A3-B-Z/BY Capacitive Proximity Sensor.
- D4: Connected to the positive pin of the Buzzer.
- D7: Connected to the PWM pin of the Servo Motor 9G.
- D8, D9, D10, D11: Connected to the input pins IN1, IN2, IN3, IN4 of the Stepper Motor One respectively.
YL-83 Rain Sensor - Detection Board
- POS: Connected to pin 2 of the Rain/Snow Sensor Board.
- NEG: Connected to pin 1 of the Rain/Snow Sensor Board.
Rain/Snow Sensor - Board
- A0 (Analog): Connected to A0 on the Arduino UNO.
- D0 (Digital): Not used in this circuit.
- GND: Connected to GND on the Arduino UNO.
- VCC (5V): Connected to 5V on the Arduino UNO.
LJC18A3-B-Z/BY Capacitive Proximity Sensor
- SIG (BLK): Connected to D3 on the Arduino UNO.
IR Sensor
- out: Connected to D2 on the Arduino UNO.
- gnd: Connected to GND on the Arduino UNO.
- vcc: Connected to 5V on the Arduino UNO.
Buzzer
- POSITIVE: Connected to D4 on the Arduino UNO.
- NEGATIVE: Connected to GND on the Arduino UNO.
Stepper Motor One
- IN1, IN2, IN3, IN4: Connected to D8, D9, D10, D11 on the Arduino UNO respectively.
- +: Connected to + on the 7.4V battery.
- -: Connected to - on the 7.4V battery.
Servo Motor 9G
- VCC 5V: Not directly connected in this circuit.
- PMW: Connected to D7 on the Arduino UNO.
- GND: Connected to GND on the Arduino UNO.
7.4V Battery
- +: Powers the Stepper Motor One.
- -: Common ground for the Stepper Motor One.
Documented Code
/*
* Waste Segregation System
* This Arduino sketch segregates waste into wet, dry, and metal categories
* using a servo motor, stepper motor, and various sensors.
*/
#include <Servo.h>
#include "CheapStepper.h"
// Pin definitions
const int moistureSensorPin = A0;
const int irSensorPin = 2;
const int proximitySensorPin = 3;
const int buzzerPin = 4;
const int servoPin = 7; // Corrected from 9 to 7 based on wiring details
const int stepperIn1 = 8;
const int stepperIn2 = 9;
const int stepperIn3 = 10;
const int stepperIn4 = 11;
// Servo and stepper motor objects
Servo myServo;
CheapStepper myStepper(stepperIn1, stepperIn2, stepperIn3, stepperIn4);
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize sensors
pinMode(moistureSensorPin, INPUT);
pinMode(irSensorPin, INPUT);
pinMode(proximitySensorPin, INPUT);
pinMode(buzzerPin, OUTPUT);
// Attach servo motor
myServo.attach(servoPin);
// Set initial positions
myServo.write(90); // Neutral position
myStepper.setRpm(15); // Set stepper motor speed
}
void loop() {
// Read sensor values
int moistureValue = analogRead(moistureSensorPin);
int irValue = digitalRead(irSensorPin);
int proximityValue = digitalRead(proximitySensorPin);
// Check for wet waste
if (moistureValue > 500) {
Serial.println("Wet waste detected");
myServo.write(0); // Move servo to wet waste position
delay(1000);
myServo.write(90); // Return to neutral position
}
// Check for metal waste
else if (proximityValue == HIGH) {
Serial.println("Metal waste detected");
myStepper.move(true, 100); // Move stepper motor to metal waste position
delay(1000);
myStepper.move(false, 100); // Return to neutral position
}
// Check for dry waste
else if (irValue == HIGH) {
Serial.println("Dry waste detected");
myServo.write(180); // Move servo to dry waste position
delay(1000);
myServo.write(90); // Return to neutral position
}
// No waste detected
else {
Serial.println("No waste detected");
digitalWrite(buzzerPin, LOW); // Turn off buzzer
}
delay(500); // Wait before next iteration
}
Note: The servoPin was corrected from 9 to 7 in the code to match the wiring details provided.