Hello everyone. Welcome back to coding Maestro. In today's video, I will show you how to make an automatic Dustbin. So first, we are going to prepare the software. I have opened Arduino IDE and I have already entered the code. You can find the code in the description. So now plugging in the computer and I'm uploading the code before we upload the code, we need to First compile the code to do that. First, we need to select the board which is Arduino
And you also need to select a port to which the board is connected to the computer. Now, compiling the code, as you can see, on the screen, there's a message that says done compiling. Now we have to upload the code, so it's a fast process to approve very small quote. Since there is small code, we can upload it very quickly. Now, you can also see that the code is being uploaded. And there are
Various different lights that turn on or the Arduino that shows us that the code is being uploaded. So the code is done uploading. So next we are going to prepare the hardware. There are various materials needed for this, the material Street required are. And how do you know, Is SG90 micro Servo motor.
I'll add links to all of the products in the description on Amazon and if you are in Bengaluru, I'll add it to a store called probots where you can go and buy the products. Next we are using HC-SR04, ultrasonic sensor. This is going to be a main part, then we need lots and lots and lots of jumper cables.
After that. We'll also be needing. Can you guess it? Yes, it's a Lithium-Ion battery pack in which we have two batteries and a case each battery cost about 80 Indian rupees. So it's a battery pack, it's rechargeable and then we need switch, so that we can control how the power goes into the Arduino.
If you have been active on my channel, recently have actually posted a YouTube short on the of this automatic Dustbin, or we can also call it as a smart Dustbin, So now, we are going to connect the very jumper cables to our HC-SR04. Ultrasonic sensors.
So as you can see how I'm plugging in the variation, a cables, I need a lot of jumper cables, but actually it is enough. It is very much. It's not very much required to add three sets of jumper cables, since I need the sr0 for Ultrasonic sensor, long away from the actual Arduino. So I'm kind of connecting it with four different sets of jumper cables. Yes.
At the start of Sonic sensor, we have to plug in three different sets of cables have lost. Now, this is going to be kind of yeah. so, now, the first set of jumper cables is plugged in As you can see, there are various ports on.
The ultrasonic sensor, they are the GN D Trigg VCC and Echo. So basically how the head ultrasonic sensor works is, there's an emitter and a receiver, the ultrasonic sound waves are emitted through the emitter and if that's an object, the object blocks the sonic waves
and it will also reflect the ultrasonic waves back to the reflector. If there's no object, if there's no object, the waves travel feel really and they do not come back to the receiver. As you can see, I've plugged in another set of wires. Or jumper cables.
Next is the last and final set the code and the circuit diagram of this project will be in the description. I'll make sure to put the code in the description and the circuit diagram. No should be put in the description and also at the end of the video. So we'll help you see, as you can see, three sets of wires are connected now,
I'll take this C 0 for 12 or something sensor. And I'm connecting the G and D. The turns it to purple. Then it turns into blue. The gnd is the blue colour, so I'm plugging the gnd and to the GLD Port, Honda Odyssey.
The gnd POR Toda. Do you know report is not actually in the power or analog in it's actually in the digital pwm. Okay, so it's the fourth word from the last have plugging it into the gnd port. So you can see, now it is connected to the gnd port.
Now, I'm going to take the echo cable. all right, I'm going to connect it into the See that cookie, table turns into another blue colour cable go into now. Plug their cookie will. As you can see, I'm going to plug it into
the sixth port. Number 6, Spot. On the digital p.m. side of the Arduino board. Next, I'm going to connect the trick or trigger and option or four of the ultrasonic sensor into the I'm going to plug it in
into the number 50 dollar bill. You can see it comes down to a purple cable. Damn, going to plug it into the number five on the ordinary. Number 5. And then I'm going to take the Gray cable, which is
the VC C cable, which is the VC, C cable, the Gray colour table, and I'm going to plug it into the 5, volt on the power side of the Arduino Uno. Not on the digital side, but on the power side, I'm going to plug it into 5 V + 5 moved.
Now, I'll clean up my workstation and I have taken that is see 90s are 90 micro Servo motor and I'm going to be changing the tech as we needed to open the lid of the Dustbin going to be changing the tip of the SE.
90 micro server neuter. Yes, this is the tip that I want tube used so we just plug the old tip and now you place the tip. So I'm going to be placing the new tip. Going to be pressing it hard then, boom. And it is connected.
Instead, I'm going to be packing everything in. and, I'm going to be taking three more jumper cable or jumper wires and connecting it by their colours to the other set of jumper cables or the microsurgery. On the micro Servo. I'm going to be connecting it to the other three sets of cables.
As you can see. It moves very easily. Now, it is connected. next, I'm going to be taking the one of the cables that is the red jumper wire. No
Brown jungle. And I'm going to be inserting it to the Army. The brown jumper wire is represents the black cable of any Cebu. The black cable is also the positive side, the micro Servo and going to be connecting it to G and Deport
of the Arduino will grow gnd poor. That comes in the power side, we connect you to the IND Port. Next, I'm going tube taking the red wire or red cable of the Arduino of the micro Servo motor. And I'm going to be plugging it in to the Arduino.
device that teaches kids basic robotics. I'm going to be plugging it into the 3.3 V of the Arduino Uno. 3.3 V of the Arduino Uno. I'm going to be taking the orange wire and a plugging it into the seven port on the digital side of the Arduino Uno.
On the digital side of the table. As you can see, Microsoft will motor the Microsoft one with the, the ultrasonic sensors are all connected. Now, I'm going to be connecting the power battery pack to the Arduino using jumper cables. I'm going to tie the normal cable, the jumper, cables tip, so that electricity can transmit.
As you can see, now, the cable is tied to the jumper cable of the Arduino Uno jumper wire, which is going to be now connected to the arm. Now, I'm going tube taking the negative wire of the audio input and we connected it before that. I'm going to connect it with a piece of tape so that the wires don't
Short, there's no tape. The wires would short and the circuit will be damaged. The tape is now fixed and now I'm going to be connecting it. The connecting the other side of the wire into the jumper cable. I'm going to be peeling off the plastic coating so that the copper wires can be exposed.
after the copper wires are exposed and now twist and turn them into one strand of copper, so that will be very easy for me to put it into the Switch to sing, it will be very easy to put it into this switch. Now. I did this, I'll take the switch. And now insert before that I'm going to be twisting it
a little more. I'm going to now be taking the switch and I'm going to be putting the copper wire inside of it. As you can see, now the copper wire has been inserted and I'm securing it by twisting the wire around the plastic coating. Then I'm going to be taking another piece of wire. To connect it to the other end of this Ridge.
This wire also needs to be in this wire to the plastic coating needs to be removed. So I'll do the two three over here. The plastic coating is now removed. So as the plastic coating is ruined, I insert it into the sea witch.
And now I'm going to be twisting turning it. Making sure it has a tight foot on the switch. You can see the fits
very tight. No, I'm going to be connecting it with AA. Do you know? The black wire or the positive wire goes into the GM D of the all the, you know,
the power side and the red wire will go The Red. Door - why're, we put the vi n Port of the Arduino is on the power side, too. After this, I'll be adding a circuit diagram so that you help you With seeing and doing it. This project yourself after connecting it. We need to connect the micro Servo motor to the Dustbin lid, which are got out of cardboard cardboard,
which is roughly the size of the bit, and then I'm going to be connecting it with the micro servo motor after which this project is complete. You can try it out and I'll add a test video later. From which you can refer and see. So, thank you guys for watching this video.
Here is a sample circuit diagram for an automatic dustbin using an Arduino Uno board and a infrared proximity sensor:
In this circuit, the infrared proximity sensor is used to detect when an object is nearby. When an object is detected, the sensor sends a signal to the Arduino Uno board, which activates a servo motor to open the lid of the dustbin. The servo motor is controlled by the Arduino through a digital pin.
To set up this circuit, you will need the following components:
Arduino Uno board
Infrared proximity sensor
Servo motor
Breadboard
Jumper wires
To connect the components, follow these steps:
Connect the infrared proximity sensor to the breadboard. The sensor has three pins: VCC, GND, and OUT. Connect the VCC pin to the 3.3V pin on the Arduino, the GND pin to a GND pin on the Arduino, and the OUT pin to digital pin 2 on the Arduino.
Connect the servo motor to the breadboard. The servo has three wires: red, black, and white. Connect the red wire to the 5V pin on the Arduino, the black wire to a GND pin on the Arduino, and the white wire to digital pin 9 on the Arduino.
Use jumper wires to connect the breadboard to the Arduino. Connect one end of a jumper wire to a row on the breadboard and the other end to a corresponding pin on the Arduino.
Upload the following code to the Arduino to control the servo motor:
CODE
#include <Servo.h>
const int PROX_SENSOR_PIN = 2; // Proximity sensor pin
const int SERVO_PIN = 9; // Servo pin
Servo myservo; // Create servo object
void setup() {
myservo.attach(SERVO_PIN); // Attach servo to pin
pinMode(PROX_SENSOR_PIN, INPUT); // Set proximity sensor pin as input
}
void loop() {
// Read proximity sensor value
int proxVal = digitalRead(PROX_SENSOR_PIN);
// If object is detected, open the lid
if (proxVal == HIGH) {
myservo.write(180); // Set servo to 180 degrees (open position)
delay(500); // Wait for half a second
}
// If no object is detected, close the lid
else {
myservo.write(0); // Set servo to 0 degrees (closed position)
}
}
With this circuit and code, your automatic dustbin should be able to detect when an object is nearby and open the lid to allow for waste disposal. You can adjust the sensitivity of the proximity sensor and the position of the servo motor to fine-tune the behavior of the dustbin.
<html>
Product Materials:
Arduino Uno: https://probots.co.in/uno-r3-ch340g-atmega328p-development-board-compatible-with-arduino.html
Product Materials:
Product Materials:
<Youtube Video Launching Soon>
https://youtu.be/s41vPBe8lIM </Youtube Video Launching Soon>
</html>
Comments