This circuit is designed to automate waste sorting using various sensors and actuators controlled by an Arduino UNO. The system detects different types of waste (wet, metal, plastic, and dry) and sorts them into appropriate bins using a stepper motor and a servo motor. The system also includes an LCD display for user feedback and a buzzer for alerts.
Arduino UNO
Soil Moisture Sensor
Stepper Motor (Bipolar)
A4988 Stepper Motor Driver (Red)
MG996R
IR Sensor
LJ18A3-H-ZBX Inductive Proximity Sensor
16x2 I2C LCD
Piezo Speaker
12V Battery (Small Size)
Electrolytic Capacitor
Resistor
Step down Buck converter
5V connected to:
GND connected to:
A0 connected to:
A4 connected to:
A5 connected to:
D3 connected to:
D4 connected to:
D6 connected to:
D8 connected to:
D11 connected to:
D2 connected to:
OUT + connected to:
OUT - GND connected to:
IN + connected to:
IN - GND connected to:
2B connected to:
2A connected to:
RESET connected to:
1A connected to:
1B connected to:
STEP connected to:
DIR connected to:
#include <Stepper.h>
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Define pins for the stepper motor and servo
#define STEP_PIN 3
#define DIR_PIN 4
#define ENABLE_PIN 5
#define SERVO_PIN 9
// Define sensor pins
#define IR_SENSOR_PIN 2
#define MOISTURE_SENSOR_PIN A0
#define INDUCTIVE_SENSOR_PIN 6
#define CAPACITIVE_SENSOR_PIN 7
#define BUZZER_PIN 8
// Set up the stepper motor
const int stepsPerRevolution = 200; // Adjust depending on your motor's specifications
Stepper stepper(stepsPerRevolution, STEP_PIN, DIR_PIN);
// Set up the servo motor
Servo ductServo;
// Set up the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); // Adjust the I2C address if needed
// Variables for sensor readings
int moistureValue = 0;
int irValue = 0;
int inductiveValue = 0;
int capacitiveValue = 0;
void setup() {
// Initialize LCD
lcd.begin(16, 2); // Specify the number of columns and rows
lcd.print("Waste Sorting");
// Initialize stepper motor
stepper.setSpeed(60); // Set the speed of the motor
// Initialize servo motor
ductServo.attach(SERVO_PIN);
// Initialize sensor pins
pinMode(IR_SENSOR_PIN, INPUT);
pinMode(MOISTURE_SENSOR_PIN, INPUT);
pinMode(INDUCTIVE_SENSOR_PIN, INPUT);
pinMode(CAPACITIVE_SENSOR_PIN, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
// Start with the duct plate closed
ductServo.write(0);
// Enable the stepper driver
digitalWrite(ENABLE_PIN, LOW);
}
void loop() {
// Read sensors
irValue = digitalRead(IR_SENSOR_PIN);
moistureValue = analogRead(MOISTURE_SENSOR_PIN);
inductiveValue = digitalRead(INDUCTIVE_SENSOR_PIN);
capacitiveValue = digitalRead(CAPACITIVE_SENSOR_PIN);
// If the IR sensor detects waste