DIY Vehicle Tracker

16,354

150

32

About: Unix/Linux/Networking/Security engineer by day, alpha geek by night. So, basically the same thing.

My motorcycle was stolen last summer. Fortunately the police found it virtually unharmed (NYPD FTW!) but I know that I dodged a bullet so it was time to put some 21st century tech into my late 20th century ride. Unfortunately stolen vehicle tracking systems cost more than my bike was worth so I decided to build my own. I went through a bunch of iterations before settling on a system so simple you'll probably smack your forehead like I did when you see it. At least if you want to track a car. Bikes are tricker because of their small batteries, so that's the point of this guide. First, let's discuss the simple case: A car.

Step 1: The Brains and How to Talk to It

The first thing I did was hide a Tile under the seat. That could work but only if the bike has other Tile users nearby. If it's stolen again I don't want to count on that so I needed something more active and always-on. Initially, I looked at small GSM-connected GPS receivers that text you their location on demand. Those boxes take a SIM card with a conventional phone number and plan. It used to be that you could get a plan with no monthly fee where you pay only for minutes and texts used, but those went away in 2015, along with the 2G (GSM EDGE) network these boxes require. However, there is something close: For a few dollars, you can buy a FreedomPop SIM that'll give you 200 minutes, 500 texts and 200MB of data every month, for free. But there's a hitch: the voice minutes and texts are all Voice Over IP (VOIP) and those little GPS boxes don't speak VOIP.

But you know what does? Cell phones. Even old ones. So I put those GPS receivers on a shelf for a future project, picked up two iPhones with broken screens, fixed the screens, and gave each its own iCloud account so I can track them individually with Apple's Find iPhone app. One of those phones lives in the center console of my car, where there's an always-hot power outlet, so I can find it any time I want. (Bonus: no more wandering the Amusement Park parking lot trying to remember where I parked!) The console isn't exactly a great hiding spot from Bad Guys (tm), so my next project is to find a location inside the dashboard and wire in a buck converter for power. Some cars, especially newer ones, helpfully turn off those in-console power outlets to protect the starter battery so you'll want to keep an eye on that.

Cars have huge starter batteries, so even if I go a month without driving there's plenty of energy left to start the engine after powering the phone the whole time. Motorcycles, on the other hand, have tiny starter batteries that run down on their own in a few weeks, especially in the cold, so the tracker needs its own power system, in addition to the battery in the phone which only lasts a few days, at most.

One thing to know about FreedomPop is that they'll deactivate a SIM that's been idle for more than a few months, but the iPhone checks in with iCloud and looks for app updates a few times a day. Normally, for a low-limit cell plan, I wouldn't allow backups and app checks over cellular, but in this case, those little pings have been enough to keep the accounts active. I still update apps over wifi, though, since a single app upgrade could use the entire monthly allotment of data. Also, note that if you link multiple FreedomPop accounts to each other by making them "Freedom Friends" each gets an additional 50MB per month, up to a total of 500 additional MB. (Sure, the name is silly but it's very useful so don't let that stop you.) That's not the case if you have several SIMs on a single account, though, so get more free email address and use those for additional accounts. Believe it or not, that's FP's suggestion and there's no problem using the same address and credit card for multiple accounts.

Pro tip: You can change the first and last names listed on your FP accounts so mine are "Freedompop CBR", "Freedompop Car", "Freedompop Sparephone", etc, so I can keep them straight when looking at the accounts. Be creative!

Step 2: What You'll Need

Power Source: A bunch of 18650 cells, which look like overgrown AAs. (Fun fact: 7000 of them comprise the battery for a Tesla Car.) If you're lucky you'll be able to get your hands on some old laptop batteries, most of which have 6-9 18650s in them. Your local electronics store likely has a bin near the front door where you can harvest dozens of these. Or you can buy some. Or both. Good ones are about $6 each.

Cell Holders: The more cells you have the longer your battery will last. A 5-pack of 4-cell holders should get you started for $12 at Amazon.

Cell Tester: If you're harvesting laptop batteries you'll need a way to find only the good cells. This $40 charger will test and even refresh (a little) your 18650s. It's not the cheapest charger out there but considering the cost of brand new cells, it should pay for itself quickly. It's also good for figuring out which of your household rechargeable AAs and AAAs are worth buying again. (spoiler alert: most are junk. Go with the name brands.)

