GPS Hardware basics for mobile developers.
4.7 (3)

Click to rate this post!
[Total: 3 Average: 4.7]

Mobile software engineers (iOS and Android), are normally not familiar with how GPS works, instead of just getting Lat/Lon readings, and doing geo operations with it, why not become familiar with how GPS works? πŸ€“

This will not be a lengthy article, it will be a chat between an iOS developer (Alex πŸ‘¨πŸ»β€πŸ’») and an electrical engineer (Sarah πŸ‘©πŸΌβ€πŸ’»).

πŸ‘¨πŸ»β€πŸ’»: So what does GPS stand for?
πŸ‘©πŸΌβ€πŸ’»: It stands for (Global Positioning System).

πŸ‘¨πŸ»β€πŸ’»: Who created it? and what for?
πŸ‘©πŸΌβ€πŸ’»: The GPS project was launched in the USA back in 1973 due to limitations of old navigation systems.

πŸ‘¨πŸ»β€πŸ’»: I know it works without internet, but do I need cellular service to use GPS?
πŸ‘©πŸΌβ€πŸ’»: No.

πŸ‘¨πŸ»β€πŸ’»: How come it works without internet or cellular service?
πŸ‘©πŸΌβ€πŸ’»: You get readings from satellites, there are about 24 artificial satellites in 6 orbits.

πŸ‘¨πŸ»β€πŸ’»: So a mobile needs to connect to all of these?
πŸ‘©πŸΌβ€πŸ’»: Of course not, when you are stationary, you need to be exposed to 3 of them, when you are moving, you will need to be exposed to 4.

GPS Satellites animation (Wikipedia)

πŸ‘¨πŸ»β€πŸ’»: So how come it identifies me? and send me data?
πŸ‘©πŸΌβ€πŸ’»: The Satellites don’t identify you, they only emit synchronous pulses all the time everywhere.

πŸ‘¨πŸ»β€πŸ’»: And how does my mobile give me back the (latitude, longitude, and altitude)?
πŸ‘©πŸΌβ€πŸ’»: It compares the receive time of these pulses from each satellite, and use calculations to determine a point on earth, since the distance between these satellites is constant, and they have atomic clocks, the calculations will not be difficult.

πŸ‘¨πŸ»β€πŸ’»: The service is totally free, and I don’t have any subscription for GPS, how?
πŸ‘©πŸΌβ€πŸ’»: GPS is not the only service for (Global Navigation Satellite Systems), there are many like (GLONASS, BeiDou, Galileo…), there are other commercial solutions that I don’t know much about, there are a lot of details, I heard retail GPS receivers are designed to not work if the tracked object is moving fastly, you get the idea 🧐?
πŸ‘¨πŸ»β€πŸ’»: ah! yes.

BeiDou doesn’t have full earth coverage.

πŸ‘¨πŸ»β€πŸ’»: What is the error margin?
πŸ‘©πŸΌβ€πŸ’»: It’s variable, but you can say between 15 to 50 meters, some commercial systems use other inertial systems to give more accurate estimations.

πŸ‘¨πŸ»β€πŸ’»: What is the minimum detectable value?
πŸ‘©πŸΌβ€πŸ’»: You mean the resolution? theoretically, as far as I know, it’s one inch, but practically it’s about 3 meters.

πŸ‘¨πŸ»β€πŸ’»: I once tried to use the GPS inside a big hospital, it didn’t serve any purpose, the readings were not accurate.
πŸ‘©πŸΌβ€πŸ’»: GPS does not work indoors.
πŸ‘¨πŸ»β€πŸ’»: But I saw some readings on my maps application.
πŸ‘©πŸΌβ€πŸ’»: it’s the last point that was read, some devices like Huawei also augment (Accel/Gyro) sensor data, to mimic a basic INS to give your readings inside buildings, but it’s not reliable.

πŸ‘¨πŸ»β€πŸ’»: And what is used for indoor navigation systems?
πŸ‘©πŸΌβ€πŸ’»: They use beacons and Bluetooth and other technologies, read about apple air tags!

πŸ‘¨πŸ»β€πŸ’»: You mentioned sensors, why can’t we use the basic sensors like accelerometer/gyroscope of the mobile to calculate the position?
πŸ‘©πŸΌβ€πŸ’»: when you “integrate” the acceleration twice, the error will explode fastly, and it will become useless in a short time of movement, even if this works, this will not give you an absolute position, and you have to deal with drifting and gimbal lock and a lot of complexities.

πŸ‘¨πŸ»β€πŸ’»: That was a lot of information, thank you.
πŸ‘©πŸΌβ€πŸ’»: Welcome!, see you soon.