Homemade Bluetooth controlled car using HC-05 Bluetooth module to communicate with mobile phone
Source: InternetPublisher:风向双子座 Keywords: Bluetooth module HC-05 Bluetooth car Updated: 2024/12/19
This is a Bluetooth controlled car that uses the HC-05 Bluetooth module to communicate with your phone.
We can control the car with our phone via Bluetooth. Use an app to control the movement of the car.
Step 1: Requirements
Arduino
Motor guard
Motor battery (4v or more, 1amp or more)
5v power bank for Arduino
HC-05 Bluetooth Module
Robot chassis
Step 2: Assemble the chassis
Assemble the motor, wheels, and chassis according to the given chassis instructions.
Step 3: Download the Zip file
Download the zip file
and extract it
Step 4: Add the Autofocus Motor Library
Extract the zip file
Open the extracted folder
Copy the AF Motor folder
Go to the documentation section
Open the Arduino folder
Now open the Library folder
Paste the AFMotor folder
closure
Step 5: Upload the program
Connect Arduino to Laptop or PC
Open the extracted folder again
Open the car program
Go to Tools in the Arduino software
Make sure the board is the port that the Arduino Uno and Arduino are connected to
Upload the program
Step 6: Circuit Connection
Solder two wires at pins 0 and 1 of the Arduino: RX and TX.
Attach the motor shield to the top of the Arduino
Connect all motors to the motor shield as per the schematic.
The left motor is connected to M3 and M4
The right motor is connected to M1 and M2
If any motor rotates in the opposite direction, the wiring to the motor is reversed.
Step 7: Add Bluetooth Module
With Bluetooth module
Connect two busbars to busbars at +5v and GND
Connect the +5v and GND of the Bluetooth and the + and - of the servo to the motor shield as shown.
Connect the RX of the Arduino to the TX of the Bluetooth module
Connect the TX of Arduino to the RX of Bluetooth module
Step 8: Powering the Arduino and Motors
Connect the power bank to the Arduino via USB cable
Connect the battery to the motor shield
Step 9: Connect the application
Turn on Bluetooth
Search for new devices
Click HC-05
Enter password 1234
After pairing, open the Play Store
Search for Arduino Bluetooth RC Car
Download the app and open it
Click the Settings icon
Click to connect car
Click HC-05
When the red light turns green, it means it is connected
All done
Step 10: All Done
Mobile Controlled car code:
#include
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);
char bt='S';
void setup()
{
Serial.begin(38400);
motor1.setSpeed(255);
motor2.setSpeed(255);
motor3.setSpeed(255);
motor4.setSpeed(255);
Stop() ;
}
void loop() {
bt=Serial.read();
if(bt=='F')
{
forward();
}
if(bt=='B')
{
backward();
}
if(bt=='L')
{
left();
}
if(bt=='R')
{
right();
}
if(bt=='S')
{
Stop();
}
}
void forward()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}
void backward()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
}
void left()
{
motor1.run(FORWARD);
motor2.run( FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
}
void right()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}
void Stop()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3. run(RELEASE);
motor4.run(RELEASE);
}
- How to make a wheeled self-balancing robot using ultrasonic sensors
- Introduction to the internal structure of the Delta winding motor
- Manual automatic air compressor control circuit
- Squirrel cage asynchronous motor reverse braking control circuit
- Simple phase failure protection circuit composed of intermediate relay
- Design and analysis of the principle of automatic power-off switch during power outage
- An experimental model of an infrared radio alarm
- Home wireless burglar alarm circuit
- A novel and practical power line anti-theft and cutting alarm circuit
- Vibration anti-theft alarm circuit
- Egg heating control circuit
- Photocell trigger control circuit
- Photoelectric tracking control circuit
- Ringtone control circuit
- Infrared voice control circuit
- Traffic traffic light control circuit
- Digital current loop control circuit
- Voltage stabilization control circuit in power circuit
- Wide input range non-synchronous voltage mode control circuit
- Power supply circuit with multiple outputs (MAX1902)