Battery Pack Control Module: Something has to manage that array of 18650s. I paid $8 for this one, which appears to be unavailable now. There are plenty for sale on Amazon and elsewhere, but make sure you get one that does not have a push-button to turn it on. You want the thing to supply power any time there's a load attached and charge the cells when power is applied to it.

Automotive relay: 4PDT is overkill but works nicely, especially for $8.

Buck Converter: to turn the bike's ~12V to a clean 5V for the battery. $12.

Micro USB extender cable: You'll need male and female connectors. If you don't have them lying around a cheap extender cable is $5.

USB Power meter: To test the capacity of your battery. It's not strictly necessary but it's really handy. $12. I use mine to test USB cables and I've been shocked at the variance. Big name, OEM cables are almost universally good, as expected, and some third-party wires are good too. But many are not. This tester has paid for itself more times than I can count in saved frustration, not to mention in avoiding equipment damage.

Smartphone: You probably have an old Android or iPhone gathering dust somewhere, but if not keep an eye on Craigslist, Groupon, etc for bargains. Or if you're especially handy (and you wouldn't be reading this if you weren't, right?) get one with a broken screen from eBay. Parts are available on Amazon and iFixit.com has excellent instructions. (Another of my Instructables walks you through replacing the screen on a Blu R1 HD). It's a good idea to get a rugged, waterproof case for the phone like a Lifeproof or Otterbox and since you're using an old phone they should be really cheap - like $8.

SIM card: Freedompop sells them for a few $. If you're patient wait for a $1 sale. Or the rarer $0.01 sale.

Extras: Various wires, shrink wrap, waterproofing material, etc.

Total Required: $41 for the cell holders, buck converter, control module, relay, and SIM card.

Total Suggested: $101, including the $41 above and $60 for the charger, power meter, and phone case.

Step 3: Crack Open a Laptop Battery or Three

Most importantly BE CAREFUL. There are sharp parts and hazardous chemicals inside. If you're not experienced in this environment, STOP HERE, buy a couple of 18650s and go to the next step. Seriously. Think of the "Hoverboards" and Samsung Notes that caught fire in 2016. That was Lithium, which is also what's inside the 18650. There's no shame in avoiding lacerations and 3rd-degree burns, or worse. Now, if you are comfortable dissecting electronics read on.

First, you'll need to split the case so look for a seam and make a very shallow cut into it with a knife, then pry the case apart with plastic tools to avoid damaging the cells. Once you remove the case you'll be left with a circuit board and a bunch of cells soldered together. Carefully remove the cells from the metal strap holding them together. If you're gentle, needle nose pliers, sandpaper, and metal files are good for removing the sharp points from the ends of the cells.

When you're done you're likely to have tiny, razor-sharp metal shards littering your workbench so use some industrial strength plastic wrap or a thick plastic bag wrapped around a strong magnet to pick them up. Discard the plastic wrap with shrapnel inside it.

Step 4: Find the Good Cells

Put the 18650s through their paces in the refresh cycle of the smart charger. Good cells will take a couple of days so be patient. You'll want to label each cell so you can match them in the carriers later and, if you're anything like I am, you'll create a spreadsheet with the results of every charge cycle for each cell. Yes, that includes AAs and AAAs. (My spreadsheet has over 150 NiMH household cells and 50+ 18650s. Yes, I am a data junkie, why do you ask?)

Brand new, high-end 18650s have a capacity of over 3000mAh so I kept those which measured over 1800mAh and the rest went back into the recycling bin.

Step 5: Build the Battery Pack

The 18650s are going to be installed in parallel so wire together all of the terminals on each side of the 4-cell holder, as you can see in the first picture. Each side is a single piece of wire with a few mm stripped at each of the carrier's terminals. You can do it with individual wires, but this was easier and cleaner. Cover those joins with hot melt glue and electrical tape to prevent shorting out those cells, which can cause a major disaster.

Solder the controller module to the first holder and now you have a battery pack. The pictures here are of my prototype. After I took the pictures I soldered barrel connectors with an in-line blade fuse on each end of the 4-cell holder so that the holders can be chained like holiday lights. That way I can add as many 18650s as the controller will handle. So far I'm at a dozen cells and it's working well. To keep the cells in place tightly wrap rubber bands around each 4-pack. When I remove everything this Fall, before winterizing the bike, I'll take some pictures and post them here.

