Track ME




Introduction: Track ME

About: I like making things, specially if they can move.

Track ME is a "small" GPS, SD Card, and GSM Shield controlled by an Arduino Mega. Call me and get my location.

Step 1: Intro

A while back I decided to build a Car/Personal tracker.

This was my first prototype on this direction.

The system itself is very simple. Just an Arduino Mega, a GPS, a GPRS Shield and an SD Card. This last one is optional but I included because I thought in launching a challenge to my friends in Facebook, they call the system and get an SMS with my position or my last known position, in the end I would know how called me.

The system is always searching for the actual position. If someone calls the number of the SIM card, the system will send an SMS with the actual position and with a link to google maps. For example:

Hugo location is now: Lat: 54.315010, Log: 10.130997.,+10.13099...

If the GPS is not receiving any position, the system will send the last known position. For Example:

I can not seem to find Hugo. Last time that I've saw him, was in: Lat: 54.315010, Log: 10.130997.,+10.13099...

The date, time, position and SMS status and caller phone number are then stored in the SD Card.

Step 2: Components

For this project, you will need:

1x Arduino MEGA
1x GPRS Shield (It is also possible to use other GSM shields available in the market)

1x GPS (I used the NEO 6, very popular in ebay)

1x SD Card Shield

1x 9V Battery

1x Plastic

Box Some wires

Step 3: Connect All

Before assembly you will need to do the following steps.

  1. Remove the SIM pin code. Place the SIM card in phone and remove the SIM pin at the beginning of the cell phone startup.
  2. Insert SIM card in the SIM card holder in the GPRS shield. In the case of my GPRS shield, the card holder is located on the bottom of the shield.
  3. Setup the jumper to Software Serial (Optional). On my shield there are 2 jumpers that allow connections to pins 7 and 8 or pins 0 and 1. Because I want to use the normal Serial Communication port in the Arduino Mega, the jumpers need to be placed in SWserial position. When assembled I connected pins 7 and 8 to Serial Communication port 1, pins 17 and 18 in the Arduino Mega.

After performing the previous steps, place the GPRS shield in the Arduino Mega.

Then place the SD Card Shield on top of the GPRS shield.

Now connect pins 8 and 7 to pins 18 and 19 (Serial 1).

The SD Card Shield, that was designed for Arduino Uno, and uses pins 10 to 13 for SPI, so in order for this to work on Mega, they need to be "passed" to the SPI pins on MEGA.

Arduino UNO SPI pins - Arduino MEGA SPI pins

MOSI - 11 to 51

MISO - 12 to 50

SCK - 13 to 52

SS - 10 to 53

Using the prototyping area on the SD Card shield, I solder the GPS module.

Step 4: Assembly

After everything connected I placed the system inside a case.

The power from the system comes from a 9V battery connect in the DC power jack.

Step 5: Software

The library used for the GPRS Shield can be found where:

GPRS Library Download

After download, install in the correct Arduino library folder.

It is necessary to do some changes in order to use the Arduino Mega:

1) Open GSM.h in the library folder and comment/"decomment" the appropriate lines like below e.g. for Arduino Mega:

//#define UNO

#define MEGA

2) In HWSerial.h decomment the line for Mega definition e.g. for Arduino Mega:

#define MEGA

The library used for the GPRS Shield can be found where:

GPS Library Download

The program it self runs in a very simple manner. After all of the start up routines (GPRS, GPS and SD card initialization), the GPS will attempt to determine the number of satellites that he has available and a valid GPS coordinates point.

If call is placed during this period, the call will be automatically rejected and nothing will happen.

