Introduction: How to Make Vaccum Cleaning Robot From Scratch
Introduction
Hi guys i'm Manikant savadatti , today we are going to build a vaccum cleaning robot using house old items. I had built a robot car in my last instructable ,i wanted to upgrade it and build something which will help my mom in her house cleaning . Hence , I thought of making a vaccum cleaning robot . To clean the house we have to map the house using algorithms and AI but as this is a project in which we are going to build from scratch we will be making a line following robot which cleans the specific area ( place where track is present).In the next project i'm going to teach you guys how to map the room . (View all my projects in my blog click here to view all )
Supplies
- Cardboard box
- Glue
- Robot car built in last instructable (click here to view how to make robot car )
- Ir sensor built in last instructable (click here to view how to make ir sensor)
- Nodemcu / Arduino
- Motor driver
- jumper wires
- Bo motors
- Propellor / impellor
Step 1: Hardware
Making robot chasi :
- Take a piece of cardboard and cut it to make a rectagular shape ( choose breadth and length size of cardboard according to your requirements )
- Fasten the Bo motors to all the four corners of the rectangle board using srews
- Connect the motors to the motor driver as shown above in the diagram
- Connect the motor driver to the Nodemcu /Arduino as given int the code
- If you use the connection as given above in the diagram you have to make few changes in the code
- Hence to avoid this connect the arduino and motor driver as i have given in the code
- Last step is to connect the ir sensor to microcontroller
- Connect the positive and negative terminal of sensor to the +5 and gnd of arduino or motor driver
- Connect the signal pins of sensor to pin 6 and 7 of arduino
Step 2: Making Vaccum Turbine / Dust Collector
Making vaccum turbine: Watch the images as you read the given points
- Take any plastic cup or any cylindrical tube or take an old bottle and cut it .
- Make a hole and place the motor above it as shown in 1st image
- Fix propellor or impellor to it from inside of the cylinder
- Make a hole at the edge of cylindrical cup to let the air out (see fig 2)
- Make a hole in robot chasi and place the turbine above the whole such that you can see propellor from the bottom of the car(see fig 4)
- Place a wire mesh or net in front of propellor or at the output of the turbine
- Take any cylindrical pipe and wrap sponge or any brush type material to make dust collecting roller(img 5)
- I have made the dust collecting brush from a old glue bottle and a vessel cleaning sponge
- You can rotate the roller using a motor by connecting motor to the gear of roller
- Or you can leave the roller as it is because the roller rotates automatically due to friction with the floor, as the robot moves forward
- The dust gets collected in the box ( image 8)
- You can watch the above images to get better idea of it .
Step 3: Software :
I have written lot of comments in the code so that even a begineer can understand the code . Just upload the code into Nodemcu / Arduino .You can view this link click here or view my previous instructable to know about how to use nodemcu using arduino ide .If you want to control the robot car using mobile instead of line following visit this link( click here) just paste the code of that project instead of the code given below
Code working:
- When ir sensor detects the floor it will send the signal 1 and when it detects black line it sends 0 to the arduino/nodemcu .
- When the left ir sensor detects the black strip robot will move right
- When the right ir sensor detects black strip robot will move left
- When both the sensors detect black strip the robot will stop
- The main logic is the robot tries to move such that the sensors only detect the floor and the track should be present in b/w the sensors.
// pin declaration if you are using Nodemcu
int leftMotorForward = 2; /* GPIO2(D4) -> IN3 */
int leftMotorBackward = 12; /* GPIO12(D6 ) -> IN4 */
int rightMotorForward = 4; /* GPIO4(D2) -> IN1 */
int rightMotorBackward = 0; /* GPIO0(D3) -> IN2 */
int rightMotorENB = 5; /* GPIO5(D1) -> Motor-A Enable */
int leftMotorENB = 14; /* GPIO14(D5) -> Motor-B Enable */
#define LS 13 // left sensor
#define RS 15 // right sensor
/*if you are using arduino ,instead of above declaration use this.int leftMotorForward = 2;
#define RS 15 // right sensor */
int leftMotorBackward = 12;
int rightMotorForward = 4;
int rightMotorBackward = 0;
int rightMotorENB = 5;
int leftMotorENB = 14;
#define LS 13 // left sensor
void setup(){
// put your setup code here, to run once:
pinMode(leftMotorForward, OUTPUT);
pinMode(rightMotorForward, OUTPUT);
pinMode(leftMotorBackward, OUTPUT);
pinMode(rightMotorBackward, OUTPUT); /* initialize motor enable pins as output */
pinMode(leftMotorENB, OUTPUT);
pinMode(rightMotorENB, OUTPUT);
// initialize sensor pins as input
pinMode(LS, INPUT);
pinMode(RS, INPUT);
}
void loop() {
if(digitalRead(LS) && digitalRead(RS)) // code to Move Forward
{ digitalWrite(leftMotorENB, HIGH);
digitalWrite(rightMotorENB, HIGH);
digitalWrite(leftMotorForward, HIGH);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, HIGH);
digitalWrite(rightMotorBackward, LOW);
}
if(!(digitalRead(LS)) && digitalRead(RS)) // code to Turn right
{digitalWrite(leftMotorENB, HIGH);
digitalWrite(rightMotorENB, HIGH);
digitalWrite(leftMotorForward, LOW);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, HIGH);
digitalWrite(rightMotorBackward, LOW);
}
if(digitalRead(LS) && !(digitalRead(RS))) // turn left
{digitalWrite(leftMotorENB, HIGH);
digitalWrite(rightMotorENB, HIGH);
digitalWrite(leftMotorForward, HIGH);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, LOW);
digitalWrite(rightMotorBackward, LOW);
}
if(!(digitalRead(LS)) && !(digitalRead(RS))) // stop
{digitalWrite(leftMotorENB, LOW);
digitalWrite(rightMotorENB, LOW);
digitalWrite(leftMotorForward, LOW);
digitalWrite(leftMotorBackward, LOW);
digitalWrite(rightMotorForward, LOW);
digitalWrite(rightMotorBackward, LOW);
} }