Project tutorial
My Motion Activated SMS sender

My Motion Activated SMS sender © LGPL

When motion is sensed, an SMS will be sent to say that motion was detected.

  • 1,913 views
  • 0 comments
  • 5 respects

Components and supplies

About this project

Steps for creating this motion-activated SMS sender:


Step 1

  • Connect your 1Sheeld to your Arduino
  • Connect the Arduino to your PC
  • Make sure the 1Sheeld's UART switch is open – otherwise the Compiler will give an error.
  • Upload this code to the Arduino:
http://codepad.org/tpikIYYI>http://codeshare.io/9Owvu
  • Edit the number “ 0123456789” to your Number SMS yourself or preffered phone

Step 2 (The LED)

  • Connect the led to pin number 13 and, with the resistor, to ground.


Step 3 (The PIR Motion sensor)

  • When you point the PIR motion sensor bubble away from you, to see the back with the 3 connector pins at the bottom, connect it like the following:

1. The left pin needs to connect to pin number 2,

2. The middle pin needs to be connected to 3.3V,

3. The right pin needs to be connected to ground on your Arduino.


Step 4 (Connecting)

  • Pair your Android device to your 1sheeld, via the 1Sheeld app, through Bluetooth
  • Select the following shields:
SMS shield, to be notified when something happens/ or motion is detected
  • Make sure that your number is typed in correctly and that the delay is more than 150ms


Step 5 (Ready to go)

  • Make sure the code is uploaded, and wait for the LED to switch off.
  • Switch the UART switch to closed, to begin communication between the 1sheeld and your phone.
  • Move infront of the motion sensor and wait for the SMS/


NOTE : MAKE SURE THAT YOUR NUMBER IS TYPED IN CORRECTLY, THE DELAY IS MORE THAN 100ms.

Code

Motion Activated SMS SenderJava
#include <OneSheeld.h> 
int ledPin = 13;                // choose the pin for the LED
int inputPin = 2;               // choose the input pin (for PIR sensor)
int PIR = LOW;    //Sets the Motion sensor to low        
int val = 0;                    
          

void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare sensor as input
   OneSheeld.begin(); 

 
}

void loop(){
  //loop starts
  
    val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, HIGH);  // turn LED ON   
    delay(150);//delays the wait for 1/15 of a second 

    
    if (PIR == LOW) { //if motion is detected
      
       SMS.send("0123456789","Motion DETECTED"); 
       //^^^^^^^^^replace 0123456789 with your number, add your own Message
       PIR = HIGH; //sets the value to high so that we avoid a infinite loop
    
    }
  } else {
      digitalWrite(ledPin, LOW); // turn LED OFF

        
      if (PIR== HIGH){ // if its HIGH set to low sothat it is checked again


      PIR = LOW;
    }
    //loop ends an restarts
  }
}

Schematics

PIR Motion sensor and 1sheeld
Untitled%20Sketch.fzz

Comments

Similar projects you might like

Motion activated SMS Shield- Tutorial

Project tutorial by Burger

  • 4,093 views
  • 2 comments
  • 5 respects

My Motion Activated Security Cam project

Project tutorial by Christiaan Neil Burger

  • 9,231 views
  • 9 comments
  • 12 respects

SMS your Home

Project tutorial by Mohamed Hassan AbdulRahman and Abdulrahman Elsharqawy

  • 5,642 views
  • 0 comments
  • 14 respects

4x4x4 LED cube with Arduino Uno and 1sheeld

Project tutorial by Hassan Ibrahim

  • 29,724 views
  • 6 comments
  • 60 respects

Track and Control Your Car Remotely

Project tutorial by Ashraf Nabil

  • 25,406 views
  • 5 comments
  • 58 respects

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

Project tutorial by ahmed ismail

  • 1,565 views
  • 0 comments
  • 8 respects
Add projectSign up / Login