Things used in this project

Hardware components:
Photon new
Particle Photon
×2
Adc121c021 pizo 1
ControlEverything.com Piezo Sensor
×1
11026 02
Jumper wires (generic)
×5
12002 04
Breadboard (generic)
×2
aluminum foil
×2
Software apps and online services:
Q8wtlimqnp04fzhtr9v5
IFTTT Maker service
Microsoft Excel

Schematics

A piezo buzzer receives a signal from the photon when the switch sensor is disconnected.
Screen shot 2017 04 12 at 7 57 51 pm zr9roety9c
Switch
The switch seen here is representative of the aluminum foil, two wires and adhesive strips that were used instead.
Screen shot 2017 04 12 at 7 58 14 pm rc1yiyz5h8

Code

Switch CodeC/C++
int PIRSensor = D1;
//int state=0;
void setup(){
pinMode(D7,OUTPUT);
pinMode(PIRSensor,INPUT_PULLUP);
}

void loop() {
    
  if (digitalRead(PIRSensor) == HIGH)
  {
       digitalWrite(D7,1);
       Particle.publish("pesky_thief","caught");
       //state = !state;
       delay(900);
       digitalWrite(D7,0);
  }
    delay (500);
}
Buzzer CodeC/C++
int buzz = D0;
int state = 0;
int led = D7 ;
void setup()
{
    pinMode(buzz,OUTPUT);
    digitalWrite(buzz,LOW);
    
    Particle.subscribe("pesky_thief",peach,"2f002e000a47333439313830");
}
void peach (const char *event, const char *data)
{
    
    if (strcmp(data,"caught")==0)
    {
        digitalWrite(buzz,HIGH);
    delay(100);
    digitalWrite(buzz,LOW);
    }
} 
void loop()
    {
        
    }

Credits

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

E-Paper Weather Display with Photon and IFTTT
Easy
  • 3,808
  • 18

Full instructions

Create a beautiful medium for weather information using Particle's cloud services and IFTTT.

2-Way Particle Photon Communication
Easy
  • 188
  • 4

Make two Particle Photons "talk" via the usage of webhooks!

IFTTT - Enabled Sensors with Particle Photon
Easy
  • 722
  • 12

Full instructions

Connect any sensor to Particle Photon and use it to trigger an IFTTT action with just a few lines of code.

WiFi Strength Meter
Easy
  • 410
  • 5

A meter that indicates the Wi-Fi signal strength in an intuitive way, using the parts I had on hand.

Light Detecting Email Sender
Easy
  • 227
  • 4

Full instructions

Receive an email about when the light is too strong on your device; nobody wants a heated device left directly under the sun. Photon + IFTTT

Mobile Vote Box
Easy
  • 772
  • 6

Full instructions

Ever wonder what others are thinking about a particular question? This machine will ask it for you and stores results in the cloud.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog