Saturday 3 March 2018

Arduino Voice Controlled Robot


Arduino and Android Voice control Robot 

In this  touturial about How to make a voice control robot. voice controlled robot and is controlled via Bluetooth HC-05 through a smartphone applicaton. In this application is developed in such a way that it converts the voice command to text and transfer the text to the connected Bluetooth device





Required Components:
  1. Arduino Uno 
  2. Bluetooth Module
  3. L293D Motor Driver
  4. 2x Gear Motor
  5. 2x Wheel
  6. 1x Chasis
  7. A breadboard 
  8. Connecting wires


Circuit  Diagram :




Bluetooth module ----------- Arduino:
Vcc ----------- +5v
GND ----------- GND
Tx --------------- pin 10
Rx --------------- pin 11




Voice Control Bot App:

Here in this link is the app developed using MIT app inventor:




Click here to download Android app

This is a simplified version of any other voice control robot, No complex coding easy to understand coding with easy algorithm.

The app is developed in such a way that it convert the voice command to text and transfer the text to the connected Bluetooth device


Source Code:


Arduino Program for voice control robot.
_________________________________________________________________________________

#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;

void setup() {
 BT.begin(9600);
 Serial.begin(9600);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);

}
//-----------------------------------------------------------------------// 
void loop() {
  while (BT.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable
  char c = BT.read(); //Conduct a serial read
  readvoice += c; //build the string- "forward", "reverse", "left" and "right"
  } 
  if (readvoice.length() > 0) {
    Serial.println(readvoice);

  if(readvoice == "forward")
  {
    digitalWrite(3, HIGH);
    digitalWrite (4, HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    delay(100);
  }

  else if(readvoice == "reverse")
  {
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    digitalWrite(6,HIGH);
    delay(100);
  }

  else if (readvoice == "right")
  {
    digitalWrite (3,HIGH);
    digitalWrite (4,LOW);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
  
  }

 else if ( readvoice == "left")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, HIGH);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }

 else if (readvoice == "stop")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }
readvoice="";}} //Reset the variable

_________________________________________________________________________________




No comments:

Post a Comment