Things used in this project

Hardware components:
Siren
×1
Belkin Wemo Switch
×1
Photon new
Particle Photon
×1
Keyes Mini Magnetic Sensor
×1
Magnet
×1
11026 02
Jumper wires (generic)
×1
Software apps and online services:
Meshblu
Octoblu Meshblu
Particle Build Platform

Custom parts and enclosures

Photon Case Body
Use a 3D printer to create this case for your Photon
Photon Case Cap
Use a 3D printer to create this cap for your Photon Case
Magnetic Sensor Case Body
Use a 3D printer to create this case for your magnetic sensor
Magnetic Sensor Case Cap
Use a 3D printer to create this cap for your magnetic sensor case

Schematics

Photon Magnetic Sensor
This is how to wire the magnetic sensor to the Particle Photon, which should be mounted on the door, along with a magnet.
S5n7aefhgwym7nn1prr5

Code

Particle Photon FirmwareC/C++
This code should be pasted into build.particle.io
int led = D7;
int sensor = D6;
int magnet;
int lastRead;

void setup() {
    pinMode(led, OUTPUT);
    pinMode(sensor, INPUT);

    magnet = digitalRead(sensor);
    lastRead = magnet;
}

void loop() {
    magnet = digitalRead(sensor);
    
    if(magnet != lastRead) {
        if(magnet == 0) {
            digitalWrite(led, HIGH);
        }
        if(magnet == 1) {
            digitalWrite(led, LOW);
        }
        
        lastRead = magnet;
        Particle.publish("magnet_change", String(magnet));
    }
}

Credits

Wxacry4kenyxmamzqxsq
Andrew Steinheiser

ASU 2017 Computer Science | Engineering Intern at Octoblu

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Control Adafruit NeoPixels using Python and JQWidgets
Easy
  • 932
  • 8

Full instructions

In this tutorial, we'll see how to control an Adafruit NeoPixel ring via mobile using Python and JQWidgets.

What's My I2C Address?
Easy
  • 244
  • 4

The story of how to make a clock through using a LCD 1602 or LCD 2004 over I2C.

I Keep My Cucumber Growing Conditions Moist - Part 3
Easy
  • 266
  • 3

Full instructions

This is the next step with an Particle Photon and softAP integration: cucumbers go online.

MyHumidity Controlled by BME280 and Photon
Easy
  • 521
  • 6

Full instructions

Checks if humidity threshold is reached and informs the user by using Blynk/IFTTT-services with softAP integration.

Study Buddy
Easy
  • 2,848
  • 141

Full instructions

Know when an assignment is coming up!

Study Buddy

Team Alexa and Shannon

MyLCD20x4 clock with value-added information
Easy
  • 40
  • 0

Full instructions

Use a Particle Photon, a BME280 sensor and a cheap LCD20x4 to start your own clock-project.

Add projectSign up / Login