Esp8266 Projects

Smart Dustbin With ESP8266 And GPS

IoT Based Smart Dustbin Using NodeMCU

Introduction

In this article, we will explain how to create a Smart Dustbin using few components like a 16×2 LCD display, an ultrasonic sensor, a Sim800l module, a NEO-6m module, and the ESP8266 microcontroller. This integration of hardware and software will enable us to monitor the status of the dustbin, Find out the Level of waste management, and provide real-time data for efficient collection and disposal.

Components Needed

  1. ESP8266 Controller
  2. GSM Module
  3. 16×2 LCD Display with I2C
  4. GPS Module
  5. Ultrasonic Sensor
  6. Wire
  7. Zero PCB
  8. 5V power supply

Circuit Diagram

circuit diagram 30

LCD Display

    • SDA: Connected to the SDA pin of the ESP8266
    • SCL: Connected to the SCL pin of the ESP8266
    • VCC: Connected to the 5V power supply
    • GND: Connected to the ground (GND)

Ultrasonic Sensor

    • Trig: Connected to a digital pin (D6) of the ESP8266
    • Echo: Connected to a digital pin (D5) of the ESP8266
    • VCC: Connected to the 5V power supply
    • GND: Connected to the ground (GND)

GSM Module

    • RX: Connected to the TX pin (D4) of the ESP8266
    • TX: Connected to the RX pin (D3) of the ESP8266
    • VCC: Connected to the 5V power supply
    • GND: Connected to the ground (GND)

ESP8266

    • VCC: Connected to the 5V power supply
    • GND: Connected to the ground (GND)

Source Code

The setup() function

When the microcontroller starts. It initializes the LCD display, sets the pin modes for the ultrasonic sensor (trigPin as OUTPUT and echoPin as INPUT), initializes the GSM module’s serial communication, and displays an initialization message on the LCD.

The loop() function

Tthe main functionality of the code resides. It continuously measures the distance using the ultrasonic sensor, calculates the fill level percentage, and displays it on the LCD. If the fill level exceeds the threshold, the sendSMSAlert() function is called to send an SMS alert.

The sendSMSAlert() function

Responsible for sending an SMS alert. It sends AT commands to the GSM module via the gsmSerial object to set the necessary configurations, recipient phone number, and message content. Finally, it sends the SMS by writing 0x1A (ASCII code for Ctrl+Z) to the GSM module and displays an “Alert Sent!” message on the LCD.

Video 

Conclusion

This smart solution allows for real-time monitoring of the dustbin’s fill level, sends alerts to the appropriate authorities, and provides location data for efficient waste management. The integration of these components not only enhances waste collection practices but also contributes to building smarter and more sustainable cities. With further advancements in IoT technology, the possibilities for optimizing waste management are endless.

More Project

Prateek

Hi, Prateek Here I’m interested in Electronics That's why I Make Soo Many Projects, I’m currently Pursuing M Tech.. if you Relay Like To My Blog Plz Comment Below...Thanks To All Electronics Lover...❤️

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker