# How do GPS devices work?

I have GPS in my phone but I have only a very rough idea of how it works. I have checked the Wikipedia article but that gone over my head (I can not understand that maths and other strange stuff there). Please explain its working in simple words.

What I think is that it sends signal to satellites, satellite checks the location of sending device and reply with the location of that device.

• Your phone does not send anything to the satellites, it receives broadcast signals from them. – dmckee --- ex-moderator kitten Aug 1 '11 at 15:08
• @dmckee Maybe not on his phone, but the GPS device in general would be built to send data as well. Otherwise how could the military use them as tracking devices? :) – MGZero Aug 1 '11 at 15:45
• Oh yes, how the military use them as tracking devices if these are only receivers? – SMUsamaShah Aug 1 '11 at 16:11
• @MGZero: The tracking devices have separate transmitters attached. Your basic GPS unit is a receiver. Indeed for military applications the last thing you would want is for every unit on the field to be running around with a transmitter running every time they wanted to know where they were! – dmckee --- ex-moderator kitten Aug 1 '11 at 16:27
• What's wrong with this section of the Wikipedia article? – Emilio Pisanty Oct 1 '13 at 13:20

## 4 Answers

GPS signal is actually a time signal. Each satellite sends data that includes:

• time according to the satellite's clock
• location of the satellite (or data where the location can be calculated)
• some error correction data

Now, the receiver calculates the distance to the satellites: distance = time * velocity. Velocity is a known constant (+- the error correction). The receiver then gets multiple distances to different satellites so it can calculate the its location.

Note that four distances to known locations (satellites) are enough to determine the location of the receiver. Imagine that you tie four strings to four different stationary objects and other ends of the strings to your finger. There is only one (or none) position where all the strings are tight.

To be more accurate, the time in the above equation is relative to the time of the other satellites. In short, you need one satellite to be your reference time. The longer explanation is that there is an additional free parameter which requires you to solve a group of equations. See comments and Ibrahims answer for more details.

• own time signal and its location what does that mean? What is time signal? Is it only time signal or it also send the location (location of satellite?) with it? – SMUsamaShah Aug 1 '11 at 15:19
• Time signal is the time of the satellite's clock. Together with the time there is also the location of the satellite. There is also some other data (error correction etc.), but these two are two are the essential ones. I will clarify the answer a bit. – Juha Aug 1 '11 at 15:36
• Actually, distances to only three locations are needed to fix a position in space (up to possible discrete ambiguities). The fourth satellite signal is really needed to solve for the clock offset of the GPS receiver ( the receiver has a much less accurate clock than the transmitting satellites). – user1631 Aug 1 '11 at 22:23
• An application in my phone shows accuracy of 2m if it detects 11 satellites. – SMUsamaShah Aug 2 '11 at 10:50
• @user1631: I was thinking whether I write 3 or 4. 4 is mathematically correct, 3 is correct if you assume you are on earth and the three satellites are not exactly half a globe from you (you are on north pole and satellites are on equator, result can be that you are on south pole). As you said, up to possible discrete ambiguities ;). – Juha Aug 2 '11 at 14:26

There are 24 satellites around the world each of them transmit:

• The current time on their clock
• Their location relative to earth

The distance between us and a satellite must be equal to the difference in time it took to receive the data sent by the satellite multiplied by speed of light(c). d=(t2-t1)*c.

Remember how in math the distance between two points is d = sqrt((x1-x2)^2+(y1-y2)^2)). The same equation is used but now we have x,y,z instead of just x,y.

Looks like we have 3 unknowns which is the position of the receiver (x,y,z). However there is a bias in the time due to relativity and computational delays. Since the value of c is so big, it can create large errors, we treat this bias as an unknown as well.

So we have unknowns we need four equations to solve the problem. Therefore we use the distance equation with 4 different satellites. We get four non-linear equations, which is a minimum to lock your position, but if there are more satellites available more equations can be used to give better results.

These equations are solved iteratively since they are non-linear. You cannot used the elimination and back-substitution method(which is taught in school math classes). The processor repeatedly solves the set of equations using an initial guess and each time using results of the previous iteration as the guess to get better results until it reaches a point where another iteration gives a very small change.

• Thanks, you have added some more detail to Juha's answer – SMUsamaShah Aug 2 '11 at 17:58
• No problem, I actually implemented this algorithm in MATLAB for my research. – Ibrahim Muhammad Aug 10 '11 at 20:23

GPS receivers calculate position first in a coordinate system known as ECEF XYZ. That just means Earth Centered Earth Fixed xyz. The WGS84 defined center of the earth is given the coordinates 0,0,0. The x-axis extends from that center, to a point at the equator where the longitude is 0 and of course, in the negative direction to a point at the equator where the longitude is 180 degrees. The y-axis extends from the origin at the center of the earth, to a point at the equator where the longitude is 90 degrees east (for the + direction) and longitude 90 degrees west (for the -direction). Lastly, the z-axis is the same as the earth's polar axis. That is, it extends to the north pole (+) and to the south pole (-). This is all fine and dandy, but if I gave you coordinates of a position in this coordinate system, few people would be able to tell even roughly where that was. We're all much more familiar with latitude, longitude and elevation. So usually, GPS manufacturers will translate the ECEF XYZ coordinates to lat/lon/elev coordinates that we can understand. For latitude and longitude.

GPS receivers are just that. your phone transmits its location when it does its handshake to the closest cellular antenna.

I think it should be mentioned that the (atomic) clocks on the satellites are running (ticking) faster than the clocks on the Earth's surface due to the relativistic effects - time dilation due to the satellite's motion relative to the Earth (Time dilation) and due to the difference between the gravitational potential on satellite's orbit and at Earth's surface (Gravitational time dilation).

Engineers must take these small effects into account, otherwise the GPS wouldn't give you your correct location (the time difference on clocks will continuously grow with time so the position errors will grow too and the GPS will become worthless as a navigational system).