ahmed ismail
Published

How can you Report Thief with a Photo on Twitter by Arduino

Secure your home and your shop from force entry where the thief photo will be reported on twitter and you will get notified with a SMS.

BeginnerFull instructions provided1 hour3,499
How can you Report Thief with a Photo on Twitter by Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
1Sheeld
1Sheeld
×1
Jumper wires (generic)
Jumper wires (generic)
×3
SparkFun piezo electric
×1
Breadboard (generic)
Breadboard (generic)
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Android device
Android device
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Use arduino to secure your store and connect it to twitter

Code

Use arduino to secure your store and connect it to twitter

Arduino
/*

   @title    : Use arduino to secure your store and connect it to twitter
   @author   : Ahmed Ismail
   @email    : ahmed.ismail3115@gmail.com
   @compiler : Arduino IDE

*/


/*
  To reduce the library compiled size and limit its memory usage, you
  can specify which shields you want to include in your sketch by
  defining CUSTOM_SETTINGS and the shields respective INCLUDE_ define.

*/

#define CUSTOM_SETTINGS
#define INCLUDE_CAMERA_SHIELD
#define INCLUDE_TWITTER_SHIELD
#define INCLUDE_BUZZER_SHIELD
#define INCLUDE_SMS_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

/* Define a boolean flag. */
boolean isMessageSent = false;

/* define the piezo electric on pin A0. */
#define piezo  A0


void setup()
{
  /* Start communication. */
  OneSheeld.begin();


}

void loop()
{

  /* put the readings of the piezo in variable named value. */
  int value = analogRead(piezo);

  /* Always check if the vibrations value is larger than a certain value. */
  if (value > 10)
  {


    if (!isMessageSent)
    {
      /* Send the SMS. */
      SMS.send("01028876652", "someone is storming your store");
      /* Set the flag. */
      isMessageSent = true;
    }

    /* Turn on the buzzer. */
    Buzzer.buzzOn();

    /* Turn on the camera flash. */
    Camera.setFlash(ON);
    /* Take the picture. */
    Camera.rearCapture();
    /* Wait for 10 seconds. */
    OneSheeld.delay(10000);
    /* Post the picture on Twitter. */
    Twitter.tweetLastPicture("Catch that thief");

  }
  else
  {
    /* Turn off the buzzer. */
    Buzzer.buzzOff();

    /* Reset the flag. */
    isMessageSent = false;
  }

}

Credits

ahmed ismail

ahmed ismail

2 projects • 107 followers
Maker

Comments