Justin WykoffJoseph PetiteSophia Aluise
Published

Home Notification System

Always stay in the know when you're on the go! Receive live updates from anywhere using our home notification system!

IntermediateShowcase (no instructions)611
Home Notification System

Things used in this project

Hardware components

Photon
Particle Photon
×3
Breadboard (generic)
Breadboard (generic)
×3
Magnetic Proximity Sensor, Sensor and Magnet
Magnetic Proximity Sensor, Sensor and Magnet
×2
Resistor 1k ohm
Resistor 1k ohm
×4
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
ESD Tape, Antistatic
ESD Tape, Antistatic
×1

Software apps and online services

Google Sheets
Google Sheets
Maker service
IFTTT Maker service
Particle Build Web IDE
Particle Build Web IDE
Fritzing

Hand tools and fabrication machines

Scissor, Electrician
Scissor, Electrician
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Magnetic Proximity Sensor Schematic

LED Schematic

Code

Door Code

C/C++
Code that notifies the user of door activity
SYSTEM_THREAD(ENABLED); 

SYSTEM_MODE(AUTOMATIC);  

int inputPin = D0;              
int light = D4;
int pirState = LOW;             
int val = 0;                    

int calibrateTime = 25000;   

void setup() {
    pinMode(light, OUTPUT);
    pinMode(inputPin, INPUT);  
    Particle.subscribe ("Door-Open", myHandler);
}

void loop() {
  if (calibrated()) {
    readTheSensor();
    reportTheData();
    }
}

void readTheSensor() {
    val = digitalRead(inputPin);
}

bool calibrated() {
    return millis() - calibrateTime > 0;
}

void reportTheData() {
    if (val == HIGH) {
        if (pirState == LOW) {
         Particle.publish("Door", "Door is Open", PUBLIC);
         delay(2000);
          pirState = HIGH;
                 }
    } else {
        if (pirState == HIGH) {
          Particle.publish("Door", "Door is Closed", PUBLIC);
          delay(2000);
          pirState = LOW;
                  }
    }
}

void myHandler(const char *event, const char *data) {
    digitalWrite (light, HIGH);
    delay(2000);
    digitalWrite (light, LOW);
}

Mailbox Code

C/C++
Code that notifies the user of mailbox activity
SYSTEM_THREAD(ENABLED); 

SYSTEM_MODE(AUTOMATIC);  

int inputPin = D0;              
int light = D4;
int pirState = LOW;             
int val = 0;                    

int calibrateTime = 25000;   

void setup() {
    pinMode(light, OUTPUT);
    pinMode(inputPin, INPUT);  
    Particle.subscribe ("New-Mail", myHandler);
}

void loop() {
  if (calibrated()) {
    readTheSensor();
    reportTheData();
    }
}

void readTheSensor() {
    val = digitalRead(inputPin);
}

bool calibrated() {
    return millis() - calibrateTime > 0;
}

void reportTheData() {
    if (val == HIGH) {
        if (pirState == LOW) {
         Particle.publish("Mailbox", "Mailbox is Open", PUBLIC);
         delay(2000);
          pirState = HIGH;
                 }
    } else {
        if (pirState == HIGH) {
          Particle.publish("Mailbox", "Mailbox is Closed", PUBLIC);
          delay(2000);
          pirState = LOW;
                  }
    }
}

void myHandler(const char *event, const char *data) {
    digitalWrite (light, HIGH);
    delay(2000);
    digitalWrite (light, LOW);
}

In-Home Notification

C/C++
Code that physically notifies the user of mailbox and or door activity through the use of an LED
int ledPin = D7;    


void setup() {
    pinMode(ledPin, OUTPUT);
    Particle.subscribe("Alert", myHandler);
}

 void myHandler(const char *event, const char *data)
 {
  Particle.publish("New-Alert", "New Alert", PRIVATE);
  digitalWrite(D7,HIGH);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);}
  
  void loop() {
      
  }

Credits

Justin Wykoff

Justin Wykoff

1 project • 0 followers
Pursuing a Bachelors of Science in Mechanical Engineering at The University of North Carolina at Charlotte.
Joseph Petite

Joseph Petite

1 project • 0 followers
Pursing a Bachelor of Science in Mechanical Engineering at The University of North Carolina at Charlotte with a Biomedical Concentration.
Sophia Aluise

Sophia Aluise

1 project • 1 follower
Pursuing a Bachelors of Science in Mechanical Engineering at The University of North Carolina at Charlotte

Comments

Add projectSign up / Login