When the GPS has a valid location and is detecting more than 3 satellites (I'm assuming where that the GPS has good reception), if a call is placed, the system will send an SMS to the call number with my position.

All of these data will be stored in the SD card. If the GPS has less then 3 satellites, no valid position can be retrieved, so if a call is placed, the call number will receive an SMS with my last known position. Again all data is stored in the SD card.

The program can be found where:

Program Code Download

Step 6: Pros and Cons

Since this is a prototype, there are a lot of thing that didn't work ok. But the objective is always to improve.

First the battery only lasts for one hour!! I did not implement any energy saving mechanics in the software. So for future improvements "Sleep Mode" is a must. The size was also reviewed and I design a complete new board.

Please write me if you found any mistake or if you have any suggestion/improvement or questions.
Thanks for reading.

Hugo Gomes

P.S. If you like my tutorial, please share it and leave a me a vote :)



    • Creative Misuse Contest

      Creative Misuse Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Metalworking Contest

      Metalworking Contest

    30 Discussions


    It gives me these errors

    es\GSMSHIELD\HWSerial.cpp: In member function 'size_t HWSerial::print(const __FlashStringHelper*)':

    C:\Users\pooria\Documents\Arduino\libraries\GSMSHIELD\HWSerial.cpp:55:9: error: 'prog_char' does not name a type

    const prog_char *p = (const prog_char *)ifsh;


    In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,

    from C:\Users\pooria\Documents\Arduino\libraries\GSMSHIELD\HWSerial.h:6,

    from C:\Users\pooria\Documents\Arduino\libraries\GSMSHIELD\HWSerial.cpp:1:

    C:\Users\pooria\Documents\Arduino\libraries\GSMSHIELD\HWSerial.cpp:58:37: error: 'p' was not declared in this scope

    unsigned char c = pgm_read_byte(p++);


    exit status 1
    Error compiling for board Arduino/Genuino Mega or Mega 2560.

    Please provide a solution for me to solve this problem.

    Please reply soon.

    Thank you.


    1 year ago

    HI. what do you have inside?

    Variable p Scope is not declared....
    Please update seperate files for mega.
    And Uno
    I tried multiple times but doesn't able to find what's going wrong.

    I do not have any problem. Did you install the library's correctly? Did you change the GPRS lib from UNO to Mega?

    almost did everything ......but still faceing error.

    Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

    In file included from C:\Program Files (x86)\Arduino\libraries\GSMSHIELD/SIM900.h:5:0,

    from F:\weber\gsm\Track-ME-master\Track-ME-master\code\code.ino:2:

    C:\Program Files (x86)\Arduino\libraries\GSMSHIELD/GSM.h:195:18: error: redeclaration of 'SoftwareSerial GSM::_cell'

    SoftwareSerial _cell;


    C:\Program Files (x86)\Arduino\libraries\GSMSHIELD/GSM.h:192:12: note: previous declaration 'HWSerial GSM::_cell'

    HWSerial _cell;


    exit status 1

    Error compiling for board Arduino/Genuino Mega or Mega 2560.

    This report would have more information with

    "Show verbose output during compilation"

    option enabled in File -> Preferences.

    Did you change the GSM.h and HWSerial.h as defined in point 5 of the instructable?

    This is B.B.Das

    Thanks Hugo for your tutorial

    Is it necessary to use the Arduino MEGA? wouldn't a ONE or nano be enough? I just say it because it would reduce the size a lot.

    1 reply

    I took the Mega because of the memory. The library's that I used take a lot of space.
    Probably with some code optimisation you can fit everything in an Uno or Nano.

    It's an awesome system, I must confess.... "if someone calls the number of the SIM card, the system will send an SMS with the actual position and with a link to google maps".

    What if I want to get position or coordinates of the caller?

    Would it be possible to have a WhatsApp message sent (in stead of an SMS)? And to activate by a WhatsApp message (in stead of calling)? This would make operational costs a lot lower.

    2 replies

    obviously with whatsapp u would need to have wifi availability. with a gsm not

    I do not know how to use WhatsApp with this setup, if some other user come up with this fell free to share it where. There are some SMS internet services that can do this. I will try to update this program with some more changes and this will be one of them.

    But if costs are the problem, (at least in Germany) you can get SMS flat rate for very low fee per month. The Call action will not charge you anything because the system rejects the call automatically.

    Hi, the setup must be more or less the same, I do not know your pcb version of SIM900A but if it is 5V tolurante, you can probably connect like I connected my GPS. Please see the schematic below.


    1 year ago

    Nice, I could see using this in my car, just in case it runs away or my kid is up to no good. :) Then the battery issue might not matter, just minor adapting and wiring into the harness. Great work.