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

Map Your Particles!
Easy
  • 499
  • 15

Protip

Locate your Particle Photons, P1s and Electrons on a map without needing extra hardware. Use Ubidots or an offline map alternative

Sending Photos and Video Over the Internet!
Easy
  • 1,964
  • 27

Full instructions

Record video, perform object and face recognition, take a time-lapse or whatever else with a Particle Photon and the 5-megapixel Arducam!

Text Machine, Get Gumball
Easy
  • 59
  • 1

This project describes how to build an Arduino-based, text-controlled gum dispenser

Power Supply Module 3.3V and 5V
Easy
  • 123
  • 0

Protip

First test of a separate Power Supply Module 3.3V and 5V

MyPIR-Sensor Informs Me Via IFTTT
Easy
  • 286
  • 1

Full instructions

Cheap & easy alarm-system.

Running Exercise Track
Easy
  • 83
  • 2

This is a device which can monitor running track via a GPS module and store data to a SD card. And then parse the data later from a app.

Add projectSign up / Login