GPS - This Global Positioning Stuff
![]()
Please Note: The electronic circuits which I mention later in this article and elsewhere on this web site are my efforts purely. They are descriptions of what I have done as experiments or as solutions to my specific problems. You may wish to try what I have tried but if so, the responsibility is yours. I make no claims for accuracy or infallibility.
- Introduction
- The Problem of Position
- The Global Positioning System, what is it?
- My Introduction to GPS
- My interface cable
- External Power Supplies
- Notes on GPS Technicalities
- Sources of Error
- Differential GPS
- WAAS
- Try This
As a newcomer to the GPS scene I have been enjoying learning about this very sophisticated, new, (to me), technology. It occurred to me that there may well be others thinking about it who might be interested to read a little of what I have learned about it.
I had seen friends wandering about holding these black boxes looking like gas men in search of a meter to read. I knew the basic principle - that the box would tell you your absolute position in the world; or should I say, on or over the world. I am not an around-the-world yachtsman or microlight navigator so have never had a great need to know my absolute position in terms of latitude and longitude. However, the GPS set-up is solid technology and I do enjoy a dip into those waters. By the time that I came to it, it was a very well established technology. There is a lot to be said for coming along to something of this sort relatively late in its development. Most of the initial bugs have been sorted out and necessary modifications made and established. This article describes my venture into the world of GPS. What I learned about the system and about purchases and modifications which I made in order to give me the sort of system I wanted.
I have ended up with a very simple system which is able to tell me precisely where I have been when out walking or driving, and to illustrate this on a map in my computer. When walking in the country I am not always sure of exactly where I am so it is useful to get to see this later. I am also able to predetermine routes from maps in my computer and load these into the GPS unit. A navigational arrow then shows me where to go in order to follow the route. This is particularly useful, and works well, in the car. It is also possible with a laptop computer to put it in the car loaded with a map, plug in the GPS receiver and get a real time plot of position directly on the computer’s map.
You may be familiar with the problems that a lack of knowledge of global position made for the early world navigators. If not, I recommend reading Dava Sobel’s book Longitude.
Latitude is easy. A sextant to measure the angle of the sun to the horizon at midday and then a small calculation or a set of tables to find your latitude directly. Longitude on the other hand, is rather more difficult. The principle is simple. It’s the practicalities that give the problems.
The earth rotates once every 24 hours, this is 360 degrees of rotation. So each hour that passes is 15 degrees of rotation. Remembering that Greenwich is the 0 degree datum, if you know how many hours you are East or West of Greenwich then allowing 15 degrees for each of the hours will give your longitudinal position. The traditional approach to the problem was to have a very accurate clock, set it to GMT and then when the sun was at its highest point (local midday), note the time on your clock. The time difference between local time and Greenwich time would give your longitude. The problem was to find a clock capable of keeping accurate time whilst undergoing the rigours of a long sea voyage. Clock maker John Harrison spent his life, in the 18th century, designing clocks and chronometers for this purpose; with eventual success. I often think of him when I see a digital watch built into some trivial object or give-away item. They are almost corn flake packet gifts these days. I imagine him looking down at this with nodding head and a rather rueful smile. The digital watch built into a pencil case and costing pence has usurped his life’s work. If you are watching John, don't worry, your work was excellent in its time. I have seen your chronometer in the National Maritime Museum; superb piece of work. But, if you are watching, just have a look over my shoulder at this GPS unit. It will make your eyes pop and your jaw drop open.
The Global Positioning System, what is it?
GPS was devised by the American Department of Defense (DoD) for military purposes. It comprises a set of satellites, known as the Navstar satellites. These buzz around the Earth, well out in space, looking like the popular images of electrons around a nucleus. The diagram at the start of this article is my attempt to show the actual orbits of the GPS satellites around Earth.
The first satellite was launched in the late 70’s and the system was developed through the 80’s. A GPS unit is a radio receiver picking up signals from those satellites and from those signals, computing its position in terms of latitude and longitude. More on the technicalities of the system later.
It was devised as a military system and the Americans were somewhat ambivalent about public access. They were not able to prevent access, so for protection, they built a time based random error into the system known euphemistically as Selective Availability. It degraded the accuracy in a non predictable manner; presumably to prevent any foreign missile systems from using GPS for guidance. The fact that it was under the control of the US military rather encouraged others to think of setting up their own systems. The Russians started their Glonass (Global Orbiting Navigation Satellite System) in the 80’s. We Europeans are planning to have our own Galileo satellite system up and running in 2008. It seems that the Americans, finding they were in danger of losing control of global positioning, responded by totally removing the Selective Availability from their GPS system in 2001. Perhaps to encourage its use by other countries thus giving the Americans some control, ultimately, over whatever it was used for.
Having decided to buy one of these gadgets I found myself in Maplin’s electronics store looking at what was available in personal hand held GPS units. I knew there existed these very sophisticated systems which showed maps and gave directions when one is motoring. They are very expensive and, as I have explained, I didn’t have a need for that sort of thing. All I wanted was a simple introduction to GPS technology.
![]()
Knowing absolutely nothing about what was good and what was bad, I was attracted to the smallest device on display. I am ashamed to admit it but, yes, I bought this rather complex electronic device based purely on size. The Garmin Geko 201 is very small and neat - less than 4"x2"x1". It looked to me like the sort of thing I would not object to carrying about in my pocket. Other units I had seen friends carrying all looked rather bulky. Capable of all sorts of good things no doubt, but just big, black and bulky.
I expected that what I had bought might be rather simplistic.
That it might give me my position and that’s all. No frills. I visualised myself having to take a pencil and paper or a map along with me when walking, in order to record my point to point locations. My first look at this device tended to confirm my suspicions. The black and white display presentations looked as though they might have been designed for children. I found it contained a number of inbuilt games. Yuk! Perhaps it was intended for boy scouts. Nothing could be further from the truth, although I am sure that both children and boy scouts would find it very useful. As I learned the facilities available on this little device and saw its performance, I became very happy about the chance that had made me choose it.
There was no need for the pencil and paper. The device will record a positional point whenever I require it and will store it internally. In fact it will hold 500 such points. I found they are known as Waypoints. I soon found that in addition it will record a large amount of information in the form of Tracks (trails of points where I have been), and Routes, (trails where I plan to go). With my low expectations I was delighted to find these facilities. I also found that it has 12 parallel channels each able to use differential GPS, and the ability to receive what are known as the WAAS satellites; on which subjects more later. The only restriction in use is that the device needs a clear line-of-sight view of the satellites in order to receive the relatively low power signals. Tree foliage is obstructive.
The next thing I found was a serial interface. It became obvious to me that if I was able to connect my computer to the interface I would be able to transfer collected data to a PC where it could be more conveniently dealt with. The hand book showed me that it was possible to configure the interface for RS232 text output. Knowing something of computer communications I thought I would try a connection. Looking at the price of connecting cables I found they were high relative to the cost of the whole device. The GPS unit I felt was value for money, the cable I felt was not.
I cobbled together a very simple connector just to test the comms possibilities. I will not describe that connector here because later I will be describing my current version which is simple and works well. Having configured the GPS unit for the RS232 text output, I used my simple connector to interface to the PC. On the PC I ran a communications program. It was in fact the program HyperTerminal which comes with the accessories of the Windows Operating System. As soon as I switched on the GPS it started to output information packets to the PC. They come at about the rate of one per second and give date, time, and present location information.
I was impressed with that and having established a working comms system I was able to visit the Garmin web site and obtain a copy of the latest Geko 201 operating system. This I down loaded into the unit with no problems bringing my GPS completely up to date. I later discovered that there are three versions of the Geko. The 101 is the simplest and has no serial port. The 201 does have the serial comms but its altitude measurements are subject to error. The 301 has an inbuilt barometric device which enables it to give more accurate altitude measurements. I have no need of accurate altitude but, as something of a computer geek, I would like serial communications, so once again I had by good chance, selected exactly the model I would have chosen had I had all this knowledge available to me at the time of buying. I think it is called serendipity.
I was keen to be able to transfer to my PC, any of the information I stored in the GPS unit. Although Garmin give the necessary information on their web site they do not make it simple to apply. They sell a proprietary program to do the job and I suppose they are keener to sell that than encourage people to do it for themselves. Again the program cost was high relative to the cost of the GPS unit. I thought it could be an interesting exercise to write a suitable comms program but I could see a long programming session ahead, writing a C++ program to do the job. I made a start but it occurred to me that it was very likely that others had already done it, so I had a look at a GPS User Group on the Internet. Almost straight away I found mention of a Freeware program called GPS Utility. I visited their web site at,
The free version of their program is available for evaluation purposes and a registration cost buys a fuller version. I found this program to be excellent. At a stroke it took away my need to write a program and relieved me of all comms problems. It is possible to upload or download to or from the GPS unit at will and if provided with a suitable map or chart image, will automatically plot all waypoints, tracks and routes. If the program plus map is on a laptop it is also capable of plotting current progress whilst on the move. Worth noting also, is that all information is stored in a straightforward textual format so is very simple to manipulate. There is quite a lot to the program and I did consider the full version to be value for money so I quite happily paid up. I found this program used in conjunction with map images scanned into my computer, answered most of my requirements. It is an excellent way to store and handle waypoints, tracks and routes on a computer rather than take up space in the GPS unit.
Also worth mentioning is the battery situation with this GPS unit. It runs on two AAA batteries. I have set myself up with a set of about half a dozen Nickel Metal Hydride batteries which I keep charged up and carry with me whilst out and about. I keep the unit in battery economy mode so I do not find consumption to be excessive but I think it wise to have changes available.
The serial connector on the Geko 201 is very simple. It comprises four studs set in the case at the back under a rubber protection pad. These studs require some form of pressure contact for the connection. I tried several different home made connectors all of which worked. I was unhappy about these designs because I was relying on frictional contact with the studs. I wanted a spring pressure contact which I felt would be a preferable method of electrical connection and is, I am sure, what one would find in the Garmin cable design. The problem was to keep it as simple as possible. My final design attempt fulfilled these criteria. It has worked every time I have used it and is the connector I use today.
The photograph shows this connector. Due to the way I have attached the cable, the view is less than clear. A click here will produce a clearer diagram showing the component parts and the principle of operation. No dimensions are given. I just made everything to fit as required.
I cut a single sided, copper clad piece of Circuit board to a suitable width. I then filed grooves down the sides to enable the board to slide into the GPS socket. These are best seen in the diagram’s plan view. Next I sawed a notch in the bottom edge (see front elevation), to correspond with the locating lug on the Geko. This gives the basic connector. I then drilled holes through the board over the stud locations. With a craft knife I cut away copper strips between the holes to leave each hole located in its own, electrically isolated, vertical strip of copper, (front elevation). Next came the spring connectors (shown only in the sectional side elevation). These were made from a thin strip of springy brass which I happened to have. I think stiff, springy, brass wire would work as well. You will see that I bent the tip back on itself to form a smooth surface for the contact point and then shaped it as shown in the elevation. The contact was set to project through the hole and was then soldered to its copper strip at the top of the board to hold it in position. And that is all there is to the connector.
The wires to connect to the computer were soldered to the tops of the copper strips. Only three wires are required for serial transfer - Data In, Data Out and Ground. Their positions are shown in the Geko handbook. These I connected to a nine pin D socket for serial connection to the computer. Data In goes to pin 3 of the serial connector, Data Out to pin 2 and Ground to pin 5.
I took advantage of having the GPS connector to make provision for an external power supply. The fourth contact is Power (+) so I connected a separate, small, 2 pin socket with wires to Power(+) and Ground allowing me to plug in external 3 volt power supplies and so save the internal batteries.
Incidentally, if you fancy to try a little experimentation of your own, it went through my mind that a piece of thickish, stiff plastic, cut to fit the Geko serial socket and then cut through as indicated, could also be made to work.
If the material is stiff enough and springy enough it would do away with the need for external springs of any kind. The ends of the arms would need some form of contact put through and thin wires could be glued up on top of the arms for electrical connection to the computer. It could be a very simple and good connector. (Possibly).
Powering the Geko 201 only requires 80-100 mA at 3 Volts and it works well off its two AAA batteries. However, when driving, (the Geko receives without problem through my car windscreen), rather than run down batteries it seems sensible to run it off the car battery. This of course requires a voltage converter to avoid cooking the expensive GPS unit. Garmin provide a converter cable but again, the price strikes me as being excessive. I happened to have a regulated voltage converter for the car lighter socket and this set to 3 volts works well. I did feel that I would like to use an external power source when I connected to the computer. I have the unit on for quite long periods whilst on the computer and it seems silly to waste the batteries when power is available in the computer. I use the following circuit -
To connect to my computer I took a piece of perforated strip Veroboard. The strip spacings are 0.1" which is the same as the spacing used by USB connectors. A piece 4 strips wide may be cut to fit a USB socket perfectly. Power and Ground are then on the two outside strips. If you try this, make sure to sever the two middle strips which are the USB serial lines. These are not the simple RS232 type of serial connection used by the Geko and should not be interfered with. I am using this connection as a source of power only. There are GPS devices which will connect to USB but the Garmin Geko is not yet one of them. Connecting to the serial part of a USB socket requires a fairly complex interface and is not part of what I am describing here. This very simple device is simply to give a stable, regulated, 3v supply from a USB port and may be seen in the following photograph.
![]()
As I write this it occurs to me that a simple 20 ohm resistor in the 5 volt power line would probably work instead of the regulator circuit. However, the regulated circuit is very simple, and cheap to build, and probably safer than a simple resistor.
You may be interested to know that exactly the same LM317 circuit may be used to obtain a 3v supply from a car’s cigarette lighter socket. No change is required to resistor values. The only difference is that I would put a reasonable heat sink on the LM317 as it would have a little more power to dissipate. I would suggest using a fused plug for the lighter socket and ensure the polarity is correct.
The technical aspects of the GPS are fascinating. How does it do it? And what is it that is doing it?
The system comprises 24 operational satellites. These are arranged as groups of four spread evenly around each of 6 earth orbits. These orbits are very nearly circular and are spaced evenly around the equator, each making an angle of 55° with the equatorial plane. This arrangement ensures that between five and eight satellites are visible at any time from any point on Earth. The satellites take approximately 12 hours to complete an orbit and this means that whichever satellites are overhead at your location at midday today will be there at approximately the same time tomorrow. They will in fact be there about four minutes before midday but we are just talking in approximations. Also interesting to consider is that they will be in the same place at midnight - the problem is that you will not be. You revolve on the Earth on a 24 hour cycle so at midnight you will be half a revolution away when the satellites come back. It will take you a further 12 hours to get back and the satellites will have done another orbit in that time.
The satellites themselves are approximately 11,000 miles above the Earth’s surface. Each carries four atomic clocks giving extremely accurate timing. I have found it difficult to tie down this accuracy exactly. One article claimed it to work out as 1 second in about 30,000 years. Another claimed the timing is accurate to something like 3 billionths of a second, (0.000000003 sec), which I calculate to be an inaccuracy of less than 1 second in 100 years. Quite a difference but either way they are still very accurate clocks.
The satellites’ radio transmissions are on carrier waves in the microwave region well above 1000 megahertz and it is these transmissions which are used to enable a GPS unit to locate its position. How is that, I hear you murmur? I shall endeavour to explain.
Let me say, this is simply the principle of the location system. There are all sorts of side issues underway at the same time (mostly to reduce errors), but this I understand, to be the basic method of location.
In the initial setting up of your GPS unit it receives from the satellites, details which enable it to predict the orbits of all 24. The satellites broadcast ephemerides; these are algorithms that give spatial co-ordinates relative to the Earth’s centre. This information is held internally in your GPS unit in what is known as an almanac. It is collecting this information which takes 20 mins in the very first power up. Much the same has to happen if a radical change in position has happened between powers up. This information, for your general location, is kept updated within your system. When you switch on the unit, it is able, by using the almanac, to put on display the satellites it expects to see over your location. It looks for their transmissions. Each satellite transmits repeatedly, its own unique coded sequence. The receiver knows what these sequences are and, using its own internal clock for timing, is able to generate them for itself. On receiving a particular satellite’s signal it knows its identity and what its sequence should be. It starts to generate the sequence for itself but with an increasing delay before each generation. It compares its sequence with that being received from the satellite. At some point it gets a synchronous match. The amount of delay it had to use before starting its generation and getting the match, tells the receiver how long it takes the transmission to get from satellite to receiver. Radio waves travel at the same speed as light, i.e.186,000 miles per second. It is simple for the GPS unit to convert the time to a distance. The distances for all visible satellites may be calculated the same way. Bear in mind that the time interval over the 11,000 miles or so, is of the order of 0.06 seconds and the slightest inaccuracy in the time measurement may cause a major error in the distance estimate. The difference in the distance estimate between 0.06 and 0.0601 seconds is 18 miles. GPS gives an accuracy within feet rather than miles. This shows just how vital precise timing is to the process.
Having the distances to observable satellites how is our position found? Our known distance from one satellite describes a sphere with us somewhere on the surface. Imagine this as a bubble with the satellite at the centre and us somewhere on the surface. Each satellite will have its imaginary bubble with us on the surface. If two of the bubbles are considered, our singular position is on the surface of both, so both must intersect and we must be on the intersection. The two bubbles’ intersection will describe a circle, so we are somewhere on this circle. A third satellite gives another sphere with us on the surface. It must intersect with our circle to give two points. Only one of these will be near the Earth so that must be our location. So it takes 3 measurements to give our position in three dimensional space relative to the Earth. All of this has been assuming that our small GPS unit is capable of measuring time with the same accuracy as the satellite. Unfortunately this is not the case. Our GPS unit has only the equivalent of a digital watch. It is quite accurate but nothing like as accurate as the atomic clocks on the satellites. The distance of a fourth satellite is used to bring the GPS time to match the satellite’s. The sphere from the fourth satellite should pass through our, now known, position. The probability is that it does not. This is assumed to be due to the inaccuracy in our clock. On reception of the fourth satellite's distance, the GPS unit’s internal clock is adjusted and the position recomputed until all four spheres intersect in a single point. The result is assumed to be the final location in the three dimensions of space and the fourth dimension of time.
It is worth noticing that the simple digital GPS clock is now adjusted to the timing of the satellite's atomic clocks.
Much of the subtlety in the design of the hardware and software of the GPS is involved with reducing errors. There are quite a few possible sources. Clock errors have been mentioned. The radio signals are emanating from moving satellites and are subject to Doppler shift. There are errors possible from solar radiation. There are orbital errors due to the gravities of the Sun and Moon. There are geometric errors - ideally the two distance vectors from two satellites should subtend an angle of 90 degrees at the receiver for the most precise positional estimate. Variation above or below this angle will introduce imprecision. Let me put that another way. If two of your positional satellites are close together, the lines denoting their distances will also be very close together and finding the exact point at which they actually cross will be difficult. It is very much easier when they cross at right angles. Some other sources of error are; frequency drifting, component variation in the receiver circuits, general atmospheric conditions, signal reflections from buildings and obstructions from foliage. Bear in mind that the radio signals themselves are not very strong. The total power generated by solar panels to run the entire satellite is only 700 watts. Less than one bar of an electric fire. This drives the atomic clocks as well as the transmitters for an 11,000 mile journey. We are essentially looking at a one bar electric fire 11,000 miles away. But by far the most serious source of error is the variable time delay induced in the radio signal as it penetrates the Earth’s atmosphere. Differential GPS is a means of reducing that error.
Variable and largely unpredictable delay is introduced to the satellite’s microwave signal as it passes through the troposphere and to a greater extent through the ionosphere. Differential GPS (DGPS), is a method of reducing positional inaccuracy due to these variations. The principle is to take a fixed ground station; fixed in the sense that its position has been predetermined with great accuracy, and to measure the time taken for each of the visible Navstar satellites’ signals to reach this station. Since each satellite’s position is known from its almanac as well as the Earth station’s, the distance between the two is accurately known before ever the transmission is received. The time the signal should take may be calculated directly from the known distance. This is compared with the time the signal actually takes and a correction factor deduced. This is assumed to give a reasonable estimate of the delay from that satellite for receivers in the general area. The correction is made available to GPS users by radio transmissions from the ground stations and may then be fed into their GPS units to give improved accuracy. The Geko 201 it appears, is able to accept these corrections through its serial communication interface. I don’t have a source of this information so have not tried it for myself but it is out there and is available. The accuracy I get from the standard system is sufficient for my needs but it is nice to know there is no compromise in the little unit’s technology.
Also interesting is that at the time DGPS was developed, the Department of Defense’s inbuilt error, (Selective Availability), was active and DGPS reduced that error also. A lot of DGPS development appears to have been by private companies and I suspect that Selective Availability was the great motivation.
The Geko 201 set-up allows the use of WAAS mode - so what is it? The acronym is derived from Wide Area Augmentation System.
To improve accuracy in a specific area of need, like North America or Europe, networks of ground based stations have been set up. These are using DGPS to derive correction factors for the satellites in their area. This information is then sent to geostationary satellites which in turn transmit like the Navstar satellites but their information is differentially adjusted to local conditions and being geostationary are permanently available to receivers in the critical area.
The title WAAS applies to the US network. In Europe the equivalent system is called EGNOS (European Geostationary Navigation Overlay Service). As of present time (2004), the EGNOS system appears to be still in development.
The Geko 201, when set on WAAS reception, indicates the EGNOS adjusted satellites by putting a ‘D’ at the bottom of the signal strength column. This is to indicate a differentially adjusted reception. All this appears to operate on my system. I have only tried the WAAS system occasionally. My suspicion is that it is not yet in proper operation. I have had as many as 5 satellites showing the ‘D’ but more often I get none. Nor have I seen any dramatic increase in accuracy when they are present so I generally do not bother with it. The normal accuracy is sufficient for my needs. To save my two little AAA batteries I use the battery economy set-up and this disables WAAS. I prefer economy to accuracy. Although I have no need for the greater accuracy, it does look to be an interesting area for future investigation.
A final little gem for Geko owners. If the OK button is held down when switching on the system, a rather splendid diagnostic page appears on the display.