Introduction: How to Interface GPS Module (NEO-6m) With Arduino
In this project, I have shown how to interface a GPS module with Arduino UNO. The data for longitude and latitude is displayed on the LCD and location can be viewed on app.
List of material
- Arduino Uno ==> $8
- Ublox NEO-6m GPS module ==> $15
- 16x2 LCD ==> $3
- Breadboard ==> $2
- Jumper wires ==>$2
The total cost of project is $30 dollars.
Step 1: About GPS
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 conditions, 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:
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.
Step 2: Arduino,Neo6m GPS and 16x2 LCD
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.
Required libraries for GPS to work in Arduino IDE.
You can also make your own custom Arduino uno.
2. NEO-6m GPS module (as shown in image i2)
3. 16x2 LCD
LCD(Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.
Pin diagram and pin description (as shown in image i3 and i4)
4-bit and 8-bit Mode of LCD
The LCD can work in two different modes, namely the 4-bit mode and the 8-bit mode. In 4 bit mode we send the data nibble by nibble, first upper nibble and then lower nibble. For those of you who don’t know what a nibble is: a nibble is a group of four bits, so the lower four bits (D0-D3) of a byte form the lower nibble while the upper four bits (D4-D7) of a byte form the higher nibble. This enables us to send 8 bit data.Whereas in 8 bit mode we can send the 8-bit data directly in one stroke since we use all the 8 data lines.
Read and Write Mode of LCD
The LCD itself consists of an Interface IC. The MCU can either read or write to this interface IC. Most of the times we will be just writing to the IC, since reading will make it more complex and such scenarios are very rare. Information like position of cursor, status completion interrupts etc.
Step 3: Connections
Interfacing of GPS module with Arduino
Arduino ===> NEO6m
GND ===> GND
Digital pin (D3) ===> TX
Digital pin (D4) ===> RX
5Vdc ===> Vcc
Here, I suggest you to use external power supply to power the GPS module because minimum power requirement for GPS module to work is 3.3 V and Arduino is not capable of providing that much voltage.To provide voltage use prolific USB TTL as shown in fig i5.
One more thing I have found while working with GPS antenna comes with module is its not receiving signal inside the house so I used this antenna - it's much better.
For connecting this antenna, you have to use connector shown in image i6.
Interfacing of Arduino UNO and JHD162a LCD
LCD ===> Arduino Uno
VSS ===> GND
VCC ===> 5V
VEE ===> 10K Resistor
RS ===> A0 (Analog pin)
R/W ===> GND
E ===> A1
D4 ===> A2
D5 ===> A3
D6 ===> A4
D7 ===> A5
LED+ ===> VCC
LED- ===> GND
Step 4: Visual Studio
In Visual Studio, I have made an application in which current GPS location can be find.Its only work when it is connected serially with PC or laptop.
If you want to make some changes in application, you can do it by opening sln file in Visual Studio (2012 and above) or you can directly install setup and use it.Application look like as shown in image i7.
Step 5: Result
Step 6: Demo
Step 7: Program
Step 8: Schematic
We have a be nice policy.
Please be positive and constructive.