Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Waste Segregation System with Multiple Sensors and Actuators

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Waste Segregation System with Multiple Sensors and Actuators

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

YL-83 Rain Sensor - Detection Board

Rain/Snow Sensor - Board

LJC18A3-B-Z/BY Capacitive Proximity Sensor

IR Sensor

Buzzer

Stepper Motor One

Servo Motor 9G

7.4V Battery

Wiring Details

Arduino UNO

YL-83 Rain Sensor - Detection Board

Rain/Snow Sensor - Board

LJC18A3-B-Z/BY Capacitive Proximity Sensor

IR Sensor

Buzzer

Stepper Motor One

Servo Motor 9G

7.4V Battery

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.