SALES INQUIRIES: 1 (888) 767-9864

Tiny Arduino GPS Car Tracker with SD Card :: James Bond Wanna Be

Isn’t it hard to finish watching a spy movie and not want to do something…spy-like?  You know, like having 40 video cameras in your house, dancing the tango with some ambassador, or jumping off a helicopter onto a wild cheetah?

Well, what about secretly logging the GPS coordinates of a car on an SD card?

Here is the basic concept – you build a tiny Arduino GPS data logger and put it in a magnetic key case. Then, attach the key case to the vehicle you want to track. When the car returns, you pull off the GPS tracker, upload the secret data to your computer, then map the data using the free Google Earth software.

This turns out to be really easy to do.  We can use existing code that was originally featured in MAKE magazine for building a cat tracker.  Track cats or be slick – your choice!

In this video, we will walk step by step through building this GPS data logger.

Want to step-up your Arduino skills?

Click here to join our 12-part HD Video Course.

 

Your Guide to Creating a Tiny Arduino GPS Data Logger

I wanted to keep my tracker discreet, so it needed to be small.  For this project, I chose to use the TinyDuino platform.  For all intents and purposes, it operates basically the same as an Arduino UNO, it’s just a whole lot smaller.

You Will Need:

This sounds like a lot of stuff – but really it’s not!  Essentially, it’s a processor board and two shields with a battery and a case.

Tools You Need:

You will also need to solder for this project, so you will need:

  • Soldering Iron
  • Solder

Code:

Click Here to download the Code

Step One: Solder the External Power Connection

The first thing, we will need to do is solder up a power connection on the TinyDuino.

The TinyDuino can run on a coin cell battery, but since we are using the GPS shield, the GPS module requires more power than the coin cell battery can provide.

Power.solder_op

Take a female JST connector and solder on the positive (red) wire to the positive terminal of the TinyDuino Processor.  Then, take the negative (black) wire, and solder that onto the ground (labeled GND).

They have two versions of the TinyDuino – one with a coin cell battery holder and one without.  The one I used had the coin cell holder, but I think it would be easier to solder, if it wasn’t there.  You will want to solder the wires to the back side of the board.

TinyDuino.poer arrows

Step Two: Build the Stack

Once we have the external power connection setup, let’s go ahead and build the “Stack” we will use for this project.

Connect the TinySheild GPS on top of the TinyDuino processor board. On top of that, connect the TinySheild SD Card writer/reader.  Insert your microUSB card into the SD card shield. Finally, attach the TinyShield USB adapter.

That’s it for the stack for now. In a moment, we will remove the the USB shield, but first let’s keep it attached as we load the Arduino code.

Step 3: Load the Code

To load the code on the TinyDuino, attach a micro USB cable from the TinyShield USB to your computer.

Open up the Arduino IDE.

Under Tools > Board, make sure to select Arduino Pro or Pro Mini (3.3V 8 MHz) w/ ATmege 328

Under Tools > Serial Port  and select the correct Serial Port.  For a PC it is likely COMM 4 or 3.  On a Mac, it will start with tty.

Now go to File > Open and navigate to where you loaded the sketch.  Depending on where you saved the file, you will probably get a message that the sketch was put into a subfolder – this is normal.

Click upload – you will see some LEDs flicker on your tinyDuino. It should take about 20-40 seconds for everything to load. You will see “done uploading” in the Arduino IDE.

Check to see that the Green indicator light on the TinyDuino is blinking about once every second, this tells us that the TinyDuino is writing to the SD card (not necessarily that you are getting a GPS signal).

Go ahead and detach the TinyShield USB connector. Attach the lithium battery to the processor board.

Now, place everything in your case.

My Tiny Arduino GPS care tracker

Step 4: Test Placement and View the Data

I highly recommend doing a test run, before you start doing your real-deal tracking.  Since the tinyGPS shield is so small, it’s antenna can be a bit weak – the bottom line is, it needs to be outside to collect data – and preferably pointing toward the sky.

Once you have collected some outdoor data, let’s take a look at the data. This is the fun part!

Take out the microSD card and insert into your microSD card reader.  When the SD card opens on your computer, you will see a file named gps.txt.

In order for us to read this file using Google Earth, you will need to change it to a different file extension, called nmea – this stands for National Marine Electronics Association – it is the standard file type for organizing GPS data.

To do this on a Mac, right click and select “get info”. Then go to file name, and change it from .txt to .nmea.  You will get a warning about changing the extension, so choose to change the extension.

On a PC, you will simply right click and rename the file extension to .nmea – that’s it!

Before we get started looking at the data, we are going to need a program to display the information.  I used Google Earth – it’s free and easy to use. You will need to download it to your computer’s hard drive.

Once it has installed, go ahead and open it up.  Now go to Tools > GPS.

Using Google Earth to upload my Tiny Arduino GPS data via the Tools > GPS menu

From the popup window, select “Import from file” and click all of the options for import and output, then click “Import”.

Using the Google Earth GPS Import pop-up menu to upload data from my tiny Arduino GPS logger

Now browse to the file gps.nmea on your sdCard and select “open”

All the routes will be imported and whalla! You can check out the individual points and the track.  That’s pretty much it – not as hard being a spy as you might think!

I would love to hear how it works for you – let me know in the comments.