Introduction: Theft Protector Using Tilt Sensor

These days theft has become a serious crime. People are now much more conscious towards there precious items are purses and jewellery but due to the busy routine of this life we are not able to take care of our things. That constant detraction of threat is a great problem. But don't worry, I am here to save your object from threats and from various treachery.This project will help you to locate you valuable items and thing when they are stolen. It will send you the gps location of your items through SMS. When this project tracks any activity in the item or thing inside which it is kept, it sends an SMS to the mobile number registered to it. I made this project after my backpack was stole and didn't want my other items to be taken away by thieves. You can place it in the jewellery compartment of your Almira to save your jewellery. I think this project will surely help you in your daily life.

Step 1: Collect Part

You don't need a lot of things for this project. The only extra part you need to order is a mercury tilt module. Rest are the basic parts which I think you have and some parts already comes with Linkit one. Here is the list:

  • Linkit one
  • Battery for linkit one
  • GSM antenna
  • GPS antenna
  • Mercury tilt switch
  • Jump cables(I advise you to female to male)
  • A box or container
  • Soldering iron
  • A USB cable
  • A SIM card

Step 2: Connect the Battery

This is the first and the most basic step. Your linkit one board already comes with a 3.7V 1050mah li-ion battery. Just pick up that battery and insert the plug of the battery into the plug present on your linkit one board in left side. It will go inside only one way. To check your battery status go in examples folder of your arduino ide and upload battery status code to your board.

Step 3: Connecting the Antennas

When any motion in your package or the object in which this project would be kept is detected, a SMS notification will be send to the registered mobile number telling that their is some motion detected in this package and the GPS co-ordinates of your package would be send on your number. You don't need a external GPS or GSM shield for this project as Linkit one already have those two modules. To make these modules work more efficiently, you need to connected the specific antenna to that specific port. The antenna are also included in the linkit one package. Just take out the gps antenna(a square shaped antenna)and GSM antenna(rectangular shaped antenna,big one). Connect them to their specific port. The name of every port is written under it. Now are are ready with your antennas.

Step 4: Inserting the SIM Card

When their is any activity sensed in you package or thing a SMS notification is sent to the registered mobile number that any activity is sensed in your package and you will get its GPS co-ordinates of it. To send this notification you would be needing a network provider like a SIM card.Make sure that the SIM card you have is a full sized SIM card. Other sim card does not work in linkit one. I advise you not to use SIM card converter. Insert you SIM card in the SIM card slot of your board and make sure that the SIM card is inserted properly and in the right way. You SIM card should not be pin locked.

Step 5: Connect the Tilt Switch

The tilt switch I am using in this project is a mercury switch tilt sensor. Their is a bulb like structure attached to the PCB in which mercury is filled. Inside the bulb are present two small metal rods and a drop of mercury. Mercury being liquid at room temperature (moves inside the bulb because it is a liquid) and a metal (so it conducts electricity) short both the rods when the module is tilted. By this mercury we are able to sense the tilt. Connect the vcc of the module to linkit one 5V, gnd to gnd and Vout to digital pin 8.

Step 6: Selecting an Enclouser

You would be needing an enclouser or box of adequate size in which you can keep your various things like linit one board, battery, tilt sensor. Choose a box in which all your things fit easily. To choose a box which is very big in size. Choose a box which is handy and portable. Also remember that to take a box which is too thick. This could decrease the network coverage of your SIM card. The material od the box depends on you.

Step 7: Upload the Code

Here is the code needed by you which you need to upload to your linkit one board only. Make sure that in the below code you change the number "1234567890" from your mobile number. Here is the code:

#include <LGSM.h>

#include<LGPS.h>

gpsSentenceInfoStruct info;

const char *nextToken(const char*src,

char*buf)

int i=0;

while(src[i] !=0 && src[i] !=',')

i++;

if(buf)

{

strncpy(buf,src,i);

buf[i]=0;

}

if(scr[i])

i++;

return src+1;

}

void printGPGGA(const char* str)<br>{
char latitude[20];
char longitude[20];
char buf[20];
const char* p = str;
p = nextToken(p, 0); // GGA
p = nextToken(p, 0); // Time
p = nextToken(p, latitude); // Latitude
p = nextToken(p, 0); // N
p = nextToken(p, longitude); // Longitude
p = nextToken(p, 0); // E
p = nextToken(p, buf); // fix quality
if(buf[0] == '1')
{
// GPS fix
p = nextToken(p, buf); // number of satellites
Serial.print("GPS is fixed:");
Serial.print(atoi(buf));
Serial.println(" satellite(s) found!");
Serial.print("Latitude:");
Serial.println(latitude);
Serial.print("Longitude:");
Serial.println(longitude);
LSMS.write("GPS is fixed:");
LSMS.write("Latitude:");
LSMS.write(latitude);
LSMS.write("Longitude:");
LSMS.write(longitude);
LSMS.endSMS();
}
else
{
Serial.println("GPS is not fixed yet.");
}
}
int state=0;

int sensor=8;

void setup()

{

Serial.begin(9600);<br>while(!LSMS.ready())
delay(1000);
Serial.println("SIM ready for work!");
LSMS.beginSMS("0123456789"); // replace the no. to the receiver's no.
LGPS.powerOn();
Serial.println("GPS ready for work!");

pinMode(sensor,INPUT);

}

void loop()

{

LGPS.getData(&info);
if(state==0)

{

state=1;<br>if(digitalRead(sensor)==HIGH)
{
printGPGGA((char*)info.GPGGA);
delay(5000);

}

}

else

if(digitalRead(sensor)==LOW)

{

state=0;

}

Step 8: TEST

Now you can test your project. After changing the number is the code and uploading the code to your board your project is ready. Power on the battery and after few seconds tilt you project so that tilt sensor is activated. You would receive a message telling you the gps co-ordinates of your project,

Step 9: END

This is the end of this instructable. Hope you like it and loved it too. For any query relating the project or you want to ask any question, comment below . Thank you.

Arduino All The Things! Contest

Participated in the
Arduino All The Things! Contest