Table of Contents

Play Video

SMART DUSTBIN

The Smart Dustbin is an innovative waste management solution designed to enhance urban cleanliness and efficiency. It combines robotics and programming which enables students to learn the basics of robotics with programming and makes robotics fun and exciting for them.

Urban areas face significant challenges in waste management, often leading to overfilled dustbins and littering, adversely affecting public health and the environment. The Smart Dustbin project aims to address these issues by utilizing modern technology to create an automated, efficient waste management system. By integrating an Arduino Uno microcontroller with an ultrasonic sensor, GPS module, and GSM module, the smart dustbin detects when it is full and sends an alert with its precise location to municipal authorities (MCD), ensuring timely and effective waste collection.

Project Components

  • Arduino Uno: Act as the central microcontroller to process sensor data and manage communications.
  • Ultrasonic Sensor (HC-SR04): Measures the distance to the top of the trash inside the bin to determine if it is full.
  • GPS Module (NEO-6M): Provides the geographic coordinates of the dustbin.
  • GSM Module (SIM800L or SIM900): Sends SMS alerts containing the dustbin’s status and location to the municipal authorities.

How It Works

  1. Distance Measurement:
    • The ultrasonic sensor is mounted on the lid of the dustbin and continuously measures the distance to the waste inside the bin.
    • It sends out ultrasonic waves and measures the time it takes for the waves to bounce back from the surface of the trash, calculating the distance based on the speed of sound.
  2. Full Detection:
    • The Arduino Uno constantly monitors the distance data from the ultrasonic sensor.
    • A predefined threshold distance (e.g., 10 cm) is set to determine when the dustbin is considered full.
    • When the measured distance is less than or equal to this threshold, the Arduino recognizes that the dustbin is full.
  3. Location Acquisition:
    • Upon detecting that the dustbin is full, the Arduino requests the current location data from the GPS module.
    • The GPS module processes signals from satellites to provide accurate latitude and longitude coordinates of the dustbin.
  4. Alert Sending:
    • The Arduino formats an SMS message containing a Google Maps link with the location coordinates and a notification that the dustbin is full.
    • It sends this message via the GSM module to a predefined phone number (e.g., the municipal authority’s contact).

The circuit diagram and code are given below:

#include <SoftwareSerial.h>
#include <TinyGPS++.h>

// Pins for Ultrasonic Sensor
const int trigPin = 5;
const int echoPin = 4;

// Define the maximum distance to be considered "full" (in cm)
const int maxDistance = 10;

// Create GPS and GSM serial connections
SoftwareSerial gpsSerial(11, 10); // RX, TX
SoftwareSerial gsmSerial(3, 2); // RX, TX

TinyGPSPlus gps;

void setup() {
  // Start serial communication
  Serial.begin(9600);
  gpsSerial.begin(9600);
  gsmSerial.begin(9600);
  
  // Initialize the ultrasonic sensor pins
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  
  // Allow modules to initialize
  delay(2000);
}

void loop() {
  // Read distance from the ultrasonic sensor
  long distance = readUltrasonicDistance();
  
  // Check if the dustbin is full
  if (distance <= maxDistance) {
    Serial.println("Dustbin is full");
    
    // Get GPS location
    while (gpsSerial.available() > 0) {
      gps.encode(gpsSerial.read());
    }
    
    if (gps.location.isUpdated()) {
      float latitude = gps.location.lat();
      float longitude = gps.location.lng();
      
      // Send SMS with location
      sendSMS(latitude, longitude);
    }
  }
  
  // Short delay before the next loop
  delay(5000);
}

long readUltrasonicDistance() {
  // Send a 10us pulse to trigger the ultrasonic sensor
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  // Measure the duration of the echo pulse
  long duration = pulseIn(echoPin, HIGH);
  
  // Calculate the distance in cm
  long distance = duration * 0.034 / 2;
  return distance;
}

void sendSMS(float latitude, float longitude) {
  // Format the SMS message
  String message = "Dustbin is full. Location: http://maps.google.com/?q=";
  message += String(latitude, 6);
  message += ",";
  message += String(longitude, 6);
  
  // Send the SMS
  gsmSerial.println("AT+CMGF=1"); // Set SMS to text mode
  delay(1000);
  gsmSerial.println("AT+CMGS=\"+1234567890\""); // Replace with actual number
  delay(1000);
  gsmSerial.println(message); // Message content
  delay(1000);
  gsmSerial.write(26); // ASCII code for Ctrl+Z to send the message
  delay(5000);
  
  Serial.println("SMS sent: " + message);
}

Benefits

  • Timely Waste Collection: Ensures that full bins are emptied promptly, reducing overflow and littering in public areas.
  • Efficient Route Planning: Helps municipal authorities optimize waste collection routes based on real-time data, saving time and resources.
  • Enhanced Urban Cleanliness: Contributes to a cleaner and healthier environment by preventing waste overflow and improving waste management practices.

Application:

Urban Areas and Smart Cities
  • Municipal Waste Management: Helps city authorities optimize waste collection schedules and routes, reducing overflow and littering in public spaces.
  • Public Parks and Recreational Areas: Ensures that waste bins in parks are emptied timely, maintaining a clean and pleasant environment for visitors.
2. Commercial Complexes
  • Shopping Malls and Plazas: Keeps large commercial areas clean by ensuring waste bins are not overflowing, enhancing the shopping experience for customers.
  • Office Buildings: Improves waste management in corporate environments, contributing to a clean and hygienic workplace.
3. Residential Areas
  • Apartment Complexes: Helps in managing waste effectively in large residential buildings, ensuring timely waste collection and maintaining cleanliness.
  • Gated Communities: Assists community management in keeping the environment clean and healthy for residents.
4. Educational Institutions
  • Schools and Universities: Ensures that waste bins in educational campuses are regularly emptied, maintaining a clean and conducive environment for learning.
5. Public Transportation Hubs
  • Bus Stations and Train Stations: Helps manage waste in high-traffic areas, ensuring bins are not overflowing and maintaining cleanliness for commuters.
  • Airports: Ensures that waste bins in terminals are emptied regularly, contributing to a cleaner travel environment.
Scroll to Top