Title – BinAlert
Name – Enes Sissenbi, Kwan
Instructor’s name – Viola He
Title – BinAlert
Name – Enes Sissenbi, Kwan
Instructor’s name – Viola He
The BinAlert project was inspired by my observations of a persistent issue with overflowing garbage cans in my neighbourhood. There would frequently be a mess in the streets as a result of these containers being overfilled and the trash being blown around. In order to help garbage collection businesses determine when to empty the containers and design the most effective trash collection routes, I was motivated to construct a device that would help track the container's status.
The prior project made it clear to me that a garbage can may be an interactive element that reacts to its environment in addition to being a useful object. I put this concept into practice in the BinAlert project by giving the garbage can an emotional reaction depending on how full it is. Its "face" exhibits sadness when the bin is full and annoyance when it is overflowing. My knowledge of interaction as something that may go beyond basic functioning to encompass an emotional bond between an object and its users has grown as a result of this project.
Even among possibly comparable systems, BinAlert stands out for its emotional engagement. Although I haven't done any particular research on current products, I think a lot of them only consider functional metrics without offering an emotional connection. BinAlert is unique in that it engages and makes sense to use by interacting with the user emotionally in addition to tracking the degree of fullness.
The project's target audience consists of city administrations and waste collection firms. In order to minimise the amount of litter in the streets and optimise waste collection routes, BinAlert offers a technology that enables real-time monitoring of container fullness. These organisations especially benefit from this since it improves their operational effectiveness and helps to keep the city clean.
At first, it was intended that the interface with BinAlert would be rather simple. Without any additional interaction, we envisioned users just walking up to the trash can, finishing their task, and leaving. But after only one day of testing, it was evident that this strategy was inadequate. We came to the conclusion that the trash can needs to connect with users in a more dynamic and engaging way. Because of this, we decided to reconsider and modify the interaction by adding emotional reactions to the garbage can.
We made the decision to include a function that would allow the trash can to show various emotions based on how full it is. The original plan was to use a servo mechanism to show a collection of emojis through a tiny hole or cutout on the trash can's surface. These emojis could alter to represent different emotions, including happiness, sadness, or rage, depending on how the garbage can is feeling. However, we discovered that restricting the interaction to a tiny cut-out wasn't sufficient after getting feedback from preliminary tests. In order to make it more visually appealing and understandable, we chose to go one step further and turn the entire garbage can into a single, enormous emotive face.
We purposefully chose to store all of the sensors and servo motors inside the garbage can while choosing the physical components. This made it possible for us to keep the garbage can's outside neat and uncomplicated while including cutting-edge functionality. In order to improve its visual appeal, we intended it to resemble a regular garbage can with a face and no obvious electronics or equipment.
Before making a final decision, we looked at a number of different choices regarding the materials. At first, we experimented with thick, rigid cardboard, which appeared sturdy but was challenging to cut and assemble. We even thought about adding wood to strengthen the framework, but we opted against it because of the short timeline and our inexperience with woodworking. We chose to use thinner, layered cardboard instead since it was more easily cut and shaped while still having sufficient structural integrity. We verified that this option was the most sensible for our needs after a week of trial. In addition to being lightweight, the multilayer cardboard made it easier for us to make changes during the prototyping stage.
Getting users to receive email warnings when the trash can was full was the main problem of the BinAlert project. We had to choose the right microcontroller in order to accomplish this. We first thought of utilising an Arduino Uno, but we needed something more compact and potent. Initially, we considered enabling Wi-Fi connectivity by using an ESP32 chip and an Arduino Micro separately. But I discovered a better alternative—the Fire Beetle 2, which featured an integrated ESP32 chip—after looking on Taobao. This option was perfect for our project because it was small and practical.
The programming stage presented a unique set of difficulties. I had a number of challenges because this was my first time programming ESP chips. Connecting the microcontroller to Wi-Fi was my first chore. I tried using the Arduino IDE and C++ to do this, but I kept running into problems. I also tried writing C# code and utilising the ESP-IDF framework, which seemed to have some potential for creating a Wi-Fi connection. Later on, though, I understood that it would be advantageous if the microcontroller could establish a connection with the WPA2 Enterprise network at our school. I spent a lot of time attempting to make this work, alternating between the Arduino IDE and ESP-IDF, experimenting with various libraries, and resolving numerous issues along the way.
I discovered a crucial problem after days of battling to program the microcontroller: the board was repeatedly resetting because of improper pin arrangement. My error during soldering was connecting the pins in the wrong orientation, which confused the ESP32 and kept resetting it. Everything started to function properly after I fixed this error and redistributed the appropriate pins in the code. Since C++ was more comfortable to me, I ultimately chose to continue programming with the Arduino IDE.
In terms of my contributions, my team members took care of the garbage can's interior parts and physical assembly, while I concentrated mostly on programming. We worked effectively together, and our roles were well-defined. An essential component of our procedure was the user testing session. Despite a number of shortcomings in the first prototype, the input we got was quite helpful. We got ideas like turning the entire trash can into a face and adding a transparent panel so users can see how full it is to improve personalisation. We considered these recommendations and made the required changes, which led to a final product that is more polished and easy to use.
Now that the microcontroller was Wi-Fi connected (but WPA2 Enterprise was not supported), I started working on the server-side features. In order to manage JSON requests and forward email notifications according to the container's status, I configured a VPS server and built a basic Python script. This server-side element was essential to the project since it made it possible to efficiently send out real-time updates on how full the garbage can was.
Developing an interactive garbage monitoring system that could not only track a trash can's level of fullness but also convey this information in an emotionally and visually appealing way was the main objective of the BinAlert project. By adding emotional and interactive components, the project sought to reinvent how people engage with everyday items, turning a garbage can into something more relatable and clever. After considering our objectives, we were able to create a system that tracks fullness, notifies pertinent parties in real time, and graphically represents the trash can's "emotional state" according to its current condition.
The outcomes fit our original notion of interaction quite nicely. BinAlert did more than just alert garbage collection services about how full the trash can was; it engaged users by displaying a range of facial expressions. In order to raise awareness of waste management, we aimed to establish an emotional bond between the garbage can and its environment by depicting it as joyful, depressed, or agitated. Although the emotional interaction component lived up to our expectations, we were unable to deploy more sophisticated network capabilities like WPA2 Enterprise because of the difficulties we encountered setting up a dependable Wi-Fi connection. As a result, the system's connection and ability to adjust to intricate network contexts could be enhanced.
User input during testing helped us improve our strategy and identified fresh areas for improvement. For example, we improved the design to make the entire garbage can resemble a face instead of just a little cutout, based on the idea that the trash can should look different. The user experience and interaction clarity were greatly enhanced by this modification. Furthermore, a crucial component of providing users with real-time feedback was addressed by the suggestion to include a transparent panel to show how full the trash can is. These modifications improved the project and expanded our knowledge of user-centred design.
We would continue investigate methods of integrating the system with cutting-edge network protocols and improve the physical architecture to make it more robust and modular if we had more time. Furthermore, adding adaptive responses based on user behaviour and broadening the trash can's emotional repertoire might make the interaction much more complex. We learnt the value of resilience, adaptation, and teamwork from our experience integrating user input, debugging hardware, and navigating programming hurdles.
All things considered, the BinAlert project served as an example of how creative thinking and sympathetic design may elevate an apparently straightforward device. We developed a solution that not only maximises operational efficiency but also cultivates a more dynamic and captivating environment by tackling a real-world waste management issue. The knowledge gained from this project's successes and failures has deepened our comprehension of interaction design and its capacity to forge significant bonds between people and things.
When the bin is full it sends an email that notifices about its status.
CODE for the FireBeetle 2 ESP32
/**
* BinAlert Project Code
* This code connects an ESP32-based microcontroller to Wi-Fi, monitors trash can fullness using ultrasonic sensors,
* controls servos to display various emotional states based on fullness, and sends notifications to a server.
* This code was partially adapted from Wi-Fi connection tutorials available at:
* https://www.arduino.cc/en/Reference/WiFi
* and servo control examples from the ESP32Servo library documentation.
*/
#include <WiFi.h>
#include <HTTPClient.h>
#include <ESP32Servo.h> // Include the library for ESP32 servos
// Wi-Fi settings
const char* ssid = "OPPO Find X7 Ultra";
const char* password = "e6g6nn76";
// Server address
const char* serverName = "http://194.32.141.194:5000/api";
// Pins for the ultrasonic sensor and LED
#define TRIG_PIN 12
#define ECHO_PIN 4
#define LED_PIN 0
#define SERVO_EMOJI_PIN 25 // Pin for the emoji servo (face)
#define SERVO_BROW_LEFT_PIN 26 // Pin for the left eyebrow servo
#define SERVO_BROW_RIGHT_PIN 14 // Pin for the right eyebrow servo
#define SERVO_LOCK_PIN 13 // Pin for the lock servo
// Threshold distance value
const int thresholdDistance = 15;
// Variables for state
Servo servoEmoji;
Servo servoBrowLeft;
Servo servoBrowRight;
Servo servoLock;
bool isFull = false;
bool awaitingMotion = false;
// Connecting to Wi-Fi
void setupWiFi() {
Serial.print("Connecting to Wi-Fi");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("\nConnected to Wi-Fi!");
}
// Function to measure distance
long measureDistance() {
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
long duration = pulseIn(ECHO_PIN, HIGH);
long distance = duration * 0.0343 / 2;
Serial.print("Measured distance: ");
Serial.print(distance);
Serial.println(" cm");
return distance;
}
// Function to send data to the server
void sendDataToServer(bool isFull) {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(serverName);
http.addHeader("Content-Type", "application/json");
String postData = isFull ? "{\"status\": \"full\"}" : "{\"status\": \"not_full\"}";
int httpResponseCode = http.POST(postData);
if (httpResponseCode > 0) {
String response = http.getString();
Serial.println("Data sent successfully");
Serial.println(response);
} else {
Serial.print("Error sending data: ");
Serial.println(httpResponseCode);
}
http.end();
} else {
Serial.println("Wi-Fi Disconnected");
}
}
// Function to control the emoji servo (face)
void updateEmojiServo(int angle) {
servoEmoji.write(angle);
delay(500); // Delay for the servo to move
}
// Function to control the eyebrow servos
void updateBrowServos(int angleLeft, int angleRight) {
servoBrowLeft.write(angleLeft); // Control the left eyebrow
servoBrowRight.write(angleRight); // Control the right eyebrow
delay(500); // Delay for the eyebrow movement
}
// Function to lock the trash can
void lockTrashCan(bool lock) {
if (lock) {
servoLock.write(45); // Turn to 45 degrees to lock
Serial.println("Trash can locked.");
} else {
servoLock.write(0); // Return to 0 degrees to unlock
Serial.println("Trash can unlocked.");
}
}
// Setup function
void setup() {
Serial.begin(115200);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
// Attach the servos
servoEmoji.attach(SERVO_EMOJI_PIN);
servoBrowLeft.attach(SERVO_BROW_LEFT_PIN);
servoBrowRight.attach(SERVO_BROW_RIGHT_PIN);
servoLock.attach(SERVO_LOCK_PIN);
setupWiFi();
}
// Main loop function
void loop() {
long distance = measureDistance();
if (distance < thresholdDistance) {
if (!isFull) {
// Trash can is full, turn on LED, show a sad face, and lower eyebrows
Serial.println("Trash can is full. LED on, emoji is sad, and brows are down.");
digitalWrite(LED_PIN, HIGH);
updateEmojiServo(180); // Sad face
updateBrowServos(130, 40); // Lower eyebrows (both servos at 45 degrees)
sendDataToServer(true);
lockTrashCan(true); // Lock the trash can
isFull = true;
awaitingMotion = true;
} else if (awaitingMotion) {
// Waiting for movement after the trash can is full
Serial.println("Additional motion detected in a full trash can.");
updateEmojiServo(240); // Face of irritation
awaitingMotion = false;
}
} else {
if (isFull) {
// Trash can is not full, reset state to a smile and raise eyebrows
Serial.println("Trash can is not full. LED off, emoji is happy, and brows are neutral.");
digitalWrite(LED_PIN, LOW);
updateEmojiServo(0); // Smile
updateBrowServos(0, 0); // Eyebrows in neutral position (both at 0 degrees)
sendDataToServer(false);
lockTrashCan(false); // Unlock the trash can
isFull = false;
}
}
delay(5000); // Delay 5 seconds before the next measurement
}
CODE FOR SERVER
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from flask import Flask, request, jsonify
app = Flask(__name__)
# Конфигурация для отправки email
SMTP_SERVER = 'smtp.gmail.com'
SMTP_PORT = 587
EMAIL = 'testup.kz@gmail.com'
PASSWORD = 'mhwt udgu kenn ehex'
def send_email(subject, message, recipient):
msg = MIMEMultipart()
msg['From'] = EMAIL
msg['To'] = recipient
msg['Subject'] = subject
msg.attach(MIMEText(message, 'plain'))
try:
server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
server.starttls()
server.login(EMAIL, PASSWORD)
server.sendmail(EMAIL, recipient, msg.as_string())
server.quit()
print("Email sent successfully")
except Exception as e:
print(f"Failed to send email: {e}")
@app.route('/api', methods=['POST'])
def update_status():
data = request.get_json()
container_status = data.get('status')
if container_status == 'full':
subject = "Container Full Alert"
message = "The container is full and needs to be emptied."
recipient = "enessissenbi@gmail.com" # Замените на адрес получателя
send_email(subject, message, recipient)
print(f"Container status: {container_status}")
return jsonify({'message': 'Status received'}), 200
if __name__ == '__main__':
app.run(debug=True)