IOT

How to design a Wireless Bluetooth Controlled Robot using Arduino?

In this blog, we will discuss how to create a Wireless Bluetooth Controlled Robot Car with Arduino. A Smartphone can be used to control the robotic car wirelessly. The smartphone has an Android app that allows the user to give commands to the Robot directly. The robot has the ability to move forward, backward, left, and right, as well as halt.

A Bluetooth module HC-05 or HC-06 is used to interface with the Arduino’s Bluetooth-controlled robot car. Through Android software on the phone, we may provide particular voice commands to the robot. A Bluetooth transceiver module on the receiving end receives the commands and passes them to the Arduino, allowing the robotic automobile to be controlled.

Hardware Required:

  • Arduino UNO R3 Development Board
  • HC-05/HC-06 Bluetooth Module
  • L293D H-Bridge Motor Driver IC
  • 12V DC Geared Motors, 300 RPM
  • Robot Chasis
  • Robot Wheels
  • Male/Female Jumper Wires

Block Diagram

The Arduino Wireless Voice Controlled Robot block diagram is shown below.

Block Diagram Voice Controlled Robot

A transmitter and a receiver portion make up the Arduino Wireless Voice Controlled Robot. The transmitter comprises a Smartphone with Bluetooth capabilities and Android software installed. Similarly, the Receiver section includes an Arduino board as a CPU, an HC-05 Bluetooth Module as a wireless communication module, an L293D for driving motors, and a pair of DC geared as a moving robot component.

Circuit Diagram & Connections

The Arduino UNO Board, HC-05/HC-06 Bluetooth Module, L293D Motor Driver IC, a pair of 300 RPM DC Geared Motors, and a 9V Battery make up the circuit.

The Arduino’s TX and RX pins are connected to the Bluetooth Module’s Rx and Tx pins. 5V is given to the Bluetooth Module. Similarly, the left DC motor is connected to pins 3 and 6 of the L293D, while the right DC motor is attached to pins 14 and 11 of the L293D. L293D 2, 7, 10, and 15 are connected to Arduino digital pins 2, 3, and 5.

The Android App

This project’s app can be found below. MIT App Inventor was used to create it. This is how the user interface looks.

Internal design and programming have also been created to allow the Android app to control the Robot wirelessly through Bluetooth.

The Android App should look like this after the final design. You can get the APK file from the link below and install it on your smartphone.

Download: Bluetooth Controlled APK File

Working on the Project

App Logic Commands are handled by the phone, as previously stated. The command is subsequently relayed through Bluetooth to the recipient. The UART serial communication protocol is used to send commands received over Bluetooth to the Arduino Uno device. The commands are checked by the Arduino code. Arduino controls the robot’s movements in forward, backward, Turning Right, Turning Left, and Stop whenever the instruction is a matching string.

The signal logic levels at various stages of the circuits for proper robotic automobile control are listed below.

Source Code/Program

The Arduino source code for the Wireless Bluetooth Robot is provided below. You can copy the code and upload it to the Arduino Board directly.

String readvoice;
int k=0;
void setup() {
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}

void loop() {
while (Serial.available())
{
delay(3);
char c = Serial.read();
readvoice += c;
}

if(readvoice.length() > 0)
{
Serial.println(readvoice);

if(readvoice == “forward”)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
k=1;
}

if(readvoice == “backward”)
{
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
k=2;
}

if(readvoice == “right”)
{
if (k==2)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
}
else
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
}

if(readvoice == “left”)
{
if (k==2)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
}
else
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(1000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}
}

if(readvoice == “stop”)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}
readvoice=””;
}

Conclusion:

I hope all of you understand how to design a Wireless Bluetooth Controlled Robot using Arduino. We MATHA ELECTRONICS will be back soon with more informative blogs soon.

Leave a Reply

Your email address will not be published.