Today we are sharing a very cool project. We are making an Automatic dustbin, which is smart in its ways. Like when you come near the dustbin it will automatically open the lid. Which can help you a lot to reduce the risk of spreading disease.
Also, we have added one more function to it. That is an overflow alarm. Which works for rubbish. If there is no space inside the dustbin will make an alarm noise. This is really a very interesting project that you can use anywhere like school, home, and offices. Only it needs a very small amount of electricity to operate this dustbin.
In case you can use both the things like battery and power supply. We are going to give you all the information only if you have read and follow the given steps. So, let’s get started.
Introduction to the Arduino based dustbin
This is our smart dustbin project which is very popular nowadays. It is very simple to make, only we need some electronic components to make it. We will share full details of the project such as code, circuit diagram and step by step construction. So, with the help of these components, we will make this automatic dustbin which automatically opens the lid when you come in front of the sensor. Also, there is an overflow alarm inside the dustbin so, when it is full and you are at the front of the dustbin. The dustbin will not open the lid. Instead of opening the lid it will start an alarm that there is no space inside the dustbin. You have to first clear the rubbish from the dustbin.
Servo Motor (995G)
- Connect the servo motor with the dustbin lid in this manner so that when the servo motor rotates the 90 degree lid will open and when the servo motor rotates in reverse the lid will close. You can paste the servo motor with the glue gun.
- Place an ultrasonic sensor at the front of the dustbin so that any person coming in front of the dustbin easily can be detected.
- Place another sensor inside the dustbin in this manner so that it can easily detect the rubbish inside the dustbin.
- You can place the Arduino wherever you are comfortable according to the wiring.
- You can attach a 5v battery to it, we have used a power supply of 5v.
In the behalf of the working of this dustbin, we can divide the working in two parts.
1st Setup Working of opening the lid :-
Whenever someone comes in front of the sensor, the ultrasonic sensor senses the object and sends this information to the Arduino and the Arduino compares this value to the threshold value which we have entered into the code. The threshold value for the lid we have adjusted is 20 centimetres. It depends on you whatever distance you need. So, when the sensor value crosses the threshold value, then the Arduino sends the commands to the servo motor to be rotated 90 degrees. And after 10 seconds, the servo motor will rotate reverse. This is how the system works for 1st setup. Now we will talk about the 2nd setup.
2nd Setup working , overflow alarm:-
The ultrasonic sensor continuously checks the dustbin from the inside. When the rubbish inside the dustbin is full, then the ultrasonic sensor sends this information to the Arduino that the dustbin is full. In reaction to this situation, the Arduino will send the instruction to start the buzzer and the red light. So, when we empty the bin, the buzzer will stop and the red LED will turn off and the green LED will turn on. So, this is how the dustbin 2nd setup works.
Circuit Diagram :-
const int trigPin = 2;
const int echoPin = 3;
const int trigPin1 = 5;
const int echoPin1 = 4;
int distanceCm, distanceInch;
int distanceCm1, distanceInch1;
duration = pulseIn(echoPin, HIGH);
distanceInch = duration*0.0133/2;
duration1 = pulseIn(echoPin1, HIGH);
distanceInch1 = duration1*0.0133/2;
myservo.write(80); // tell servo to go to position in variable ‘pos’
myservo.write(0); // tell servo to go to position in variable ‘pos’
We have given all the required steps and content. Good luck!
Check out our other projects:
- Bluetooth Notice Board Using Arduino And HC05
- Automatic Street Light using Light Sensor
- Automatic Dustbin using Arduino
- Fire Alarm Using Arduino
To learn about The Best Arduino Starter Kits from Kunkune Click Here!