Smart Trash Bin With Arduino Uno Microcontroller (WALL-E)

by mtadros28 in Circuits > Arduino

44 Views, 1 Favorites, 0 Comments

Smart Trash Bin With Arduino Uno Microcontroller (WALL-E)

finale image .png

Most of us throw out our trash without thinking twice. But did you know that your trash can might be one of the dirtiest items in your home?

In fact, studies have found that trash can handles can have over 400 bacteria per square inch.

Every time you touch your trash can, these germs can transfer to your hands. And if you don't wash up immediately, you might touch your face, open the fridge, or grab a snack, which spreads the germs all over your home and causes lots of health issues.

To fight this everyday risk, we developed WALL-E, a smart trash can that makes hygiene hands-free.

WALL-E uses Arduino technology with two infrared sensors:

The first sensor detects your hand and automatically opens the lid, so you never have to touch it.

The second sensor checks the level of the trash inside. If the bin is full, it turns on a red LED light. If it’s still got room, it turns on the green LED.

This simple solution can reduce contact with harmful bacteria and help protect your family from infection.


Developed by: Marise Tadros, Farida Alsaghir, and Mohamed Al-Qersh.



Supplies

Supplies.png

A set of male wires

A set of male-female wires

Red and green LEDs

servo motor with horn

Two IR Sensors

Breadboard

Setup

step 1.png

The photo above shows the setup of the project.

The circuit should be set up as follows.


Connect the Arduino to the Breadboard

second step .png

First, let's connect the 5V and GND pin on the Arduino to the breadboard. Make sure that the wire attached to the 5V pin is connected to the positive channel of the breadboard, and the wire attached to the GND pin is connected to the negative channel of the breadboard.

To make it easier you can use color coding for the wires

red = +5V

black = GND

green = Signals


Setup the IR & Servo Motor That Opens the Trash Can Cover

third step .png

Now let's make the first feature, we are going to connect the IR sensor that detects any object then moves the Servo Motor and automatically opens the trash cover. First, to connect the IR. We are going to connect the GND pin on the IR sensor to the negative channel on the breadboard. Next connect the Signal pin on the sensor to pin 4 on the Arduino. Lastly, connect the VCC pin on the IR sensor to the positive channel on the breadboard.

Next, to connect the Servo Motor we are going to connect the GND pin on the Servo Motor to the negative channel on the breadboard. Then connect the Signal pin on the Servo Motor to pin 10 on the Arduino. Lastly, connect the VCC pin on the Motor to the positive channel on the breadboard.


Setup the Other IR and the LEDs to Show the Status of the Bin

forth step .png

Moving onto the second feature, we will connect the other IR that will have control over which of the two LEDs will light up (Red or Green), which indicate whether the bin is full or not.



Connect the LED's to the breadboard and Arduino. Let's first attach the Red LED. To do this you have to connect the anode (the longer leg) to pin 12 on the Arduino with a green wire, and to connect the cathode (the shorter leg) to the negative channel on the breadboard. Then repeat that step for the Green LED, connect the anode (the longer leg) of the green LED to pin 13, and connect the cathode (the shorter leg) to the negative channel on the breadboard.

Then to connect the IR, We are going to connect the GND pin on the IR sensor to the negative channel on the breadboard. Next connect the Signal pin on the sensor to pin 2 on the Arduino. Lastly, connect the VCC pin on the IR sensor to the positive channel on the breadboard.


Use a Cardboard Box to Put All the Components Together

fifth step .jpg

We can use a simple cardboard box to hold all the components, this is just for prototyping purposes. And if we have the power and resources to turn this into a real product, then using something like plastic, wood, or metal would be more ideal for more durability.


Write the Script to Make a Functioning Smart Bin

After finishing the setup, you can start writing the code. Below you will find the code so you can copy and paste it. Once you have written the code, you are finished!

#include <Servo.h>

Servo servo;

int Ir1 = 4;

int Ir2 = 2;

int RedLed = 12;

int GreenLed = 13;



void setup() {

servo.attach(10);

servo.write(110);

pinMode(Ir1,INPUT);

pinMode(Ir2,INPUT);

pinMode(RedLed,OUTPUT);

pinMode(GreenLed,OUTPUT);

}

void loop() {

int controlGate = digitalRead(Ir1);

int trashAmount = digitalRead(Ir2);

if(controlGate==0){

servo.write(0);

digitalWrite(RedLed,LOW);

digitalWrite(GreenLed,LOW);

delay(1000);

` }else{

servo.write(110);

}

if (trashAmount==0){

digitalWrite(RedLed,HIGH);

digitalWrite(GreenLed,LOW);

}else{

digitalWrite(RedLed,LOW);

digitalWrite(GreenLed,HIGH);

}

}