|
arduino IDEArduino
|
|
|
Arduino Bluetooth ControlBroxcode
|
Bluetooth controlled RC Car
Bluetooth Controlled RC Car
In this project, I will show you how to build a bluetooth controlled rc car using hc05, l298n, and arduino uno. This is a fun and easy way to control a car with your smartphone or any other bluetooth device. You can use this project to learn about wireless communication, motor control, and arduino programming.
The main components of this project are:
- HC05: This is a bluetooth module that can communicate with other bluetooth devices. It can be configured as a master or a slave device. In this project, we will use it as a slave device that receives commands from the smartphone.
- L298N: This is a motor driver module that can control two DC motors. It can provide up to 2A of current per channel and has built-in protection features. It can also accept PWM signals to control the speed of the motors.
- Arduino Uno: This is a microcontroller board that can run various programs. It has 14 digital pins and 6 analog pins. In this project, we will use it to read the commands from the HC05 module and send PWM signals to the L298N module.
- RC Car: This is a toy car that has two DC motors, one for driving and one for steering. It also has a battery pack that powers the motors and the arduino.
The basic working principle of this project is as follows:
- The smartphone sends commands to the HC05 module via bluetooth. The commands are in the form of characters, such as 'up arrow key' for forward, 'down arrow key' for backward, 'left arrow key' for left, and 'right arrow key' for right.
- The HC05 module receives the commands and sends them to the arduino via serial communication.
- The arduino reads the commands and executes them by sending PWM signals to the L298N module.
- The L298N module controls the speed and direction of the motors according to the PWM signals.
- The RC car moves according to the commands from the smartphone.
This project is very exciting and enjoyable to make and play with. You can customize it by changing the code, adding more features, or modifying the car.
There is one more thing i need to tell you is that while uploading the code always remove the tx,rx pins and then insert it back after uploading.
char Incoming_value = 0;
int ma1=7;
int mc1=8 ;
int ma2=9;
int mc2 = 10;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(ma1, OUTPUT);
pinMode(mc1, OUTPUT);
pinMode(ma2, OUTPUT);
pinMode(mc2, OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
Incoming_value = Serial.read();
Serial.print(Incoming_value);
Serial.print("\n");
if(Incoming_value == '2'){
digitalWrite(mc1, HIGH);
digitalWrite(ma1, LOW);
digitalWrite(mc2, HIGH);
digitalWrite(ma2,LOW);
}
else if(Incoming_value == '1'){
digitalWrite(mc1, LOW);
digitalWrite(ma1, HIGH);
digitalWrite(mc2, LOW);
digitalWrite(ma2, HIGH);
}
else if(Incoming_value == '3'){
digitalWrite(mc1, HIGH);
digitalWrite(ma1, LOW);
digitalWrite(mc2, LOW);
digitalWrite(ma2, HIGH);
} else if(Incoming_value == '4'){
digitalWrite(mc1, LOW);
digitalWrite(ma1, HIGH);
digitalWrite(mc2, HIGH);
digitalWrite(ma2, LOW);
} else if(Incoming_value == '5'){
digitalWrite(mc1, LOW);
digitalWrite(ma1, LOW);
digitalWrite(mc2, LOW);
digitalWrite(ma2, LOW);
}
}
}
Bluetooth controlled RC Car
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(5)
- 2 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
7design
-
6usability
-
9creativity
-
10content
-
8design
-
9usability
-
7creativity
-
9content
More by Engineer
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-