Voice Control Light || Using Arduino and Android App || Diyareeb
Voice Control Light || Using Arduino and Android App
Now you can give Voice Command to Arduino
using an Android App
Materials Needed:-
- Arduino Board
- HC-05 (Bluetooth Module)
- Led
- an Android Phone (for the app)
Download the App:-
Click on the link to Download the app
Codes:-
Copy the Code from here
/* * Code Created for * Voice Controlled Light * for tutorial visit * http://bit.ly/diyareebyoutube */ #include<SoftwareSerial.h> SoftwareSerial BT(10,11); // Rx | Tx //(Connect HC-05 Rx ----> 11 & Tx ------> 10) String VoiceRecv; //String for Voice Command void setup() { BT.begin(9600);//begin HC-05 Serial Communication Serial.begin(9600);//begin Serial Communication pinMode(13,OUTPUT);//Set LED pin as OUTPUT } void loop() { //Read voice command when BT Serial Communication is Avilable while (BT.available()) { delay(10); char c=BT.read();//Change Data to Commands VoiceRecv +=c; } //Command Check if(VoiceRecv.length()>0) //if Somthing Recived { Serial.println(VoiceRecv);//print Voice Command on Serial Monitor if (VoiceRecv=="lights on") //if voice command is LIGHTS ON { digitalWrite(13,HIGH); //Turn Light on } else if (VoiceRecv=="lights off") //if voice command is LIGHTS OFF { digitalWrite(13,LOW); //Turn Light off } VoiceRecv=""; //Reset to Blank } } |
Comments
Post a Comment