Voice Controlled Car


A robot which can be controlled using specific voice commands. Speech to Text functionality is used to convert voice commands to text which are then sent to Arduino through Bluetooth communication.

Voice commands have become a primary way to interact with devices after the development of devices like Alexa and Google Home. Through this project, control of the robots becomes handy.

The voice commands are perceived using an android application which converts speech to text. This text is in the form of a string. It is then sent to Arduino via the Bluetooth module. We accept character by character from the serial buffer sent by the app and combine them to form a string. Then the code compares it to the command. If it matches, the command is carried out. For example, if the string we received is "right", the bot turns right.

Components :

  • Arduino Uno
  • L293D(Motor Driver)
  • Motors x 2
  • LM 7805 Voltage Regulator
  • IR Sensors x 2
  • Bread Board
  • Chassis(of appropriate size)
  • Jumper Wires
  • Battery (Power Source)
  • Bluetooth Module HC-05
You can find the app here

Connections :

The motor connections are here
Bluetooth module connections:

Code:

  
int motor_input1=11;
int motor_input2=10;
int motor_input3=5;
int motor_input4=6;
String voice;
void setup() 
{
  Serial.begin(9600);
  pinMode(motor_input1, OUTPUT);   //RIGHT MOTOR
  pinMode(motor_input2, OUTPUT);   //RIGHT MOTOR
  pinMode(motor_input3, OUTPUT);   //LEFT MOTOR
  pinMode(motor_input4, OUTPUT);   //LEFT MOTOR
}
void loop() 
{  
  while(Serial.available()>0)
  {
    delay(10);
    char c=Serial.read();
    if(c=='#')
    {
      break;
    }
    voice+=c;
    }
   if(voice=="forward"){
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, HIGH);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, HIGH);
     delay(5000);
    }
  else
    if(voice=="back"){
    digitalWrite(motor_input1, HIGH);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, HIGH);
    digitalWrite(motor_input4, LOW);  
    delay(5000);}
  else
   if(voice=="left"){
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, HIGH);
    digitalWrite(motor_input3, HIGH);
    digitalWrite(motor_input4, LOW);
    delay(800); 
    }
  else
   if(voice=="right"){
    digitalWrite(motor_input1, HIGH);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, HIGH);
    delay(800);   }
   if(voice.length()>0)
    {
      Serial.println(voice);
       voice="";
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, LOW);
    }
   }
  

Comments

  1. can u share all the connections you've done on breadboard

    ReplyDelete
  2. Check them here : https://yainnoware.blogspot.com/p/motor-conncetions.html

    ReplyDelete
  3. Sorry,But i dont have one. Please look at the image provided, I hope thats enough !

    ReplyDelete
  4. I uploaded the code successfully and send the voice command.But the robot is not moving.

    ReplyDelete
    Replies
    1. Can you check the connections once using a multi meter ? Or send a photo at yugajmera@gmail.com

      Delete
  5. Bro my project is not running plzz help me it's urgent if possible can u give me ur insta id or whatsaap no. ??

    ReplyDelete
    Replies
    1. insta id :"yug_ajmera". Its already there on the top-right of this page !

      Delete
  6. Hi
    I need your help
    Can you send me whatsap number?

    ReplyDelete
  7. SIR PLEASE TELL THE NAME OF THE APP

    ReplyDelete
  8. This is such an interesting concept! Voice-controlled cars could really revolutionize the way we interact with our vehicles. The potential for improving safety and convenience is huge. It’s exciting to think about what the future holds for automotive technology. By the way, if anyone in Adelaide is looking to sell their car, Top Cash for Cars Adelaide Services is a great option to get fast cash with minimal hassle. Keep up the great work on your blog, looking forward to more insightful posts!

    ReplyDelete

Post a Comment

Popular posts from this blog

The move_base ROS node

Three Wheeled Omnidirectional Robot : Motion Analysis

Overview of ATmega328P