Introduction: Tracking and Controlling Your Car Remotely Using Arduino and Android

Actually, many of us may suffer or afraid from being his car stolen. In this project, I will try to help you to protect your cars and even control them remotely.

Basically, you have to leave a mobile phone in your car and when the car starts to move it uses its sensors to detect that and will send to you a message on your mobile phone where ever you are. Then, you can send a message to stop the car immediately so the thief couldn't turn it on again as well you can send another message to know its location using GPS to get it from there.

All of these can be implemented so easily and requires no experience in coding. All you need is Arduino, any Android smart phone and 1Sheeld that connects the mobile and Arduino via Bluetooth and make use of its mobile app, so no need for Android coding.

Step 1: Components

1- Arduino Uno.

2- 1Sheeld.

3- Relay (12V- 40A) OR 4X Relays (10A).

4- Car Fuse

5- Android Mobile Phone.

6- Wires and Solder.

7- Battery

Step 2: Concept of Operation

Actually, I got the idea when I saw this video. By removing the fuse in the car power section that connects between the car keys and the engine, you can turn off the engine. So, I decide to put a relay at this node to control whether I want to turn off the engine or not.

But, you can be too careful, since the max. current pass throw the fuse is a around 40 A. so it is too much high. You have to get the right relay.

I couldn't find a 40A relay at any near electronics store to me, so I decided to get a relay kit (4 relays) each one can carry 10 A and use them in parallel to divide the total current on them.

Step 3: Hardware Implementation

1- I have bought a car fuse and disconnect it as shown in figure.

2- Use these 2 terminals and connect them to the relay.

3- Connect the relay board to the Arduino.

4- Place 1Sheeld on top of Arduino

Step 4: Arduino Sketch & Mobile App

If this your first time to deal with 1Sheeld, you have to download the mobile application and the Arduino library fro here. As well, it would be better to try any other code form the documentation in order to feel free with it.

Basically, the code is so simple and easy. It based on sensing the if the car moved using the Accelerometer sensor for the smart phone, and then send you a SMS if the car moved as a notification for you. when you received that SMS, you have 2 options:

Firstly, to send the "gps" as an SMS for the mobile phone in the car to get the car's position (Longitude and Latitude).

Secondly, to send "stop" as an SMS for the mobile phone in the car to stop the car by switching the relay we have placed instead of the fuse.

#include <OneSheeld.h>
char* gps = "gps";
char* stopp = "stop";
float lat ;                           
float lon ;
int lock = 12;
char charlat [12];
char charlon [12];
char readings [80];
boolean flag1 = false;
boolean flag2 = false;
boolean flag3 = false;
void setup()
{
  OneSheeld.begin();
  pinMode(lock,OUTPUT);
}
void loop() {  
  if(abs(AccelerometerSensor.getY()) > 1.5 )
  {
    if(!flag1)
    {   
      SMS.send("01004078579","The car is moving !!");
      flag1 = true;  
    }
  }
   if(!strcmp(SMS.getSms(),stopp)) 
  {
    if(!flag2)  
    {
      digitalWrite(lock,HIGH);
      flag2 = true;
    }
  }
  if(!strcmp(SMS.getSms(),gps)) 
  {
    if(!flag3)  
    {
      lat = GPS.getLatitude(); 
      lon = GPS.getLongitude(); 
      dtostrf(lat, 11, 7, charlat); 
      dtostrf(lon, 11, 7, charlon); 
      strcat(readings,"latitude is : ");   
      strcat (readings,charlat);  
      strcat(readings,"\nLongitude is : "); 
      strcat (readings,charlon);
      SMS.send("01004078579",readings);                             
      flag3 = true;
    }                                        
  } 
}

Step 5: Test

After uploading the code on the Arduino and connecting it with 1Sheeld and the fuse box in the car. All you have to do is to open the application in our mobile select the required shields as in the video (Accelerometer, GPS, SMS). Try to hide the mobile in a secret place in order not to be seen by the thief.

Step 6: Further Steps

Of course, we can add many other features as capturing an image using the camera in the mobile and send it to my mail to check the one how is driving the car, or send a video stream for the thief using Skype, or we can control the sound system in the car to play an Alarm to make the thief feel afraid ,,, etc

Unfortunately, we have always to turn on the mobile data to send image or videos through internet which will decrease the life of battery.

Yet, I think we can do it with much better trick to save power by using Tasker application. We can turn the mobile data and the GPS OFF and under certain condition from the sensors (say the Accelerometer), the mobile turn on both GPS and mobile data to use them. OR, use 1Sheeld from inside Tasker as a plugin to turn on or off them.