November 09, 2019

GPS Module Neo-6M Interface with Arduino


This project is about the interfacing of a GPS module with Arduino UNO. The data for longitude, latitude with date and time is displayed on Serial Terminal.

Components Required:
1.     Arduino Uno
2.     Ublox NEO-6m GPS module
3.     Data Cable
4.     Jumper wires

Now, What is GPS?
The Global Positioning System (GPS) is a satellite-based navigation system made up of at least 24 satellites. GPS works in any weather condition, anywhere in the world, 24 hours a day, with no subscription fees or setup charges.

How GPS works?
GPS satellites circle the Earth twice a day in a precise orbit. Each satellite transmits a unique signal and orbital parameters that allow GPS devices to decode and compute the precise location of the satellite. GPS receivers use this information and trilateration to calculate a user's exact location. Essentially, the GPS receiver measures the distance to each satellite by the amount of time it takes to receive a transmitted signal. With distance measurements from a few more satellites, the receiver can determine a user's position and display it.
To calculate your 2-D position (latitude and longitude) and track movement, a GPS receiver must be locked on to the signal of at least 3 satellites. With 4 or more satellites in view, the receiver can determine your 3-D position (latitude, longitude, and altitude). Generally, a GPS receiver will track 8 or more satellites, but that depends on the time of day and where you are on the earth.
Once your position has been determined, the GPS unit can calculate other information, such as:
  • Speed
  • Bearing
  • Track
  • Trip dist
  • Distance to destination

What's the signal?
GPS satellites transmit at least 2 low-power radio signals. The signals travel by line of sight, meaning they will pass through clouds, glass, and plastic but will not go through most solid objects, such as buildings and mountains. However, modern receivers are more sensitive and can usually track through houses.
A GPS signal contains 3 different types of information:
·      Pseudorandom code is an I.D. code that identifies which satellite is transmitting information. You can see which satellites you are getting signals from on your device's satellite page.
·      Ephemeris data is needed to determine a satellite's position and gives important information about the health of a satellite, current date and time.
·      Almanac data tells the GPS receiver where each GPS satellite should be at any time throughout the day and shows the orbital information for that satellite and every other satellite in the system.

NEO-6M GPS Module
The NEO-6M GPS module is shown in the figure below. It comes with an external antenna and does not come with header pins. So you will need to solder it.

Overview of NEO-6M GPS Module
NEO-6M GPS Chip:
The heart of the module is a NEO-6M GPS chip from u-blox. It can track up to 22  satellites on 50 channels and achieves the industry’s highest level of sensitivity i.e. - 161 dB tracking while consuming only 45mA supply current. The u-blox 6 positioning engine also boasts a Time-To-First-Fix (TTFF) of under 1 second. One of the best features the chip provides is Power Save Mode (PSM). It allows a reduction in system power consumption by selectively switching parts of the receiver ON and OFF. This dramatically reduces the power consumption of the module to just 11mA making it suitable for power-sensitive applications like GPS wristwatch. The necessary data pins of NEO-6M GPS chip are broken out to a "0.1″ pitch headers. This includes pins required for communication with a microcontroller over UART.
Note:- The module supports the baud rate from 4800bps to 230400bps with a default baud of 9600.
Position Fix LED Indicator:
There is an LED on the NEO-6M GPS Module which indicates the status of Position Fix. It’ll blink at various rates depending on what state it’s in
  • No Blinking ==> means It is searching for satellites
  • Blink every 1s – means Position Fix is found
3.3V LDO Regulator:
The operating voltage of the NEO-6M chip is from 2.7 to 3.6V. But, the module comes with MIC5205 ultra-low dropout 3V3 regulator from MICREL. The logic pins are also 5-volt tolerant, so we can easily connect it to an Arduino or any 5V logic microcontroller without using any logic level converter.
Battery & EEPROM:
The module is equipped with an HK24C32 two-wire serial EEPROM. It is 4KB in size and connected to the NEO-6M chip via I2C. The module also contains a rechargeable button battery which acts as a super-capacitor.
An EEPROM together with a battery helps retain the battery-backed RAM (BBR). The BBR contains clock data, the latest position data (GNSS orbit data), and module configuration. But it is not meant for permanent data storage.
As the battery retains the clock and last position, the time to first fix (TTFF) significantly reduces to 1s. This allows much faster position locks.
Without the battery, the GPS always cold-start so the initial GPS lock takes more time. The battery is automatically charged when power is applied and maintains data for up to two weeks without power.
Pinout:
  • GND is the Ground Pin and needs to be connected to the GND pin on the Arduino.
  • TxD (Transmitter) pin is used for serial communication.
  • RxD (Receiver) pin is used for serial communication.
  • VCC supplies power for the module. You can directly connect it to the 5V pin on the Arduino.



TinyGPS++ LIBRARY
TinyGPS++.h is the library that you have to include in your Arduino program. Download the library from the link below:
https://drive.google.com/open?id=17ZRw598fU3N3uw-BceS72v5YdqC5uqC7

Functions under this library
gps = object name

gps.encode(gpsdata) ----- Encodes the data coming out from GPS Module

gps.location.isValid() ---- Checks the Validity of Location, Date, Time
gps.date.isValid()
gps.time.isValid()

gps.location.lat() --------- Gives the value of Location
gps.location.lng()

gps.date.day() ------------- Gives the value of Date
gps.date.month()
gps.date.year()

gps.time.hour() ----------- Gives the value of Time
gps.time.minute()
gps.time.second()


Video Example:



Source Code:

No comments:

Post a Comment