meet panchal
Published © GPL3+

"ok google" "open the curtains"

Home Automation project, Control your curtains with google assistant

BeginnerFull instructions provided4 hours1,661
"ok google" "open the curtains"

Things used in this project

Story

Read more

Schematics

This is the circuit diagram

This is the schematic diagram

Code

Code for opening and closing the curtains

Arduino
This is the arduino code.
void setup() 
{
    Serial.begin(9600);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
}

void loop() 
{
  if(Serial.available()>0)
  {  
    char a=Serial.read();
    Serial.println(a);
    
    if(a=='1')
    {
          digitalWrite(5,HIGH);
          digitalWrite(4,LOW);
          delay(2000);
          digitalWrite(5,LOW);
          digitalWrite(4,LOW);
    }
      
   if(a=='2')
   {
          digitalWrite(5,LOW);
          digitalWrite(4,HIGH);
          delay(2000);
          digitalWrite(5,LOW);
          digitalWrite(4,LOW);
   }
  }
}

Credits

meet panchal
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.