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

Whats My I2C Address?
Easy
  • 32
  • 1

Protip

The story of how a Brix will be a clock by using an LCD 1602 or LCD 2004 over I2C.

MyHumidity Controlled by BME280 and Photon
Easy
  • 104
  • 2

Full instructions

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

Tweeting Particle Photon
Easy
  • 16
  • 1

Full instructions

Tweet your friends with only the press of a button!

MyLight-Clock with NeoPixel Ring 12 Controlled by Photon
Easy
  • 244
  • 2

Full instructions

Read the time at night? Without glasses? Impossible? Focus on 2 light points, which will tell you the hour and the minute.

Map Your Particles!
Easy
  • 1,323
  • 20

Protip

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

BME280 measures and displays on OLED controlled by Photon
Easy
  • 320
  • 2

Protip

I share my first steps with the sensor BME280 (temp / humi / pressure / altitude) and an OLED 128 * 64 px

Add projectSign up / Login