Introduction: Embed an OEM GPS Into Anything

Picture of Embed an OEM GPS Into Anything
I will show you how to hook up a highly customizable OEM GPS unit. These are great pieces of equipment that can be embedded into virtually anything.

Building a complete customized system is a lot of work. It normally requires specific knowledge about several components. Even after each component is learned, it still takes a considerable amount of time to put everything together. I first considered trying to build my own GPS receiver, but after taking a look at a paper about GPS and GLONASS theory, I decided against the endeavor as it probably would take half a year.

Fortunately for those of us who are eager to incorporate GPS into our custom projects (I use them in robotics), or just learn more, there are a huge selection of OEM GPS units.

The OEM means that it is meant to be incorporated into other projects and doesn't come with a screen, casing, or any extras. The great thing about the majority of these devices is that they are extremely versatile and easy to hook up.

As usual, I have provided this tutorial in video format as well:


I'll do my best to explain each section in detail as we proceed.

Step 1: Supplies Needed

Picture of Supplies Needed

1. Power around 5v
(3 AA or AAA batteries in series is 4.5V or a 9V with a voltage regulator)
2. If using a 9V - 5v voltage regulator
3. Wire connector to the 9v battery
4. breadboard
5. female serial port
6. some wires to attach to the serial port
7. soldering iron
8. solder

If you have trouble finding a serial port, you can take apart an old device. I tore apart an old digital camera adapter.

The model that I will be demonstrating how to hook up and use is a Garmin GPS15L. However, these instructions should apply quite well across different models.

It is important when selecting an OEM device to pay close attention to the output format of the unit. The GPS15L outputs based on RS232 level serial where as the Parallax Gps unit outputs at TTL levels. This means the Parallax model won't work the way we are hooking this unit up. TTL levels are generally used for integrated circuit communication. So the Parallax unit would be better suited if you wanted to have it connect right to a micro controller and not to your PC.

Step 2: Hooking It Up

Picture of Hooking It Up

Actually hooking up the unit is pretty simple. If you are using a voltage regulator, make sure to connect the ground to the negative terminals of the battery, serial port, and GPS. You can use any type of power source you want as long as you provide it within the range provided in the manufacturers manual. (GPS15L 3.3 - 5.4VDC)

The USB port outputs 5.05V normally, so that is also an option.

I originally had a broken fiber optic light that took 3 AA batteries. One AA or AAA battery is 1.5 volts. The fiber optic light had the batteries connected in series, so the actual output was 3x1.5 = 4.5volts. I originally used the fiber optic lights power source cut out and put in the Tupperware container with the GPS unit. The only difference is that there was no voltage regulator. I just hooked the grounds together and directly soldered the wires.

Step 3: Testing on Linux

Picture of Testing on Linux

Comm port access
Before you are able to do anything with your GPS unit on Linux, you will probably need to make sure to grant read and write access to the port you will be testing with. Usually the serial ports are in /dev/ttys0, /dev/ttys1, ...etc

If you are using a serial to usb adapter, you may be able to find it at /dev/ttyUSB

Minicom
Out of all of the applications that I initially tried to use for serial/parallel port examination on Linux, the easiest that I found to use was "minicom". This application is hit and miss if it is pre-installed or not depending on the distribution you use. Ubuntu 8 didn't come with it pre-installed, but as you can see from the screen shots, it only takes a few minutes to get it installed and working.

The first thing you need to do with minicom is configure it to use the correct parameters. You can configure the application by using the command line switch -s

Also when you are running minicom, you can access the menu by pressing "ctrl" and "a" and then pressing "z"

Serial to USB Adapter
The adapter that I currently use, I built myself. However, I would reccomend to purchase an adapter based on the FTDI series of chips. FTDI offers excellent driver support across all platforms! Sparkfun offers a few pre-assembled solutions. They also have a great tutorial on using the RS232RL chip with Eagle in order to make your own.

Step 4: Testing on Windows

Picture of Testing on Windows

In order to test things like this on Windows I always use Hyperterminal. It comes installed by default most of the time. I think I had to install it from add/remove programs once on a system running Windows Server.

The initial settings that you will need to configure Hyperterminal with are normally located in the manufacturers manual. For the GPS15L, the default baud rate is 4800bps.

I have included a screen shot of the serial to usb adapter that I used with my robotics gps project. It should be mentioned that this was done on a Windows 2000 machine. The driver support for this cable is rather limited. See the previous step for the adapter I reccomend.

Step 5: Understanding the Output

Picture of Understanding the Output

The GPS15L is able to output in either NMEA 0183 v2 or NMEA 0183 v3 sentences. NMEA 0183 is just a fancy name for saying that the unit outputs text sentences in a certain format. This is the format that is pretty much universal between GPS units for output of the data. Thankfully, the manual for the GPS15L/H describes each of these sentences in detail.

When you first start up the 15L it outputs a whole bunch of different sentences. In the robotics application I used this for, I turned off every other sentence except for the Recommended Minimum Specific GPS/TRANSIT Data (RMC). The following is an example of this sentence.

