GPS Bee Kit (Part 2)

In my previous article, GPS Bee Kit (Part 1), I have shown a few methods how to read NMEA messages directly from your computer without an Arduino. In this post, I will explain some basics of the NMEA message and how to make a simple interface with Arduino and GPE Bee Kit.


NMEA stands for National Marine Electronics Association. For GPS Bee Kit, it uses NMEA 0183 protocol. Let us look at the message received from Hyperterminal previously.

Received data from GPS at Hyperterminal

Notice that all the message starts with a dollar sign, ‘$’. The next two characters after $ identifies the talker and the next three characters after talker identifies the type of message. After the identifier, you will get the data with respect to the type of message. Each different data are separated by comma sign, ‘,’. At the end of NMEA string you will see an aterisk, ‘*’ follow by two digits of hexadecimal number which represents the checksum. The NMEA string actually ends after the checksum with , carriage return and line feed.

NMEA sentence and description

An example on getting the informations from NMEA message:


UTC time ( – 1445528.00

Latitude of position – 0509.11823

North/South – N

Longitude of position – 10029.71011

East/West – E

Fix Quality – 1

Number of Satellites in use – 06

Horizontal dilution of precision – 1.41

Antenna altitude above mean-sea-level – 24.4

Units of antenna altitude – M (meter)

Geoidal seperation – -14.4

Units of geoidal seperation – M (meter)

Checksum – *47

For more details on GPS NMEA sentence, visit here. This link explained very detail for each NMEA sentence, highly recommended.

When you get all the geographic coordinate data, which is the latitude and longitude, how can you verify it? If you are unclear with geographic coordinate system, Wiki has a good explanation on it. Now, I am going to show you how to verify your location with Google Map. Go to

gm2First, search for your location on Google Map.

gm3Next, right click on the point you would like to get the location. Click on “What’s Here?”.

gm1Finally you will have the latitude and longitude coordinate on top of the search bar.

Before this, I have shown how to test GPS data with several software. Now, I am going to show you how you can test and read the NMEA messages with an Arduino.

Sample sketch:

#include <SoftwareSerial.h>

SoftwareSerial ss(2,3);

void setup()

void loop()


Code explanation:

First I used software serial to read data from GPS, then I used the built in serial port on Arduino to display the data through serial monitor.

You need to include SoftwareSerial.h library in order to use it. It works almost the same as Serial in Arduino.

At the beginning of your program, you need to initialize which pins are you going to use for software serial. Then in your setup() function, you need to declare the baud rate of serial communication. Then you can read data just like how you used in Serial function.

SoftwareSerial ss(rx,tx)

– Initialize SoftwareSerial with pins associated for receiver (Rx) and transmitter (Tx).


– Initialize the baud rate for software serial communication


– Check if received any data

– Reads incoming serial data

For the next part, I am going to use one of the library available for Arduino, which is TinyGPS. You can download TinyGPS library here. This library ease your job to get all the information from GPS data.

Sample sketch on using TinyGPS library.

#include <SoftwareSerial.h>

#include <TinyGPS.h>

TinyGPS gps;
SoftwareSerial ss(2,3);

boolean newData=false;
float flat,flon,velocity;
int year;byte month,day,hour,minute,second;
char lat_dir,long_dir;
unsigned long speed,course;

void setup()

void loop()

 if(flat>0)lat_dir='N';else lat_dir='S';
 if(flon>0)long_dir='E';else long_dir='W';
 Serial.print("Lat: ");Serial.print(flat);Serial.print(lat_dir);Serial.print("\t");
 Serial.print("Long: ");Serial.print(flon);Serial.print(long_dir);Serial.print("\t");
 Serial.print("Date: ");Serial.print(day);Serial.print("/");Serial.print(month);
 Serial.print("Time: ");Serial.print(hour);Serial.print(":");Serial.print(minute);
 Serial.print("Velocity: ");Serial.print(velocity);Serial.print(" m/s");Serial.print("\t");


Code explanation:

To get all the information with the library, you need to read from the software serial first. Therefore, a char c is used to store the data received in serial pin. Then you need to encode the data received. It will return TRUE if the sentence received is valid. After the encode part is done, you can extract all the informations from the GPS.


– Encode the serial data and returns true if the sentence is valid.


– Retrieves latitude and longitude information.


– Retrieves each data and time informations in separate variables.


– Retrieves date in the format of ddmmyy, and time in the format of hhmmsscc.


– Retrieves the speed information from GPS. Some other available speed information with conversion:

gps.f_speed_knots()  -> speed in knots

gps.f_speed_kmph()   -> speed in km/hr

gps.f_speed_mps()    -> speed in m/s

gps.f_speed_mph()    -> speed in miles/hr

My first test without velocity details
Velocity added.
Still in stationary.
Moving along with GPS, velocity increased

I was actually cycling with one hand controlling the bicycle and the other hand holding my laptop together with GPS to test the velocity. That was tough! I should consider making all the data display on LCD perhaps, instead of serial monitor next time.

Some images of my final set up on Arduino:

GPS Bee switched on. Power LED lights up.
The breadboard and Arduino are fitted in a box
GPS Bee kit
Antenna attached on the outer layer of box, to ease the GPS receiving
Arduino and GPS Bee Kit on breadboard

Basically the Part 1 and Part 2 will provide sufficient information to understand how a GPS module works and how to use it with Arduino. I hope that all the information provided can help your understanding on GPS. If there is any suggestion or information to add on, or even any questions, kindly drop me a comment below. Of course, you can also share your GPS experience and ideas too.

Enjoy Arduino!


4 thoughts on “GPS Bee Kit (Part 2)

  1. hi ,i got new gps bee kit and attached to double bees shield. i try your code but it doesnt work. just blank serial monitor. what happened? *sorry about my english*

    1. Hi, I never used double bees shield before. Does it allows you to use the simple serial communication (tx and Rx).

      Also you need to test it outdoor to get actual data. You are not going to get anything indoor.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s