Control Devices by Voice Command Using Android and Arduino
by Magesh Jayakumar in Circuits > Arduino
26221 Views, 40 Favorites, 0 Comments
Control Devices by Voice Command Using Android and Arduino
This ible will serve questions like, How to control devices by voice commands , speech recognition available in android.
All the android devices comes with the inbuilt speech recognition. This can be used to convert speech to text, by calling bluetooth function these text can be sent to device in this case the text were transferred to an arduino. The app can made with ease in MIT app inventor Without any experience in programming.
How to Create Voice to Text App
follow the video to know how to create an android app . using MIT app inventor
Lets Control Some Electrical Devices
Connect any of your electrical appliances to an arduino with the help of relay.
Arduino Program.
#include
SoftwareSerial BT(10, 11); //TX, RX respetively
String device;
void setup() {
BT.begin(9600);
Serial.begin(9600);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, 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
device += c; //build the string. }
if (device.length() > 0) {
Serial.println(device);
if(device == "light on") {
digitalWrite(3, HIGH); }
else if(device == "light off") {
digitalWrite(3, LOW); }
else if (device == "tv on") {
digitalWrite (4,HIGH); }
else if ( device == "tv off") {
digitalWrite (4, LOW); }
else if (device == "fab on") {
digitalWrite (5, HIGH); }
else if (device == "fan off") {
digitalWrite (5, LOW);}
device="";}} //Reset the variable
______________________________________________________________________________________________
I've used voice commands like "light on" "light off", "tv on" "tv off"', instead of these command we can change the commands to our wish and execute the program.
How the Electrical Devices Works by This App.
Lets Control a Robot From This App
check out this ible to know circuit diagram for the robot. https://www.instructables.com/id/How-to-make-a-voice-control-direction-control-remo/