$GPRMC,163126,V,4335.2521,N,08446.0900,W,000.0,173.2,051206,006.1,W*62

The sentence contains longitude, latitude, speed over ground, course over ground, and much more helpful information. Be aware that if you disable all of the sentences except RMC, when you go to use the unit with non-custom software, some of the features may depend on the other sentences. I'll next show you how to modify the settings on the 15L/H.

Step 6: Modifying GPS Settings

Picture of Modifying GPS Settings

Assuming that you were able to successfully test the unit using Minicom or Hyperterminal, you should be able to send commands to it as well. It you look in the product manual, there is a section called "GPS 15H and 15L Software Interface". This section describes all of the sentences that you can send back to the GPS unit in order to configure it. It is really simple. All you have to do is type out one of the program sentences.

For example, in Hyperterminal you could type something like:
$PGRMO,GPRMC,0

would disable the GPRMC sentence.

You can also write all of the commands you want executed in a text file, then have hyperterminal "type" that file to the GPS unit for you.

Step 7: Programming

Picture of Programming

The real beauty of an OEM unit comes out when you decide to create custom software for it. I have to confess that I have a decent amount of programming experience. It certainly isn't trivial to write a serial buffer in order to read data into a custom application.

If you don't want to write custom software for the unit, then I would highly recommend the program gpsDrive for Linux. It will work directly out of the box with anything that is outputting NMEA 0183 sentences.

If you do want to write custom software, then you are in luck. I have attached a class that I wrote in Java that can send and receive data to the serial port. It should be mentioned that Java does not come by default with the classes needed to support serial communication. For the class that I have attached, I am making use of the open source library RXTX.

If you are skeptical and would like to see the unit and code in action, you can head over to my website and check out the video of the autonomous robot navigation project. I also have the complete source code available that was used to navigate the robot.

Most importantly, have fun with your GPS!

Comments

Michael_D (author)2009-11-13

You have gotten the GPS signal to enter as text into the computer.
Do you know of a way to input this data into an .avi file?

I need to have the GPS location to be placed real time into a video.  I can place the camcorder onto a pc but need a way to embed the gps coordinates into the video.

Thanks for any help
Michael

wjsteele (author)Michael_D2010-02-07

What you need is referred to as an OSD, or On Screen Display.  There are several  units available that will take GPS data and place it on the screen, but you will most likely need a small controller, like a Basic Stamp or a Propeller (or similar) to do it.  OSDs are commonly used for RC aircraft and model rockets, but some have onboard controllers that you can write your own software for.

technogumbo (author)Michael_D2009-12-09

I dont really know of any way to do this.  You would have to modify the way the camera writes data to the Mini-DV, HI-8, or whatever format of tape it uses if you really want to do that.

It seems like it would be much easier to include a partner delimited plaintext file.

If you want to get really messy with it; I know many video format containers (mp4, flv, avi..etc)  include metadata at the end or beginning of the file that includes things like keyframes.  Not too sure if there is a container that could contain your gps coordinates in the metadata.

Michael_D (author)technogumbo2009-12-10

Thanks for the reply.
If you run across anything like this please let me know.
thanks
Michael

longestname (author)2009-09-17

Can I ask if you have any experience making the software as a SatNav to predict next position based on previous tracked locations. i.e. previous points lined up to show position in 10 minutes. Then SatNav to that location. Cheers, Mark

technogumbo (author)longestname2009-09-20

Nope. Haven't ever written any prediction based gps software. Very basic straight shot (no notion of waypoints) autonomous navigation though.

longestname (author)technogumbo2009-09-20

Know anyone that could make such a program? Thanks

f86sabre (author)2009-07-18

would it be possible to power the whole thing from usb and still interface to the reciever, and are there cheaper antennas you can use?

technogumbo (author)f86sabre2009-07-26

Yes, you can power the whole thing from USB if you break out the + and - lines from the USB cable. However on this particular model you would have to use a USB to serial converter if you actualy wanted to see the data. I havent ever come across a cheaper antenna then the one I use in this demo.

inventorcubano (author)2009-06-01

hay charl I thing that every thing it's incredible. iI have some question for you about gps how can I contact you.

nolte919 (author)2009-04-24

Does the GPRMC output line in step 5 indicate a location in Mt. Pleasant, Michigan? I'm wondering if I'm decoding the sentence correctly.

technogumbo (author)nolte9192009-05-23

Sorry it took me a month to respond nolte919. Your exactly right! The coordinates are actually my old college apartment! Pretty cool huh? Nice work!

matroska (author)2009-05-03

That's a nice project, since a GP-1 unit for my Nikon D90 camera costs around 250$, and it just happen that the GP-1 unit outputs NMEA. I wasen't sure about the output format, but I looked up and found it was NMEA. Now I need to figure out the schematics and plug this into my D90 and I have a DIY GP-1 unit. If I do it as well as a guide for it, I'll link to your instructable for the main GPS part!

technogumbo (author)matroska2009-05-23

