IOT

How to design Wireless Voice Controlled Robot Car Using Arduino?

In this blog, we will learn how to create a Voice Controlled Robot Car with Arduino.  The robotic car can be controlled wirelessly by the user’s vocal instructions. 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 connected to the Arduino voice-controlled robot automobile. 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.

Components Required

  • Arduino UNO/Nano or any other Board
  • HC-05/HC-06 Bluetooth Module
  • 12V DC Geared Motors 300 RPM
  • 9V Rechargeable Battery
  • L293D H-Bridge Dual Motor Driver IC
  • Connecting Wires
  • Robot Chasis & Wheels
  • Breadboard

Block Diagram

The block diagram of the Arduino Wireless Voice Controlled Robot is given below.

Block Diagram Voice Controlled Robot

The Arduino Wireless Voice Controlled Robot is made up of two sections: a transmitter and a receiver. The transmitter end consists of a Bluetooth-enabled smartphone with Android software installed. In the same way, the Receiver section has an Arduino board as a CPU, an HC-05 Bluetooth Module as a wireless communication module, an L293D for controlling motors, and a pair of DC geared as a moving robot part.

HC-05 Module 

HC-05 is based on Bluetooth SPP (Serial Port Protocol) module designed as Wireless Serial Communication that allows use with any microcontroller.  It supports the UART protocol for easy transfer and receives data wirelessly. This module is the most demanding and popular due to its low cost and extremely high features.

This module works as both Master and Slave Mode and easy switchable between these two modes. By default, Slave mode is configured. And the configured Modes changed using AT Commands. While working in slave mode, HC-05 cannot initiate a connection to another Bluetooth device but can accept connections. Whereas in Master mode, it initiates a connection to other devices.

This serial port Bluetooth module features fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with a complete 2.4GHz radio transceiver and baseband. Moreover, It supports CSR Bluecore 04‐External single-chip Bluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping Feature). The HC-05 is a 6-pin wireless serial communication device that is capable to add two-way (full-duplex) wireless functionality to our projects.

Features of HC-05 Module 

  • Bluetooth serial port Profile
  • Bluetooth protocol: Bluetooth Specification v2.0+EDR
  • Frequency: 2.4GHz ISM band
  • Operating Voltage: 4V to 6V (Typically +5V)
  • Operating Current: 30mA
  • Modulation: GFSK(Gaussian Frequency Shift Keying)
  • Emission power: ≤4dBm, Class 2
  • Sensitivity: ≤-84dBm at 0.1% BER
  • Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
  • Working temperature: -20 ~ +75Centigrade
  • Serial Bluetooth module for Arduino and other microcontrollers
  • Range: <100m
  • Works with Serial communication (USART) and TTL compatible
  • Follows IEEE 802.15.1 standardized protocol

L293D MOTOR DRIVER

L293D Motor Driver is one of the most commonly used motor driver ICs in the electronics system. L293D motor driver is defined as a 16-pin, monolithic integrated, high-power driver for driving a DC motor. These are designed as dual H bridge motor drivers capable of driving a pair of DC motors or a single stepper motor. It uses the popular L293 motor driver IC. Hence, It can drive 4 DC motors on and off, or drive 2 DC motors with direction and speed control independently. The H-bridge is the most basic circuit for controlling a motor with a low current rating. It can drive up to two motors independently, making it perfect for developing two-wheel robot platforms.

L293D is the optimum choice for motors with an operating voltage of less than 36V and an operational current of less than 600mA that will be controlled by digital circuits like Op-Amps, 555 timers, digital gates, or even Micron rollers such as Arduino, PIC, ARM, and others. It has a total DC current of up to 600mA and can drive motors up to 12V.

Features of the L293D Motor Driver Module:

  • Wide Supply-Voltage Range: 4.5 V to 36 V
  • Separate Input-Logic Supply
  • Internal ESD Protection
  • High-Noise-Immunity Inputs
  • Output Current 600 mA Per Channel
  • Peak Output Current 1.2 A Per Channel
  • Output Clamp Diodes for Inductive Transient Suppression
  • Operation Temperature 0°C to 70°C.
  • Automatic thermal shutdown is available
  • Available in 16 pin DIP, TSSOP, SOIC package

Circuit Diagram & Connections

The Arduino UNO Board, HC-05/HC-06 Bluetooth Module, L293D Motor Driver IC, a pair of 200 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. The Bluetooth Module is powered by a 5V supply. 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 GND pins on the L293D IC are 2, 5, 12, and 13, while the 5V pins are 9, 1, and 16. However, 9V is delivered directly to pin 8 of the L293D.

The Android App

The Android App’s screenshot is shown below. The transmitter end is an Android smartphone with an app. MIT App Inventor was used to create the Android speech-recognition app utilized here.

Android App Voice Controlled Robot

To begin, Bluetooth HC-05/HC-06 devices must be paired. After pairing is complete, the device must be attached. The phone microphone detects the user’s voice commands when the app is running on the smartphone.

Download the Android App from here: Download

The program processes command and performs speech-to-text conversion utilizing Google’s speech-recognition technology. The text is then delivered through Bluetooth to the receiver.

Working of the Project

Voice commands are processed by the phone, and speech-to-text conversion is performed within the app using Google’s speech-recognition engine. The text is then delivered through Bluetooth to the receiver. The UART serial communication protocol is used to send text received over Bluetooth to the Arduino Uno device. The text received is checked by the Arduino code. When the text contains a matching string, Arduino controls the robot’s forward, backward, Turning Right, Turning Left, and Stop motions.

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

Working of Voice Controlled Robot

Source Code/Program

The Arduino Voice Controlled Robot source code/program is provided below. Copy and paste this code onto the Arduino board.

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() &gt; 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 == “left”)
{
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 == “right”)
{
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 that you understood how to design Wireless Voice Controlled Robot Car using Arduino. We MATHA ELECTRONICS will be back soon with more informative blogs soon.

Leave a Reply

Your email address will not be published.