Sagar pawar
Published

Voice-Controlled Pick-and-Place Robot

Use voice to make it go forward, back, left and right. The arm can move up, down, left, right. Also, the height of the arm can be altered.

IntermediateProtip6,164
Voice-Controlled Pick-and-Place Robot

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×3
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
owi robotic arm edge
×1
Dual H-Bridge motor drivers L293D
Texas Instruments Dual H-Bridge motor drivers L293D
×5
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×3
Jumper wires (generic)
Jumper wires (generic)
male to male = 100 male to female= 40 female to female = 15
×155
DC motor (generic)
12V, 200 rpm
×6
AA Batteries
AA Batteries
I combined 8 AA cell to make a battery of 12V. It is light in weight as compared to a single 12V battery.
×24
Chassi fan
Optional
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

DRILL MACHINE
Screw drivers, wrench, soldering rod

Story

Read more

Schematics

Bluetooth control

The circuit shows how to connect an Arduino with HC-05, an L293d microcontroller and DC motors.

Code

VOICE CONTROLLED ROBOTIC ARM USING ARDUINO

C/C++
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;
char a,b;
int i;
void setup() 
{
 BT.begin(9600);
 Serial.begin(9600);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);

  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);

  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(12, 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 == "rotate anticlockwise")
 {
  for(i=0;i<=20;i++)
  {
    digitalWrite (A0,HIGH);
    digitalWrite (A1,LOW);
    digitalWrite (A2,LOW);
    digitalWrite (A3,LOW);
    delay (100);
  }
  goto a;
 }
  else if ( readvoice == "rotate clockwise")
 {
  for(i=0;i<=20;i++)
  {digitalWrite (A0, LOW);
  
 digitalWrite (A1, LOW);
   digitalWrite (A2, HIGH);
   digitalWrite (A3, LOW);
   delay (100);
 }
 goto a;
 }
  else if (readvoice == "light on")
 {
   digitalWrite (A0, LOW);
   digitalWrite (A1, HIGH);
   digitalWrite (A2, LOW);
   digitalWrite (A3, LOW);
   delay (100);
 }
 else if (readvoice == "light off")
 {
   digitalWrite (A0, LOW);
   digitalWrite (A1, LOW);
   digitalWrite (A2, LOW);
   digitalWrite (A3, LOW);
   delay (100);
 }
 else if (readvoice == "open")
 {
  for(i=0;i<=5;i++){
    
digitalWrite (3,HIGH);
    digitalWrite (4,LOW);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
 }
 goto a;
 }
 else if ( readvoice == "close")
 {
   for(i=0;i<=5;i++)
   {
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, HIGH);
   digitalWrite (6, LOW);
   delay (100);
 }
 goto a;
 }
 else if (readvoice == "joint up")//wrist up
 {
  for(i=0;i<=15;i++) {
    digitalWrite (3,LOW);
    digitalWrite (4,HIGH);
    digitalWrite (5,LOW);
    
digitalWrite (6,LOW);
    delay(100);
  }
    
    goto a;
 }
    else if ( readvoice == "joint down")//wrist down
 {
   for(i=0;i<=15;i++)
  {
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, HIGH);
   delay (100);
 }
 goto a;
 }
  else if (readvoice == "shoulder up")
 {
    for(i=0;i<=20;i++) {
    digitalWrite (7,HIGH);
    digitalWrite (8,LOW);
    digitalWrite (9,LOW);
    digitalWrite (12,LOW);
    delay (100);
 
}
 goto a;
 }
  else if (readvoice == "shoulder down")
 {
   for(i=0;i<=20;i++)
   {
   digitalWrite (7, LOW);
   digitalWrite (8, LOW);
   digitalWrite (9, HIGH);
   digitalWrite (12, LOW);
   delay (100);  
 }
 goto a;
 }
 else if (readvoice == "elbow up")
 {
   for(i=0;i<=20;i++)
   {
   digitalWrite (7, LOW);
   digitalWrite (8, HIGH);
   digitalWrite (9, LOW);
   digitalWrite (12, LOW);
   delay (100);
 }
 goto a;}

 else if (readvoice == "elbow down") {
   for(i=0;i<=20;i++)   {
   digitalWrite (7, LOW);
   digitalWrite (8, LOW);
   digitalWrite (9, LOW);
   digitalWrite (12, HIGH);
   delay (100); }
 goto a;}
 else if (readvoice == "terminate"){
 a:
   digitalWrite (A0, LOW);
   digitalWrite (A1, LOW);
   digitalWrite (A2, LOW);
   digitalWrite (A3, LOW);
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   digitalWrite (7, LOW);
   digitalWrite (8, LOW);
   digitalWrite (9, LOW);
   digitalWrite (12, LOW);
   delay (100);
 }
 readvoice="";}} //Reset the variable

VOICE CONTROLLED CHASSI

C/C++
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;
char a;
int i;
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") 
 {
   for(i=0;i<=40;i++)
    { digitalWrite(3, HIGH);
    digitalWrite (4, HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    delay(100);
  
} 
  goto a;
  }
  
  else if(readvoice == "back") 
  {
  
   for(i=0;i<=40;i++)
  {
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    digitalWrite(6,HIGH);
    delay(100);
  }
  goto a;
  }
  
  else if (readvoice == "right")
  {
    for(i=0;i<=20;i++)
   {digitalWrite (3,HIGH);
    digitalWrite (4,LOW);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
   
}
   goto a;
  }
  
 else if ( readvoice == "left")
 {
  for(i=0;i<=20;i++)
  {
   digitalWrite (3, LOW);
   digitalWrite (4, HIGH);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }
 goto a;
}
 else if (readvoice == "terminate") 
{
  a:
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
}
 readvoice="";}} //Reset the variable

VOICE CONTROLLED FRAME

C/C++
The arm is mounted on a wooden frame which can be moved up and down by giving voice commands.
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;
char a;
int i;
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 == "frame up"){
for(i=0;i<=25;i++)
    {
    digitalWrite (3,HIGH);
    digitalWrite (4,HIGH);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
    }
    goto a;
  }
   else if ( readvoice == "frame down") {
  for(i=0;i<=25;i++){
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, HIGH);
   digitalWrite (6, HIGH);
   delay (100);}
 goto a; }
 else if (readvoice == "terminate"){
 a:
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100); }
 readvoice="";} //Reset the variable

Credits

Sagar pawar

Sagar pawar

1 project • 4 followers
Thanks to .

Comments