The last picture shows the USB meter verifying that my battery is charging an old phone I was using for testing.

Step 6: Build the Charging Switch

The motorcycle's engine supplies plenty of power to charge the battery pack, but when the engine is off I want my charging circuit disconnected so that it doesn't drain the bike's battery. At the same time, I want to be able to charge my battery pack from the wall during cooler weather, when I don't ride enough to keep the pack powered up.

A few notes on the wiring diagram:

  • For readability, the diagram shows two relays, but I'm using a single automotive 4PDT, which is in the middle of the photo.
  • Motorcycle tail lights are lit up whenever the engine is running so I'm using those to activate the relay, which does two things:
    1. Connect the buck converter's 12V input to the bike's electrical system, sending 5V out of the buck converter to my battery pack. That 12V input is the shorter coil of wire in the middle of the photo, though I've since replaced it with heavier gauge wire.
    2. Toggle whether the micro-USB plug gets power from the buck converter (when the bike is running) or from the micro-USB socket (when it's not). The socket is in the upper left.
  • The micro-USB plug at the top of the photo is the 5V output from this rig and it will be plugged into the battery pack we built in the last step.
  • Output from the buck converter was two USB-A sockets, so I left one intact for future use, as you can see on the left of the photo. I clipped off the other and that's what sends 5V to the relay.
  • The micro-USB socket at the top left is to charge the battery pack from the wall when it's in the garage.
  • The longer red/black coil in the upper right runs to the tail lights to energize the relay's magnet.

Step 7: Install It in the Bike

After bench testing, it was time to try this in the real world. The first picture shows the plug for the tail lights with my relay wires wedged into the pins. Snap that back into the tail light fixture and the relay does just what it should.

Picture two shows the output from the relay powering the USB tester, which was charging the test phone. After confirming it all works I put my battery pack in its place and everything worked as intended.

Picture three is my quick-n-dirty water and dust prevention system. Yes, it's a zip-lock freezer bag with holes for the wires. I don't ride in the rain so it's good enough for now.

The three 4-cell packs are currently zip-tied to the frame inside the plastic fairing with electrical tape protecting the barrel connectors. I don't have pictures of that but I'll try to post some next chance I get.

Step 8: What Next?

Future plans

  • Replace the iPhone 4s with a 5 or later so it'll use LTE instead of 3G, not to mention a better phone. Plus that'll be one less device using Apple's old 30-pin connector. (I'll probably end up using it as a motion-sensor camera in the garage, to match the 4s I have doing that in the front of my house. Thank you, Presence!)
  • The phone in the bike talks Bluetooth, as does my primary phone, of course. I want to write an app for the bike phone that will send an alert if it moves more than a few feet without my phone being in BT range. That way I'll know immediately if the bike is stolen and this system becomes proactive rather than reactive.


