Skip to main content

Control LED Using Your Voice Command

Control LED Using Your Voice CommandTHINGS USED IN THIS PROJECT

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
12002 04
Breadboard (generic)
×1
09590 01
LED (generic)
3 LED (Red,Green,Blue)
×1
11026 02
Jumper wires (generic)
×1
☒ Bluetooth - HC-05
×1
Software apps and online services:
Android IoTBoys

SCHEMATICS

Circuit Design
Follow the Design

code

String voice;
int RED = 2;
int GREEN = 3;
int BLUE = 4;
void RedOn(){
digitalWrite (RED, HIGH);
}
void RedOff(){
digitalWrite (RED, LOW);
}
void GreenOn(){
digitalWrite (GREEN, HIGH);
}
void GreenOff(){
digitalWrite (GREEN, LOW);
}
void BlueOn(){
digitalWrite (BLUE, HIGH);
}
void BlueOff(){
digitalWrite (BLUE, LOW);
}
void allon() {
digitalWrite (RED, HIGH);
digitalWrite (GREEN, HIGH);
digitalWrite (BLUE, HIGH);
}
void alloff() {
digitalWrite (RED, LOW);
digitalWrite (GREEN, LOW);
digitalWrite (BLUE, LOW);
}
void setup() {
Serial.begin(9600);
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
pinMode(BLUE, OUTPUT);
}
void loop() {
while(Serial.available()) {
delay(10);
char c=Serial.read();
if(c=='#')
{break; }
voice += c;
}
if (voice.length() > 0) {
Serial.println(voice);
if (voice == "on" || voice == "all")
{
allon() ;
}
else if (voice == "off" || voice=="all off")
{
alloff() ;
}
else if(voice =="red" || voice =="red on"){
RedOn();
}
else if(voice =="red off"){
RedOff();
}
else if(voice =="green" || voice =="green on"){
GreenOn();
}
else if( voice =="green off" ){
GreenOff();
}
else if(voice =="blue" || voice =="blue on"){
BlueOn();
}
else if(voice =="blue off"){
BlueOff();
}
voice="";
}
}
Controlling led using voice command  iotboys com a2wrardmf4

Comments

Popular posts from this blog

Automatic Call answering Machine using Arduino and GSM Module

Automatic Call answering Machine using Arduino and GSM module In today’s modern world we all depend on mobile phones as our primary means of wireless communication. But, we all have faced situations during which we might not be able to answer to our calls, these calls might be an important personal call or a life changing business call and you could have just missed that opportunity since you were not able to answer that call at that particular time. This project aims to solve this problem by creating an  Automatic Call answering Machine by using Arduino and GSM module . Next time when you are changing to a new phone number or out for a long pilgrimage trip or enjoying a well deserved vacation just use this machine to record your voice stating the reason for absence and all your calls will be automatically answered by this machine and your recorded voice will be played to them. This can also be used for your business numbers to answer to your customer’s calls duri...

Smart Blind Stick using Arduino

Smart Blind Stick Project using Arduino and Sensors Ever heard of Hugh Herr? He is a famous American rock climber who has shattered the limitations of his disabilities; he is a strong believer that technology could help disabled persons to live a normal life. In one of his TED talk Herr said  “ Humans are not disabled. A person can never be broken. Our built environment, our technologies, is broken and disabled. We the people need not accept our limitations, but can transfer disability through technological Innovation ” . These were not just words but he lived his life to them, today he uses Prosthetic legs and claims to live to normal life. So yes, technology can indeed neutralize human disability; with this in mind let us use the power of  Arduino and simple sensors to build a Blind man’s stick  that could perform more than just a stick for visually impaired persons. This Smart stick will have an  Ultrasonic sensor to sense distance from any obstacle, ...

AC Voltmeter using Arduino

AC Voltmeter using Arduino In this project, we are going to make an  AC Voltage Measuring Device using Arduino,  which will measure the voltage of Alternating Current Supply at our home.  We are going to print that voltage on serial monitor of Arduino IDE as well as show on the multimeter. Making a Digital Voltmeter is a lot easy than making an analog one because in case of analog voltmeter you must have good knowledge of physical parameters like torque, friction losses etc. whereas in case of digital voltmeter you can just use a LCD or LED matrix or even your laptop (as in this case) to print the voltage values for you. Here are some  Digital Voltmeter Projects : Simple Digital Voltmeter Circuit with PCB using ICL7107 LM3914 Voltmeter Circuit 0-25V Digital Voltmeter using AVR Microcontroller Required Components: One 12-0-12 transformer    1N4007 diode    1uf capacitor    Resistors 10k; 4.7k.    ...