Thats a pretty sweet idea matroska! The manual for the GPS15L has a whole bunch of options which allow you to turn on and off the scentence types in the NMEA format as it consists of a whole bunch of different strings of data. I would be careful though as your camera may be expecting data at a certain interval. I may be wrong, but I think the max reporting time for this unit is every 1 second. So you can only get readings at a maximum of 1 reading per second. Be aware too that this unit will just dump out its last known coordinates if it can't get a fix; so your pictures may be tagged with the wrong location and you will never have an indicator to know if you have a valid GPS fix or not.

technogumbo (author)2008-11-09

I recently wrote a tutorial for using the auto-map downloading script of GPSDrive that some of you may find helpful as its a little tricky.

GPSDrives gpsfetchmap Ubuntu Script Tutorial

technogumbo (author)2008-10-30

Thats a great point ellisgeek. You could use a USB cable to power the thing; however you couldn't interface it directly to this GPS unit as you are in your diagram. I know the Garmin GPS15L is specified as a Serial device which means that the voltage levels it uses to determine a 0 from a 1 are in the +12 -12 volt DC range. USB operates on 0v to 5V logic levels I am pretty sure. So if you did hook it up as you have in your diagram; I think you would have a hard time seeing data coming out of the GPS on the RX and TX lines.

ellisgeek (author)2008-10-29

couldn't you just use a usb cable and skip the voltage regulator.

technogumbo (author)2008-07-26

Your questions are actually great cholo71796, and ill do my best to answer them in a random order. "How do you receive the GPS location? Is there a certain receiver you have to have?" The way I talk about the Garmin GPS15L in this tutorial is probably confusing due to the fact that many people refer to in-car navigation and complete handheld systems simply as "GPS units". I am in fact demonstrating a GPS receiver, not an entire system here. The GPS Receiver is the Garmin GPS 15L. "Which one did you use?" The unit I demonstrate is a Garmin GPS15L, I have gotten this unit twice for $50 "I never saw where the GPS was on a map, why not?" An OEM gps is not an end user product in itself. You use a gps like this as a component in a full product. So the GPS units you see in a car that have a screen and show maps, probably use something similar to this JUST for getting the GPS coordinates from the satalite. The easiest way to have a map work with this, is to use an application like GPSDrive to show the coordinates that the GPS unit is recieving on a map. "Do you have to have Linux for this to work?" No, you can use any type of operating system for the communication method that I show in the instructable. "How can you view the location of the GPS" You can't view the location of the GPS unless you hook it up to some sort of screen. So you either need to hook it up to a computer, or build an accompanying electrical circuit with an LCD that could display the coordinates. "What do you do with the last program? Do you have to run it when the GPS is connected to your computer?" Unfortunately the last part of the tutorial will probably only make sense to computer scientists. The java code I provide isnt a full application. It is simply a component that a programmer can include in a larger application to read in the raw coordinates from a GPS Receiver. I wrote the component for using this GPS Receiver to read in coordinates that are used to autonomosly navigate a two-wheel robot. The code provided is ONLY for the reading in coordinates part. Again, for a full program that will work with this unit in the way that I show how to hook it up, I can reccommend GPSDrive. I really appreciate your questions cholo71796. I had similar questions when I first started working with GPS.

Scurge (author)2008-05-29

great instructable! however, i would not recommend clicking on the "GPS and GLONASS theory" link, your brain will explode. lol

conrad2468 (author)Scurge2008-07-06

agreed i think i lost a couple of "QI" points!

NetReaper (author)Scurge2008-05-30

Help me!

Geordiepom (author)2008-05-17

Excellent post and very well explained. Really makes me want to give it a go even though I know next to nothing about electronics. How would I go about building a GPS tracker for my car in case it gets stolen?

technogumbo (author)Geordiepom2008-05-18

Thanks Geordiepom. You could make a car tracker in the following manner, but you would have to know a little bit about computer science. You could use a gps unit like this in combination with a wide area internet technology like EVDO. You would hook them both up to a small computer and keep track of the gps coordinates on that computer. You would then have a web server, ssh, telnet, something that you could use to get at the gps coordinates with. I hope that makes a little sense. There may be some pre-build apps that could help you do this, but I am not aware of any. Does anyone else know?

LinuxH4x0r (author)2008-05-17

Great job! I'm considering getting a gps this year. Any suggestions?

If you're getting a company-made gps (unlike this instructable) and are interesting in a something fun and hackable- my vote goes for the Mio C230. I currently have mine hacked to run a full-featured palm-pc and play just about any movie format. Plus it is cheeep.

Thanks, I'll consider it. How much did it cost you?

~130$ on ebay is what they usually go for... just check out http://c230.wordpress.com to check out some of the features possible when unlocked.

About This Instructable

19,596views

75favorites

License:

Bio: Above all I believe one of the greatest privileges is the opportunity to learn. I consider myself a maker and have a rich history in ... More »
More by technogumbo:Embed an OEM GPS Into AnythingHow to Make a Wind Powered LED Out of a VCRSimple Coffee Roasting
Add instructable to: