This project involves creating a smart dustbin system that utilizes sensors, microcontrollers, a servo motor, and real-time communication technologies to monitor and manage waste levels. The system is designed to detect when the dustbin is full and send notifications to users via a Discord bot and a web interface.
-
Ultrasonic Sensors: Ultrasonic sensors are used to measure the distance of waste inside the dustbin, allowing the system to determine the fill level.
-
Microcontroller: An Arduino microcontroller is used to process sensor data and control the servo motor that opens and closes the dustbin lid.
-
Servo Motor: The servo motor is responsible for opening and closing the dustbin lid based on the fill level detected by the sensors.
-
Real-time Communication: The system uses Socket.IO to establish real-time communication between the microcontroller, web interface, and Discord bot.
-
Web Interface: Users can access a web interface to monitor the fill level of the dustbin and receive notifications when it reaches a specified threshold.
-
Discord Bot Integration: A Discord bot is integrated into the system to send notifications to a designated Discord channel when the dustbin is almost full.
- Arduino Uno
- Ultrasonic sensors (HC-SR04)
- Servo motor
- Wires and breadboard for connections
- Node.js for server-side programming
- Express.js for web server
- Socket.IO for real-time communication
- Discord.js for Discord bot integration
- Sensor Data Acquisition: Ultrasonic sensors measure the distance of waste inside the dustbin, and this data is sent to the Arduino microcontroller.
- Data Processing: The microcontroller processes the sensor data to determine the fill level of the dustbin.
- Servo Control: Based on the fill level, the microcontroller controls the servo motor to open or close the dustbin lid.
- Real-time Communication: The microcontroller sends the fill level data to the web interface and Discord bot via Socket.IO.
- User Notifications: Users receive notifications on the web interface and Discord channel when the dustbin reaches a specified fill level threshold.
- Connect the ultrasonic sensors, servo motor, and Arduino Uno according to the provided schematic.
- Install Node.js and required libraries/modules (serialport, @serialport/parser-readline, express, socket.io, discord.js).
- Upload the Arduino code to the Arduino Uno.
- Run the Node.js server script on your computer or a Raspberry Pi connected to the Arduino.
- Access the web interface to monitor the dustbin fill level and receive notifications.
- Configure the Discord bot token and channel ID in the Node.js script for Discord notifications.