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

Arduino Nano-Based Automated Waste Segregator with Load Cell, Ultrasonic Sensor, and Motor Control

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Automated Waste Segregator with Load Cell, Ultrasonic Sensor, and Motor Control

Circuit Documentation

Summary

The circuit in question appears to be designed for a waste segregation system that uses various sensors and actuators to sort and manage waste. An Arduino Nano serves as the central microcontroller, interfacing with a load cell amplifier (HX711) for weight measurement, a capacitive sensor for material detection, an ultrasonic sensor for fullness detection, a DC motor driver (L298N) to drive a motor, a buzzer for alerts, and an I2C LCD for user interface. The system is powered by 9V batteries, and a TIP120 transistor is used to control a 12V solenoid lock.

Component List

Wiring Details

Arduino Nano

SparkFun Load Cell Amplifier - HX711

Load Cell - Red/white/black/green

Capacitive Sensor

L298N DC Motor Driver

DC Motor

Ultrasonic Sensor

Buzzer Module

12V Solenoid Lock

16x2 I2C LCD

TIP120 Hi-Current Darlington Transistor

Documented Code

Arduino Nano Code

#include <HX711.h>
#include <LiquidCrystal_I2C.h>

#define DOUT  2  // HX711 Data pin
#define CLK   3  // HX711 Clock pin
#define PROXIMITY_PIN 4
#define MOTOR_A1 6
#define MOTOR_A2 7
#define BUZZER_PIN 10
#define TRIG_PIN 8
#define ECHO_PIN 9

HX711 scale;
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address of LCD is typically 0x27

float weightThreshold = 5.0;  // Threshold weight (kg)
long weight = 0;
long lastWeight = 0;

void setup() {
  Serial.begin(9600);
  scale.begin(DOUT, CLK);
  scale.set_scale(2280.f);  // Set the calibration factor for your load cell
  scale.tare();  // Tare the scale to 0

  lcd.begin();
  lcd.print("Waste Segregator");

  pinMode(PROXIMITY_PIN, INPUT);
  pinMode(MOTOR_A1, OUTPUT);
  pinMode(MOTOR_A2, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
}

void loop() {
  weight = scale.get_units(10);  // Read weight (average of 10 samples)
  float weightInKg = weight / 1000.0;  // Convert to kilograms

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Weight: ");
  lcd.print(weightInKg);
  lcd.print(" kg");

  // If weight reaches threshold
  if (weightInKg >= weightThreshold) {
    bool isMetal = digitalRead(PROXIMITY_PIN);  // Check if metal is detected
    if (isMetal) {
      // Activate electromagnet to attract metallic waste
      digitalWrite(MOTOR_A1, HIGH);
      digitalWrite(MOTOR_A2, LOW);  // Motor clockwise to tilt container
      delay(2000);  // Wait for non-metal waste to fall
      digitalWrite(MOTOR_A1, LOW);
      digitalWrite(MOTOR_A2, HIGH);  // Motor counter-clockwise to drop metallic waste
    }
  }

  // Check if the compartment is full using ultrasonic sensor
  long distance = readUltrasonicDistance();
  if (distance < 10) {  // Compartment full if distance < 10 cm
    lcd.setCursor(0, 1);
    lcd.print("Waste Full!");
    digitalWrite(BUZZER_PIN, HIGH);  //
}

Note: The readUltrasonicDistance function is not included in the provided code snippet. It should be implemented to measure the distance using the ultrasonic sensor.

12V Solenoid Lock Code

The code for the 12V Solenoid Lock is not provided, but it would typically involve setting the appropriate pin connected to the TIP120 transistor's base to HIGH to activate the lock and LOW to deactivate it. The TIP120 transistor acts as a switch to control the higher current required by the solenoid lock.