Weekend Project: Building a GPS tracker for my car

I was really excited recently when I purchased somewhat of a dream car for myself. I've long been a 'car person' but having a car that I really, really wanted is something new for me. Wanting to look after my new p̶l̶a̶y̶ ̶t̶o̶y̶  mode of transportation was high on my priority list and a GPS tracker felt like a good idea.



The car

As I said, I've been a car person for a long, long time and I've had quite the selection of cars and motorbikes throughout my life, especially in my younger years! More recently I picked up something truly fantastic and easily the best car I've ever owned.



There have been a few tweets about it over the last few weeks and those who follow me on Twitter will have noticed that!



I make no apologies for feeling and acting like my 5-year-old boy on Christmas morning! This is not just about me buying a new car that I am thoroughly excited about, but the realisation that years of hard work are paying off. Just listen to the thing!



Being a hacker at heart, both in the security sense but also the more traditional sense of tinkering and playing with things, I couldn't resist having a little poke around my new car too.



Tinkering with a few options here and there is great fun and one of the things I came across in the menu system was the ability to disable remote features linked to the app, including GPS location. Like all good things these days my car comes with an app that allows me some basic level of remote control and information, but also the ability to locate the car.




This is great, and I love the idea of being able to reliably locate my car, especially in the event that it was stolen, but this is more of a convenience feature and not a security feature. If someone were to steal the car, I'm sure they'd disable the GPS capability, rendering it useless. I wanted my own, reliable solution.


Android GPS Tracker

I've used Android phones for a long time and for my last few devices I've been using OnePlus. I started on the 1 and have moved through the 2, 3, 5 and am currently on the 6. They moved away from Cyanogen as their OS and now have a very lightly modified version of Android called Oxygen. I get security patches fast and am generally only a matter of weeks behind the latest Android patch level, which is important to me. One of the other things I like, and iPhone users will have the same thing, is the ability to locate devices that I own. When I looked at GPS trackers, they could be expensive, really expensive, and I couldn't quite justify the cost in my head. I figured why not give it a try myself and see how reliable a tracker I can build with basic components. All the device needs are GPS capabilities, a mobile data connection and software to handle the logistics of reporting back location data. It sounds like a smartphone is the perfect fit! It doesn't need to be expensive as it's not going to be used for any phone features, but I did want a device that would be running a modern version of Android and would receive updates. I found a perfect fit in one that ran Android GO, Google's cut-down version of the Android OS for less capable devices.



At only £52.99 ($67.78 USD) the phone fit the bill perfectly and had everything I needed including a good battery, GPS and mobile data connectivity. It also had a load of stuff I didn't need like dual cameras and a good screen, but hey!


Setting the phone up

I powered the phone up and signed in to my Google account and the first thing after that was device updates, let's make sure this thing is current. After this the only app I needed to install was the Find My Device app from the Play Store.



This is the only thing that we will need to locate the device remotely and if necessary, lock the device down and even remotely erase it. After that I needed to make sure the battery would last as long as possible during periods where it had no power. There are quite a few things you can do to extend the life of a battery on a phone.


Turn off WiFi.

Turn off Bluetooth.

Set the screen to lowest brightness.

Set the volume and vibration to off.

Disable all notifications.

Disable all sync items for Google account.

Disable automatic updates (these will be done manually).


That should help to keep the battery running for long periods with no power and after a recent trip of 7 days the battery lost 43% charge whilst parked at the airport. This means I should have at least 2 weeks of power to track the car if it's been left parked and the phone wasn't charged. For the security aspect on the device it has a very strong password to unlock, a 6-digit PIN on the SIM card and fill disk encryption is of course enabled.


Tracking the phone

If I want to locate the car it's a simple case of opening the Find My Device app on my phone or even through the browser at https://www.google.com/android/find

Just last week while I was away working, I regularly checked in on my car which was supposed to be parked at the airport. It was reassuring to see that it was!



If you open the menu at the bottom on the phone app, or at the side on the web version, there are a few more options too.



You can play a sound on the device to locate it if you've lost it, which I probably won't ever use, but the other two are useful. I can 'Secure Device' which will sign out of my Google account on that device or I can 'Erase Device' which will essentially factory reset the phone. Both could be really useful if the device is lost or stolen.


Installing the tracker

The next piece of the puzzle is actually putting the phone in the car. Any potential thief might disable the built in GPS tracker for the BMW app and if they see a phone in the glovebox or centre console, they're probably going to be smart enough to toss that out the window too. The phone needs to be somewhere hidden and somewhere with power. Fortunately, both of these things aren't too difficult to do in most cars. My M140i and my wife's Range Rover (which also got a tracker) both had ignition live 12v sockets in the boot, which made this easy. Even if your car doesn't have one of those though, all you need to do is find a 12v feed that's only live with the ignition to take a spur off. Behind the trim panels in the back there will be various points to test that you can draw power from and then all you need is a 12v to 5v power inverter. This one is only £5.99 ($7.67 USD) and you can get one with a cigarette lighter socket on the end instead of a Micro-USB if you like.



If you're not confident fitting this then a good auto-electrician or friend with the equivalent skills could fit this in <10 minutes. I took the feed for my power from the back of the existing cigarette lighter socket in the boot so it's a completely stealth install. With that, all you need to do is position the phone somewhere hidden. Whilst I had the trim panel off to install the power, I also installed the phone behind there. The trim panels come off with a few pop clips but the chances of someone happening to dismantle my boot during the theft to find the phone is quite slim. Perhaps they'd find it at a later stage when they start stripping my car for parts! The device is well hidden, has power and is buried inside the car but the 3G and GPS signal are still strong enough that I can get a lock on the location in ~10 seconds. This is the perfect setup!


Mobile data

The last piece of the puzzle is of course mobile data usage and there are plenty of cheap offerings here in the UK for that. I got a SIM card from GiffGaff (link for £5 free credit), who are a virtual operator built on the back of O2, one of our largest operators here in the UK. They do a plan for 500Mb of data, 150 minutes and 500 texts for only £5 ($6.40 USD) per month. Many carriers offer the ability to link other SIM cards to your existing data plan or perhaps even cheaper offers exist, but this is certainly cheap enough to get started.



With a plan active the phone can get a solid 3G signal and I know that I'm never going to burn through 500Mb of data per month, so the tracker will always be available.


Do I need it?

I'm sure many would say that I don't, and I can see that. I hope I don't ever need to depend on it or use it for the purpose I bought it, but it is nice to be able to quickly and easily locate the car. This would especially be the case if the car didn't have a native app to do the same. I also find the BMW app can take a minute or so to locate the car and the Find My Device feature can do this in ~10 seconds. If your car didn't have a GPS location feature, then this would be a nice upgrade to have too. All in all, it was a pretty easy weekend project, I got to tinker around with a few bits of my car and the cost is relatively low.