Priyansh SrivastavaHitesh Kukreja
Published

How to Build a Voice Controlled Robot!

The project is made using TI-RSLK. The robot is being controlled by the user's voice with the help of the Google Assistant.

IntermediateFull instructions provided2 hours1,002
How to Build a Voice Controlled Robot!

Things used in this project

Hardware components

TI Robotics System Learning Kit TI-RSLK
Texas Instruments TI Robotics System Learning Kit TI-RSLK
×1

Software apps and online services

Energia
Texas Instruments Energia
Thunkable Classic

Story

Read more

Schematics

CONNECTION BETWEEN MSP432 ,BLUETOOTH MODULE,POLULO BOARD(MOTOR DRIVER)

THE ATTACHED FILE SHOWS THE CONNECTION BETWEEN MSP432, BLUETOOTH MODULE, AND POLULO BOARD

Code

Voice Control Robot

Processing
The program is written in Energia IDE.
#include<String.h>

//Predefined commands to compare the string received from the voice control app

#define START "start"

#define FORWARD "forward"

#define BACKWARD "backward"

#define RIGHT "right"

#define LEFT "left"

#define STOP "stop"

//macro section

#define LM 40

#define RM 39

#define LD 28

#define RD 29

//global variables declaration

int k = 0;

int lmspeed = 0,speedl = 0,ldir = 0,rdir = 0;

int rmspeed = 0,speedr = 0;

char cmd[10] = {"\0"};

char precmd[9][10] = {START,STOP,FORWARD,BACKWARD,LEFT,RIGHT};

char ctl[9] = {'1','2','3','4','5','6'};

 

void setup() {

  // put your setup code here, to run once:

Serial.begin(9600);

Serial1.begin(9600);

pinMode(LD, OUTPUT);

pinMode(RD, OUTPUT);

}

 

void loop() {

    int i = 0;

// put your main code here, to run repeatedly:

    if(Serial1.available())

    Serial1.readBytes(cmd,10); 

    Serial.println(cmd);

    //To identify the command

    for(i = 0;i<9;i++ )

    {

    if((strcmp(cmd,precmd[i])) == 0)

    {

       k = i;

    break;

    }

}

//decision and parameters config part

switch(ctl[i])

{

    case '1' : lmspeed = 50;

               rmspeed = 50;

               digitalWrite(LD,0);

               digitalWrite(RD,0);

               break;

    case '2' : speedl = 0;

               speedr = 0;

               break;

    case '3' : speedl = lmspeed;

               speedr = rmspeed;

               digitalWrite(LD,0);

               digitalWrite(RD,0);

               break;

    case '4' : speedl = lmspeed;

               speedr = rmspeed;

               digitalWrite(LD,1);

               digitalWrite(RD,1);

               break;  

    case '5' : speedl = 0;

               speedr = rmspeed;

               break;

    case '6' : speedr = 0;

               speedl = lmspeed;

               break;

    default  : speedl = 0;

               speedr = 0;

               break;                    

  }       

analogWrite(LM,speedl);

analogWrite(RM,speedr);


}

Credits

Priyansh Srivastava

Priyansh Srivastava

2 projects • 8 followers
Hitesh Kukreja

Hitesh Kukreja

5 projects • 4 followers
Thanks to GLA UNIVERSITY and TEXAS INTRUMENTS.

Comments