Connecting VK16E GPS With Arduino UNO
by alaspuresujay in Circuits > Arduino
1256 Views, 1 Favorites, 0 Comments
Connecting VK16E GPS With Arduino UNO
This is a simple Instructable for the people who'd like to know how to connect and use their GPS module with an Arduino.
I am using an Arduino UNO Shield #Hackduino and an VK16E GPS module.
for more info refer the datasheet.
Downloads
Circuit Connection
BLACK wire to Ultimate board Gnd connection
RED wire to Ultimate board 5V connection
BLUE wire to Ultimate board RxD connection
GREEN wire to Ultimate board TxD connection
WHITE wire to Ultimate board PPS connection
As per our code
connect
RXPin of board to digitalPin 4,
TXPin of board to digitalPin 3
Vcc to 5v and GND to GND
Programming
First of all you need is a library:
You can download from here
After installing library in the arduino open DeviceExample.ino from examples> tinyGPS++
or copy the below code simply.
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
/* * https://alaspuresujay.github.io/ * follow me on instagram https://www.instagram.com/alaspuresujay * This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object. It requires the use of SoftwareSerial, and assumes that you have a 9600-baud serial GPS device hooked up on pins 4(rx) and 3(tx). */ static const int RXPin = 4, TXPin = 3; static const uint32_t GPSBaud = 9600;// The TinyGPS++ object TinyGPSPlus gps;
// The serial connection to the GPS device SoftwareSerial ss(RXPin, TXPin);
void setup() { Serial.begin(115200); ss.begin(GPSBaud);
Serial.println(F("DeviceExample.ino")); Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module")); Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion()); Serial.println(F("by Sujay Alaspure")); Serial.println(); }
void loop() { // This sketch displays information every time a new sentence is correctly encoded. while (ss.available() > 0) if (gps.encode(ss.read())) displayInfo();
if (millis() > 5000 && gps.charsProcessed() < 10) { Serial.println(F("No GPS detected: check wiring.")); while(true); } }
void displayInfo() {
float latt=gps.location.lat(); Serial.print(gps.location.lat(),10); Serial.print(F(",")); Serial.print(gps.location.lng(), 10); Serial.print(" "); Serial.print(latt,10);
Serial.print(F("Location: ")); if (gps.location.isValid()) { Serial.print(gps.location.lat(), 6); Serial.print(F(",")); Serial.print(gps.location.lng(), 6); } else { Serial.print(F("INVALID")); }
Serial.print(F(" Date/Time: ")); if (gps.date.isValid()) { Serial.print(gps.date.month()); Serial.print(F("/")); Serial.print(gps.date.day()); Serial.print(F("/")); Serial.print(gps.date.year()); } else { Serial.print(F("INVALID")); }
Serial.print(F(" ")); if (gps.time.isValid()) { if (gps.time.hour() < 10) Serial.print(F("0")); Serial.print(gps.time.hour()); Serial.print(F(":")); if (gps.time.minute() < 10) Serial.print(F("0")); Serial.print(gps.time.minute()); Serial.print(F(":")); if (gps.time.second() < 10) Serial.print(F("0")); Serial.print(gps.time.second()); Serial.print(F(".")); if (gps.time.centisecond() < 10) Serial.print(F("0")); Serial.print(gps.time.centisecond()); } else { Serial.print(F("INVALID")); }
Serial.println(); }
Notes:
Please place the GPS module outside your house or at the window.
- Inexpensive GPS modules such as the VK16E do not have very accurate 1pps signals.
- You will probably find that like many GPS modules that use a patch antenna, the GPS module may need to be by a window or outside. GPS signals seem to vary substantially in strength depending on location and surrounding buildings etc. The GPS module may also benefit from being further away from the Ultimate kit, depending on your shack layout and grounding. For this reason you may want to connect the GPS module to the kit using several metres of wire. I recommend the use of a screened cable with the screen connected to Gnd. 4)
- The Module has a Green LED as shown in the pictures above, which is continuously ON while the GPS module is searching for satellite lock, and flashes at 1 pulse per second when locked.
how to check location on google map just use below link
https://maps.google.com/?q=<lat>,<lng>
lat-> lattitude
lng->longitude