Bluetooth Car With Mit App Inventor(block Code App Maker) and Arduino.

by swastikchakraborty1203 in Circuits > Arduino

681 Views, 3 Favorites, 0 Comments

Bluetooth Car With Mit App Inventor(block Code App Maker) and Arduino.

Screenshot_2023-02-09-18-35-20-894.jpeg
Screenshot_2023-02-09-18-34-38-999.jpeg

This car uses Hc05 Bluetooth module. The app used is made with MIT App inventor. It is a block code app which can be used to make apps for various purposes.

Supplies

Screenshot_2023-02-09-18-38-31-765.jpeg
Screenshot_2023-02-09-18-42-42-893.jpeg

Arduino Uno

Hc-05 Bluetooth

Motors

Motor driver

Now, I am assuming you have basic knowledge of Arduino. The wiring of motor driver and Arduino is given in the code.

If you don't know how to use an Arduino, there are plenty of articles in the internet about it.

Code

Screenshot_2023-02-10-13-43-32-719.jpeg
Here's is the code you need to upload to the Arduino board using Arduino IDE. If you don't have Arduino IDE downloaded in your system you can download it from here- https://www.arduino.cc/en/software


char t;

 

void setup() {

pinMode(13,OUTPUT);   //left motors   forward

pinMode(12,OUTPUT);   //left motors reverse

pinMode(11,OUTPUT);   //right   motors forward

pinMode(10,OUTPUT);   //right motors reverse

pinMode(9,OUTPUT);    //Led

Serial.begin(9600);

 

}

 

void loop() {

if(Serial.available()){

   t = Serial.read();

  Serial.println(t);

}

 

if(t == 'F'){            //move   forward(all motors rotate in forward direction)

  digitalWrite(13,HIGH);

   digitalWrite(11,HIGH);

}

 

else if(t == 'B'){      //move reverse (all   motors rotate in reverse direction)

  digitalWrite(12,HIGH);

  digitalWrite(10,HIGH);

}

   

else if(t == 'L'){      //turn right (left side motors rotate in forward direction,   right side motors doesn't rotate)

  digitalWrite(11,HIGH);

}

 

else   if(t == 'R'){      //turn left (right side motors rotate in forward direction, left   side motors doesn't rotate)

  digitalWrite(13,HIGH);

}


else if(t ==   'W'){    //turn led on or off)

  digitalWrite(9,HIGH);

}

else if(t == 'w'){

   digitalWrite(9,LOW);

}

 

else if(t == 'S'){      //STOP (all motors stop)

   digitalWrite(13,LOW);

  digitalWrite(12,LOW);

  digitalWrite(11,LOW);

   digitalWrite(10,LOW);

}

delay(100);

}

MIT App Inventor

Screenshot_2023-02-10-13-52-39-749.jpeg

You can use the MIT App inventor to create an app that will send signals to the arduino if you have basic knowledge of MIT App Inventor. Or you can just download the app from here.

https://drive.google.com/file/d/1-DmnLtBzIBJTTe_ZWne-pzoZ5YK4l_Jw/view?usp=drivesdk

If you want to design your own app here's how you can do it.

Designing the App

757.PNG

You will first have to add the elements such as buttons and labels as given in the above image. You will have to insert 4 buttons and 1 list picker (to show available devices.) as given above. After doing this you will need to move to the 'blocks' window where you need to code the app.

Block Code

Capture7474.PNG

After designing the app, you need to code it. The block code is given above. It will help to select a device using the list picker and then send commands to the arduino using bluetooth. Based on these commands, the car will move forward, backward, left or right.