Smart dustbin with Arduino
Welcome to the Techatronic Guys, we always try to come with the new inventions and electronic projects and this time we made a smart dustbin. and we are making a tutorial on it. In this tutorial, we will learn how to make a Smart Dustbin with Arduino. all the procedures, code and circuit diagram we will share with you. As all, we know the coming era and the present era is full of technology and automation. we try a small contribution to make dustbin which is also an automatic Dustbin. every day we see the thing smarter day by day. our phone our home our vehicle so we can try by ourselves in our daily use of things such as smart dustbin. also, this is fun for the children so they always try to throw the garbage into this dustbin. so, by this our home remains clean and also the child develope them to the technology.
What is Smart Dustbin?
The smart dustbin is an automatic lid opener system for garbage. there is a sensor that detects the person in front of the sensor and then the lid of the dustbin will be open. you can make the smart dustbin with our old dustbin present in your home. it is very simple just read the full article which consists of the principle, working and construction of the smart dustbin with Arduino. there are many other Arduino projects on the main page you can check there.
Learn 10+ basic activity & sensor interfacing with our Arduino ebook. Well explained program. And brief circuit diagram WhatsApp and email support. which will help you to learn basic electronics, Arduino Coding, Sensor interfacing with Arduino, Arduino, and much more. buy Arduino Ebook to learn https://techatronic.com/arduino-ebook/
How does a smart dustbin work?
We are using an ultrasonic sensor that transmits the ultrasonic waves and receives the waves when they come back by hitting any object. so when the person detects in front of the dustbin it sends some signal to the Arduino which we are using as a Controller in this project. so now the Arduino gets the data and analyzes the data for further processing so that the dustbin can operate well. now, understand how the Arduino analyses the data. the ultrasonic sensor sends the received signal to the Arduino and Arduino calculates the distance by the duration of soundwaves come back.
Now, according to the distance, we make some conditions in the code. like if the distance between the person and the dustbin is less than 20 centimeters then the Arduino will send a command to the servo motor to rotate 90 degrees from its initial position which causes the lid to open and after the interval of 10 seconds, the lid well automatically close.
How to create Smart Dustbin with Arduino
to make this dustbin you need the following components Material:-
Components required:-
- Arduino Uno
- Servo motor
- Jumper wires
- Breadboard
- Ultrasonic sensor
- battery
S.No | Component Required | Quantity | Buy Link |
1. | Arduino UNO | 1 | https://amzn.to/3ue2vmh |
2. | Arduino UNO Cable | 1 | https://amzn.to/3obXjht |
3. | Ultrasonic Sensor | 1 | https://amzn.to/2YjUUqC |
4. | Servo Motor | 1 | https://amzn.to/3iB4M63 |
5. | Jumper Wire | 40 | https://amzn.to/39q43jr |
6. | Breadboard | 1 | https://amzn.to/39vsRX2 |
7. | 9 Volt Battery | 1 | https://amzn.to/3iko1AK |
Material required:-
- Dustbin
- cardboard
- ice- cream stick
- adhesive
- scissor
- Paper cutter
- Cello tape
S.No | Component Required | Quantity | Buy Link |
1. | Dustbin | 1 | https://amzn.to/3DfUrEL |
2. | Cardboard | 1 | https://amzn.to/3uMuc5C |
3. | Ice- Cream Stick | 1 | https://amzn.to/3uNmd8x |
4. | Adhesive | 1 | https://amzn.to/3mAoS1J |
5. | Scissor | 1 | https://amzn.to/3Bkd4H9 |
6. | Paper Cutter | 1 | https://amzn.to/3ageeaE |
7. | Cello Tape | 1 | https://amzn.to/3ljAGpD |
Construction:-
cut the lid of the dustbin replace the lid with the cardboard lid shape. you can see the whole construction video tutorial in the youtube video attached to this post. attach the ultrasonic sensor at the front of the dustbin. and connect the servo with an ice cream stick and attach it to the dustbin.
Smart dustbin circuit diagram
Arduino UNO | Ultrasonic Sensor | |
( +5V ) | VCC | |
GND | GND | |
D10 Pin | Trig Pin | |
D11 Pin | Echo Pin | |
Arduino UNO | Servo Motor | |
D9 Pin | OUT Pin | |
( +5V ) | VCC | |
GND | GND | |
Arduino UNO | LED | 220 Ohm Resistor |
D12 Pin | Anode Pin | |
Cathode Pin | Terminal 1 | |
GND | Terminal 2 |
does the connection according to the circuit diagram
in the given code we are using pin number 2 as the output pin which has to be connected to the ultrasonic trigger pin. and this trigger pin transmits the ultrasonic signals now the same signals received by the receiver which is to be connected to the ECHO pin which is pin number 3. it is an input pin because it receives the data and sends it to the Arduino.
Smart dustbin Arduino Code
#include <Servo.h>
Servo myservo;
int pos = 20;
const int trigPin = 10;
const int echoPin = 11;
const int led = 12;
long duration;
float distance;
void setup()
{
myservo.attach(9);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led, OUTPUT);
myservo.write(pos);
}
void loop()
{
//Serial.begin(9600);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = 0.034*(duration/2);
//Serial.println(distance);
if (distance < 27)
{
digitalWrite(led,HIGH);
myservo.write(pos+160);
delay(1000);
}
else
{
digitalWrite(led,LOW);
myservo.write(pos);
}
delay(300);
}
Upload the code into the Arduino and then make all the connections. all the best
Which app you use for making circuit diagram?
Thanks for Asking. it’s fritzing