Connecting Skylab SKM53 GPS module with Arduino and Demo code

background image

Tutorial on

Using SKM53 GPS

with

Arduino

By doing this tutorial you should have some sample output like this:

Latitude : 30.330136 :: Longitude : 31.057404
Latitude : 30.330092 :: Longitude : 31.057339
Latitude : 30.330059 :: Longitude : 31.057275
Latitude : 30.329994 :: Longitude : 31.057146

Future Electronics Egypt Ltd. (Arduino Egypt).

background image

How to connect

Skylab SKM53 GPS

to Arduino

1)Connect RXD GPS Pin to Arduino Pin 3
2)Connect TXD GPS Pin to Arduino Pin 2
3)Connect GND GPS Pin to Arduino Ground
4)Connect VCC GPS to 5 VDC
5)Make sure to download TinyGPS.h library file to your
Arduino/Libraries folder. You can download it from this
link:
!

http://arduiniana.org/TinyGPS/TinyGPS10.zip

.

6)Make sure to download NewSoftSerial.h library file to
your Arduino/Libraries folder. You can download it from
this link:

http://arduiniana.org/libraries/newsoftserial/

7)Upload the Arduino code below.

It is easy to get this data on character LCD, please
check

Future Electronics Egypt Tutorial for connecting

Arduino with LCD

Arduino Code For Skylab SKM53 GPS

#include <TinyGPS.h>
#include <NewSoftSerial.h>

unsigned long fix_age;

NewSoftSerial GPS(2,3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;

Future Electronics Egypt Ltd. (Arduino Egypt).

background image

void setup(){
GPS.begin(9600);
Serial.begin(115200);
}

void loop(){
long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;

// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);

// time in hh:mm:ss, date in dd/mm/yy
/*gps.get_datetime(&date, &time, &fix_age);
year = date % 100;
month = (date / 100) % 100;
day = date / 10000;
hour = time / 1000000;
minute = (time / 10000) % 100;
second = (time / 100) % 100;
Serial.print("Date: ");
Serial.print(year); Serial.print("/");
Serial.print(month); Serial.print("/");
Serial.print(day);
Serial.print(" :: Time: ");
Serial.print(hour); Serial.print(":");
Serial.print(minute); Serial.print(":");
Serial.println(second);
*/
getGPS();
Serial.print("Latitude : ");
Serial.print(LAT/100000,7);
Serial.print(" :: Longitude : ");
Serial.println(LON/100000,7);
}

void getGPS(){
bool newdata = false;
unsigned long start = millis();
// Every 1 seconds we print an update
while (millis() - start < 1000)
{
if (feedgps ()){
newdata = true;

Future Electronics Egypt Ltd. (Arduino Egypt).

background image

}
}
if (newdata)
{
gpsdump(gps);
}
}

bool feedgps(){
while (GPS.available())
{
if (gps.encode(GPS.read()))
return true;
}
return 0;
}

void gpsdump(TinyGPS &gps)
{
//byte month, day, hour, minute, second, hundredths;
gps.get_position(&lat, &lon);
LAT = lat;
LON = lon;
{
feedgps(); // If we don't feed the gps during this long
routine, we may drop characters and get checksum errors
}
}

Future Electronics Egypt Ltd. (Arduino Egypt).


Wyszukiwarka

Podobne podstrony:
8 3 2 7 Lab Testing Network Connectivity with Ping and Traceroute
Farina Reproduction of auditorium spatial impression with binaural and stereophonic sound systems
11 3 2 3 Lab Testing Network Latency with Ping and Traceroute
Getting Started with Arduino
Business Process Modeling with EPC and UML
Getting Started with Arduino Table of Contents
M Kaufmann Programming Cameras and Pan tilts With DirectX and Java fly (2)
Applying Principles of Neurodevelopment to Clinical Work with Maltreated and Traumatized Children
Farina Reproduction of auditorium spatial impression with binaural and stereophonic sound systems
Verbs Adjectives Nouns with Prepositions Q AND R
Applying Principles of Neurodevelopment to Clinical Work with Maltreated and Traumatized Children
DIAGNOSIS MODE VEHICLES WITH RADIO AND CD PLAYER
Verbs Adjectives Nouns with Prepositions C AND D
IRREGULAR VERBS with deffinitions and examples
IBM Using Ajax with PHP and Sajax (2005)
FIDE Trainers Surveys 2013 05 22, Karsten Müller Endgames with Rook and minor piece against Rook an
#1011 Building with Wood and Metal
Building Autonomous Line Followers using Arduino and PID
#0445 – Problems with Drugs and Medical Devices

więcej podobnych podstron