Fahad AlhilalAhmad Alquraini
Published © GPL3+

Opening Garage and Night Stand by smartphone

The purpose of creating this project is to open your garage and turning on the light of the night stand directly after closing the garage

IntermediateFull instructions provided2 hours658
Opening Garage and Night Stand by smartphone

Things used in this project

Story

Read more

Schematics

Circuit for the Garage

The Circuit for the Light

IFTTT Applets ( Data and SMS Masseges)

IFTTT Applets have been used for this project for collecting the data and for modifying the user when the garage and the night stand turn on.

The Garage Operation Data

This graph illustrate the operation data from google sheet. The data is collected on the day of testing the garage.

Code

Garage

C/C++
int garage = D3;
int val = 0;
void setup(){
  pinMode(garage, OUTPUT);     
  Serial.begin( 9600 );
Particle.function("fahad123",toggle);
}
 int toggle(String command){
  if (command=="on") {
        digitalWrite(garage,HIGH);
        delay(1000);
        digitalWrite(garage,LOW);
        Particle.publish("thegarageisopen","OPEN");
        return 0; }

  else {
      return -1;}
  }

Night Stand

C/C++
int Night_stand = D3; 

void setup() {
     pinMode(Night_stand,OUTPUT); 
    Particle.subscribe("fahad123",G1);
}

void loop (){}
 
void G1(const char *event, const char *data){
    { 
        delay(1000);
        digitalWrite(Night_stand,HIGH);
      delay(1000);
      digitalWrite(Night_stand,LOW);
      }
  }

Credits

Fahad Alhilal

Fahad Alhilal

1 project • 0 followers
Ahmad Alquraini

Ahmad Alquraini

1 project • 0 followers

Comments