Devices & Components
Arduino Uno Rev3
DC motor (generic)
ac lamp
2N2222
HC-05 Bluetooth Module
Relay (generic)
Resistor 1k ohm
5 mm LED: Yellow
Hardware & Tools
Proteus Circuit Simulator
Software & Tools
BT_Display
Project description
Code
HomeAutoCode
arduino
CODE
1String voice; 2void setup() { 3Serial.begin(9600); 4pinMode(6, OUTPUT); 5pinMode(5, OUTPUT); 6pinMode(4, OUTPUT); 7} 8 9void loop() { 10while(Serial.available()){ 11 delay(3); 12 char c = Serial.read(); 13 voice+=c;} 14 15if(voice.length() >0){ 16 Serial.println(voice); 17 if(voice == "light on") 18 {digitalWrite(6, HIGH);} 19 else if(voice == "light off") 20 {digitalWrite(6, LOW);} 21 else if(voice == "fan on") 22 {digitalWrite(5, HIGH);} 23 else if(voice == "fan off") 24 {digitalWrite(5, LOW);} 25 else if(voice == "night lamp on") 26 {digitalWrite(4, HIGH);} 27 else if(voice == "night lamp off") 28 {digitalWrite(4, LOW);} 29 else if(voice == "all on") 30 {digitalWrite(4, HIGH); 31 digitalWrite(5, HIGH); 32 digitalWrite(6, HIGH);} 33 else if(voice == "all off") 34 {digitalWrite(4, LOW); 35 digitalWrite(5, LOW); 36 digitalWrite(6, LOW);} 37 voice = "";} 38} 39
Downloadable files
HomeAutoCircuit
proteus file
HomeAutoCircuit
HomeAutoCircuit
Circuit Diagram
HomeAutoCircuit
HomeAutoCircuit
Circuit Diagram
HomeAutoCircuit
HomeAutoCircuit
Circuit Diagram
HomeAutoCircuit
Comments
Only logged in users can leave comments