Things used in this project

Hardware components

Software apps and online services

IFTTT Maker service

Hand tools and fabrication machines

Soldering iron (generic)

Story

Thefts are what drive me to make this GPS tracker. I myself have a cheep daily driver like most college students I own a Honda civic from the 90s. It gets the job done, but the security system is poor at best. Any idiot with a screw driver and enough determination can get in and get it started within minutes. Once that happens it is gone, on to be made in to someones E-Bay part-out job. For most people a security system would be enough, but once a thief cuts the wires on the horn your car is going to be gone. I want to catch the thief not just run him off or give him a car. That is when I thought of taking a mobile GPS tracker and set it up to track the car at all times and allow me to track the location of the my car at the push of a button.

I started with the kit from particle.io that included:

3 months of Particle's 1MB monthly data plan

Particle Electron PCB

Weatherproof Enclosure

Asset Tracker Shield PCB

Particle SIM Card

Li-Po battery (2000mAh)

USB cable

Breadboard

Once the above components arrived I wanted to get started constructing the actual asset tracker kit, but before I could do that I needed to set up the data plan that the Wireless sims card runs on. This process is completed on the particle.io website at this >>link<<.

After the setup was completed and the device was breathing cyan I attached it to the GPS tracker like shown in the figure below

####### At this point I want to bring your attention to the fact that the cellular antenna is extremely easy to brake off so I suggest putting it in the waterproof box before attaching it to the electron########

Early hang up that I though was the end of my project until i found a soldering iron.

Particle Electron mounted on Tracker Shield with battery.

After getting my hardware setup I as shown in Figure 2 below I moved over to getting an understanding of the code for the project. I used a sample code found in the particle libraries to get started. Once it was flashed onto the Electron the Tracker Shield began to search for a GPS fix. Once the Tracker Shield received a GPS fix on my window seal it began to broadcast the latitude and longitude coordinates to the dashboard on particle.io every 10 minutes (changeable in the code to save data).

Figure 2. my setup in waterproof clear box.

Now that I got to tracker functioning I needed to figure out where to store the data and how to alert me that a data value had been recorded. For this I used the IFTTT app for Apple iPhone and created an if recipe that every time a event was published on the dashboard a notification was sent to me and the data was stored in a spreadsheet on google docs. the steps for setting this up are as follows:

Start a new recipe in the IFTTT App.

Tap the "if+" button.

Scroll to and select Particle.

Tap the "New event published" button.

caption (optional)

Enter "G" for the Event Name. (the default one for mine to save data)

Leave the Event Contents blank.

Select the Electron for the Device, then tap Next.

Now tap the "then+" button to tell IFTTT what to do with the event info.

Scroll to ant tap your desired data logging option. I picked Google Drive, so that all of the GPS coordinates would be saved in a spreadsheet.

caption (optional)

Below are my before and after photos of the dashboard data and the data on the spreadsheet.

Dashboard GPS (g) notification

Spreadsheet on google drive

At this point I decided I wanted to check where car is at a a given point without waiting 10 minutes ( or maybe hours if you have the setting set for that high of a delay to save data). To do this I made a single click button on my phone to have a gps fix sent to my phone using the Do button app. This app is very similar to the IFTTT app and uses the same basic guide lines. This will allow some one to walk out of say a concert or a large event and find their cars location in a large parking lot.

This project is pretty straight forward task, but i am currently working on powering it in a car and replacing the small antenna with a larger one for the cell signal and also one to extend the gps Reach.

Schematics

the setup I am using

Code

Car tracker code

C/C++

/* -----------------------------------------------------------This example shows a lot of different features. As configured hereit'll check for a good GPS fix every 10 minutes and publish that dataif there is one. If not, it'll save you data by staying quiet. It alsoregisters 3 Particle.functions for changing whether it publishes,reading the battery level, and manually requesting a GPS reading.---------------------------------------------------------------*/// Getting the library#include"AssetTracker/AssetTracker.h"// Set whether you want the device to publish data to the internet by default here.// 1 will Particle.publish AND Serial.print, 0 will just Serial.print// Extremely useful for saving data while developing close enough to have a cable plugged in.// You can also change this remotely using the Particle.function "tmode" defined in setup()inttransmittingData=1;// Used to keep track of the last time we published datalonglastPublish=0;// How many minutes between publishes? 10+ recommended for long-time continuous publishing!intdelayMinutes=10;// Creating an AssetTracker named 't' for us to referenceAssetTrackert=AssetTracker();// A FuelGauge named 'fuel' for checking on the battery stateFuelGaugefuel;// setup() and loop() are both required. setup() runs once when the device starts// and is used for registering functions and variables and initializing thingsvoidsetup(){// Sets up all the necessary AssetTracker bitst.begin();// Enable the GPS module. Defaults to off to save power. // Takes 1.5s or so because of delays.t.gpsOn();// Opens up a Serial port so you can listen over USBSerial.begin(9600);// These three functions are useful for remote diagnostics. Read more below.Particle.function("tmode",transmitMode);Particle.function("batt",batteryStatus);Particle.function("gps",gpsPublish);}// loop() runs continuouslyvoidloop(){// You'll need to run this every loop to capture the GPS outputt.updateGPS();// if the current time - the last time we published is greater than your set delay...if(millis()-lastPublish>delayMinutes*60*1000){// Remember when we publishedlastPublish=millis();//String pubAccel = String::format("%d,%d,%d",t.readX(),t.readY(),t.readZ());//Serial.println(pubAccel);//Particle.publish("A", pubAccel, 60, PRIVATE);// Dumps the full NMEA sentence to serial in case you're curiousSerial.println(t.preNMEA());// GPS requires a "fix" on the satellites to give good data,// so we should only publish data if there's a fixif(t.gpsFix()){// Only publish if we're in transmittingData mode 1;if(transmittingData){// Short publish names save data!Particle.publish("G",t.readLatLon(),60,PRIVATE);}// but always report the data over serial for local developmentSerial.println(t.readLatLon());}}}// Allows you to remotely change whether a device is publishing to the cloud// or is only reporting data over Serial. Saves data when using only Serial!// Change the default at the top of the code.inttransmitMode(Stringcommand){transmittingData=atoi(command);return1;}// Actively ask for a GPS reading if you're impatient. Only publishes if there's// a GPS fix, otherwise returns '0'intgpsPublish(Stringcommand){if(t.gpsFix()){Particle.publish("G",t.readLatLon(),60,PRIVATE);// uncomment next line if you want a manual publish to reset delay counter// lastPublish = millis();return1;}else{return0;}}// Lets you remotely check the battery status by calling the function "batt"// Triggers a publish with the info (so subscribe or watch the dashboard)// and also returns a '1' if there's >10% battery left and a '0' if belowintbatteryStatus(Stringcommand){// Publish the battery voltage and percentage of battery remaining// if you want to be really efficient, just report one of these// the String::format("%f.2") part gives us a string to publish,// but with only 2 decimal points to save spaceParticle.publish("B","v:"+String::format("%.2f",fuel.getVCell())+",c:"+String::format("%.2f",fuel.getSoC()),60,PRIVATE);// if there's more than 10% of the battery left, then return 1if(fuel.getSoC()>10){return1;}// if you're running out of battery, return 0else{return0;}}