If you have questions, feedback, suggestions, found-typos, etc please leave a comment and I'll be happy to respond. Thanks for reading!

Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • IoT Challenge

      IoT Challenge
    • Classroom Science Contest

      Classroom Science Contest

    32 Discussions

    1
    None
    nedchurch

    9 months ago

    Thanks for your great work - very simple, I will use my old Android for my FJ1200. It's a pity I couldn't have done it with several bikes back in the 1970s including a Ducati 750 Sport that I never got back.

    2 replies
    0
    None
    DavidsG2nedchurch

    Reply 4 months ago

    Sorry about that
    similar experience here too.

    0
    None
    fixxitnedchurch

    Reply 9 months ago

    My pleasure and I'm sorry to hear about the thefts. I know they're "only machines" but the sense of violation can be overwhelming.

    Once you get your tracker running please follow up here with an update and let us know how it's working and what software you use.

    Hopefully, you'll never lose another bike, especially not something as classic as that Duc!

    0
    None
    DavidsG2

    4 months ago

    Why can't it be simpler
    eg. Like those transmitters used on animals and inside rhino horns
    I'm learning electronics, correspondence, as a hobby thus am curious about technological capacities, capabilities.
    I mean to say is, can tracking get simpler to put on a bicycle ( ie expensive one)

    0
    None
    Yonatan24

    9 months ago

    Have you... Ever opened a laptop battery without cutting yourself... At least once?!

    2 replies
    0
    None
    fixxitYonatan24

    Reply 9 months ago

    I have, in fact! I've been working with sharp and pointy objects for most of my life so I know how to keep the dangerous parts away from the sensitive bits. That's not to say I've never cut myself, but it's rare. Just watch what you're doing, don't use too much force, and be careful. Let the tools do the work!

    0
    None
    Yonatan24fixxit

    Reply 8 months ago

    Or get rubber coated work gloves on eBay for $1 and then you can make a mess without stopping every other minute to get a bandaid!

    0
    None
    GrahamK23

    9 months ago on Step 3

    Totally should have gone with LoRa. ultra Low power, free to use and perfect for your project.

    4 replies
    0
    None
    fixxitGrahamK23

    Reply 9 months ago

    Interesting idea. Can you expand on that a bit? I'm always looking for new gadgets and technologies for my next project.

    Thanks!

    0
    None
    GrahamK23fixxit

    Reply 9 months ago

    There are lora modules that can hook up to arduino or even a d1 mini. Your project doesnt need much data to be transferred, just gps position, and lora has low bandwidth and ultra long range more than 10kms. Most countries have lora gateways and repeaters (connections to the internet) all over because they're so cheap, leaving few black spots. Id go into mote detail but there are many youtube tutorials and coverage maps out there already. give it a google. Good luck. It'll open up a whole new world to you if you take the relatively small amount of time learn it.

    1
    None
    B2PiGrahamK23

    Reply 9 months ago

    For other purposes, this is interesting, but isn't LoRa only good for 209 meters?

    0
    None
    GrahamK23B2Pi

    Reply 9 months ago

    Interestingly, depending on the obstrictions like tall buildings etc. In the past there has been 25 km transmissions with a minimum of around 2kms in built up cities. A 209 meter range might come from an untuned antenna but many boards now come with tuned LoRa antennas.

    0
    None
    ThomasW283

    9 months ago on Step 7

    Is it hidden on the bike? If not, won't thieves just remove it when they steal the bike?

    1 reply
    0
    None
    fixxitThomasW283

    Reply 9 months ago

    Good question. Yes. It's tucked into the plastic fairing under the seat, which requires the key to open without doing wanton destruction. That's another reason to find a good hiding spot (like inside the dashboard) for the finder-phone I have in my car, rather than putting it in the center console. In that case, I have it sitting under a bunch of other random-looking items (sunglasses, tissues, etc) to keep it out of immediate sight.

    1
    None
    restevao

    Tip 9 months ago

    sensor on kick stand.
    use standard power pack

    connect Arduino to cell tower.

    add GPS to Arduino.

    0
    None
    AlanS14

    9 months ago

    +1

    and you got people to contribute many other good ideas- so *another*

    +1

    1 reply
    0
    None
    fixxitAlanS14

    Reply 9 months ago

    I was lucky to get my bike back so I hope this helps others do the same. It really does take a village to defeat criminals.

    Thanks for the nods. I appreciate it!

    0
    None
    Gofish

    9 months ago

    Excellent Instructable however I would point out that a system from a crowd like Automatics Trackers gets an insurance discount that just about pays for it plus cheaper premiums plus has international coverage and as the company works with just about every police force and Interpole, has dedicated recovery agents in nearly every country and about a 98% success rate is well worth the cost. Friend just had his digger stolen along with the trailer and most of his tools, very much regretting not fitting a tracker plus marking with a system like Select DNA.

    Anything to stop a thief and bring them to justice is good but removal of the hands and feet is a good start for 'bike thieves.

    1 reply
    0
    None
    fixxitGofish

    Reply 9 months ago

    That's a good point about Automatic, especially for vehicles with an OBD-II port, which is any car or light truck built after 1995. I'm not aware of anything similar for motorcycles though and, unless my Google-Fu is off, there isn't any industry-wide standard, which is a shame. Reading OBD-II codes from my car has saved me thousands in repair costs.

    I'm sorry to hear about your friend's theft. I hope the local police are able to recover everything and catch the miscreants who took it.

    I wasn't aware of Select DNA trackers so I'll have to look into that for my next car. Thanks for the compliment and the feedback!