hey everyone. are you tired of sweeping the floor. to solve this problem we have vacuum cleaner but vacuum cleaner requires a human to follow it. so we might be wondering if we could clean the floor by sitting in one place. so lets make your wonder true using Arduino.
connections.
connection of Arduino
1) tx of Bluetooth to rx of Arduino
2) rx of Arduino to tx of Bluetooth
3) GND of Bluetooth to GND of Arduino
4) VCC of Bluetooth to 5V of Arduino
5) a pin of DC motor to digital pin 13 of Arduino
6) another pin of DC motor to GND of Arduino
7)take another DC motor
8) a pin of DC motor to digital pin 11 of Arduino
9) another pin of DC motor to GND of Arduino
10)take another DC motor
11) a pin of DC motor to digital pin 12 of Arduino
12) another pin of DC motor to GND of Arduino
Precautions:
1) make sure motor 1 always rotates clockwise and motor to rotates anti clockwise if it doesn't happen exchange the connections.
2) front motor should be left side
3) back motor should be right side
4)connect a plastic fan at 3rd motor
5)if the motor gives air then exchange its connections
here is the code.
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);//dc motor
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
digitalWrite(12, HIGH);
}
void loop()
{
if(Serial.available() > 0)
{
char data= Serial.read();
Serial.print(data);
Serial.println(data);
if(data == 'a')
{digitalWrite(13, HIGH);
digitalWrite(11, LOW) ;
}
else if(data == 'b')
{digitalWrite(13, LOW);
digitalWrite(11, HIGH) ;
}
else if(data=='c')
{digitalWrite(13, HIGH) ;
digitalWrite(11, HIGH) ;}
else{
digitalWrite(13, LOW) ;
digitalWrite(11, LOW) ;
}
}
}
how to operate it:
write a when you want car to go front
write b when you want car to go back
write c when you want car turn
it will always vacuum the floor
physics behind it:
you might be wondering how the car rotates. I will explain it how with example
example:
when you are removing a bottle cap you will use two fingers thumb and index.
with the index finger you move it front and with thumb you move it backside.
the index will be placed left and thumb will be placed right the bottle rotates.
here when you press c the both motor rotates as they are placed left and right.
the app to control it
https://play.google.com/store/apps/details?id=com.tools.ArduinoBluetooth
did you like the project?
do you want code for your project
contact me here
Comments
Please log in or sign up to comment.