Hardware components | ||||||
| × | 3 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 5 | ||||
| × | 3 | ||||
| × | 155 | ||||
| × | 6 | ||||
| × | 24 | ||||
| × | 2 | ||||
Software apps and online services | ||||||
| ||||||
Hand tools and fabrication machines | ||||||
| ||||||
|
It's my college mini-project. I learned about Arduino last year and wanted to learn more about it. We have to make a mini-project in our 3rd year so I decided to build something using Arduino and I came up with this idea.
I searched the internet for pick-and-place robots using Arduino but ended up with nothing. Finally, I gathered info from various sources and projects and used it to build my “voice-controlled pick-and-place robot.”
Steps to be takenHow it works is very easy to understand.
1. Connect the HC-05 Bluetooth module with your smartphone.
2. Give a command using the app through your smartphone.
3. After receiving the command, HC-05 Bluetooth will pass it to the Arduino.
4. Based on the command, Arduino will command the required L293D microcontroller which will further actuate the wheel, frame or arm.
#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
#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++#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
Comments