Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-GPS Positioning

Prepare

Hardware

Required hardware as below:

  • Duinopeak SIM808 GPRS/GSM+GPS+Bluetooth all in one Shield
  • Active GPS Antenna
  • An Peakduino UNO or Arduino UNO
  • USB cable for your Peakduino UNO or Arduino UNO
  • 12V/9V/1.5A Power supply

Software

  • Arduino IDE(recommended version 1.56r2 or above)
  • Libraries for Duinopeak SIM808 Shield (For Duinopeak_Arduino_SIMCom libarary please download here, or on github)

Make sure your got everyting, let’s get started.

First of all we need hook up the hardware as below.

Note:

  • Make sure your external antenna has a good sight to receive the GPS signal, put the antenna outside the window of your room is need for this step.
  • The sketch use Software Serial PIN_TX 2,PIN_RX 3, so make sure you set the Serial jumper in correct postion.
  • Remember to plug the external power supply to your Arduino/Peakduino UNO, if you use Peakduino the VIN led should be light up.

Now setup the programming environment. You need install the Duinopeak_Arduino_SIMCOM libarary files first, then load the test sketch and upload to your Peakduino/Arduino UNO.

Here’s a quick example, which uses the Duinopeak_Arduino_SIMCom library to parse NMEA strings for position, altitude, time, and date.

#include “SIM900.h”
#include <SoftwareSerial.h>
//#include “inetGSM.h”
//#include “sms.h”
//#include “call.h”
#include “gps.h”

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.duinopeak.com
//this code is based on the example of Arduino Labs.

//Simple sketch to start a connection as client.

//InetGSM inet;
//CallGSM call;
//SMSGSM sms;
GPSGSM gps;

char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];

char stat;
char inSerial[20];
int i = 0;
boolean started = false;
#define BAUDRATE  9600

void setup()
{
//Serial connection.
Serial.begin(BAUDRATE);
Serial.println(“SIM808 Shield GPS testing.”);
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(BAUDRATE)) {
Serial.println(“\nstatus=READY”);
gsm.forceON();    //To ensure that SIM908 is not only in charge mode
started = true;
} else Serial.println(“\nstatus=IDLE”);

if (started) {
if (gps.attachGPS()) //GPS attach
Serial.println(“status=GPSREADY”);
else Serial.println(“status=ERROR”);
stat = gps.getStat();
while (stat != 3 && stat != 2) {
stat = gps.getStat();
if (stat == 1)
Serial.println(“NOT FIXED”);
else if (stat == 0)
Serial.println(“GPS OFF”);
else if (stat == 2)
Serial.println(“2D FIXED”);
else if (stat == 3)
Serial.println(“3D FIXED”);
delay(3000);
}
delay(3000);
//Get data from GPS
gps.getPar(lon, lat, alt, time, vel);
Serial.println(lon);
Serial.println(lat);
Serial.println(alt);
Serial.println(time);
Serial.println(vel);
}
};

void loop()
{
//Read for new byte on serial hardware,
//and write them on NewSoftSerial.
serialhwread();
//Read for new byte on NewSoftSerial.
serialswread();
};

void serialhwread()
{
i = 0;
if (Serial.available() > 0) {
while (Serial.available() > 0) {
inSerial[i] = (Serial.read());
delay(10);
i++;
}

inSerial[i] = ‘\0’;
if (!strcmp(inSerial, “/END”)) {
Serial.println(“_”);
inSerial[0] = 0x1a;
inSerial[1] = ‘\0’;
gsm.SimpleWriteln(inSerial);
}
//Send a saved AT command using serial port.
if (!strcmp(inSerial, “TEST”)) {
//      Serial.println(“BATTERY TEST 1”);
//      gps.getBattInf(msg1,msg2);
//      Serial.println(msg1);
//      Serial.println(msg2);
//      Serial.println(“BATTERY TEST 2”);
//      gps.getBattTVol(msg1);
//      Serial.println(msg1);
stat = gps.getStat();
if (stat == 1)
Serial.println(“NOT FIXED”);
else if (stat == 0)
Serial.println(“GPS OFF”);
else if (stat == 2)
Serial.println(“2D FIXED”);
else if (stat == 3)
Serial.println(“3D FIXED”);
}
//Read last message saved.
if (!strcmp(inSerial, “MSG”)) {
Serial.println(msg1);
} else {
Serial.println(inSerial);
gsm.SimpleWriteln(inSerial);
}
inSerial[0] = ‘\0’;
}
}

void serialswread()
{
gsm.SimpleRead();
}

Open Arduino IDE and load the KZB_0030_SIM808_GPS sketch and upload to your Peakduino/Arduino.

Open the serial monitor when upload done, you will see the SIM808 shield automatic powering on and the status LED(important) light up, as below image.

If not check the pwr jumper location on the shield back side.

Then the program wait for 2D/3D fixing signal, this will taken 20 seconds-5 mins depending on your GPS signal strength. A successful fixed GPS postioning will look something like this:

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Call up

Make sure your got everyting ready, if not see Hookup Guide and AT Commands Simple Test, let’s get started.

First of all we need hook up the hardware as below.

Hook up the shield. Insert the SIM card and make sure the power pin solder jumper closed.

Remember to plug the external power supply to your Arduino/Peakduino UNO, if you use Peakduino the VIN led should be light up.

Now open the Arduino IDE and load the GPRS Call Up Test sketch and upload to your Peakduino/Arduino UNO.

/*
GPRS Call Up Test

This sketch is used to test seeeduino GPRS_Shield’s callUp function.
to make it work, you should insert SIM card to Duinopeak GPRS
and replace the phoneNumber,enjoy it!

create on 2015/12/5, version: 0.1
by kevin liu(lryain.master@gmail.com)
*/

#include “SIM900.h”
#include <SoftwareSerial.h>
//We don’t need the http functions. So we can disable the next line.
//#include “inetGSM.h”
#include “sms.h”
#include “call.h”

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.duinopeak.com
//this code is based on the example of Arduino Labs.

//Simple sketch to call up

//We have to create the classes for SMSs and calls.
CallGSM call;
SMSGSM sms;

char number[20];
char phoneNumber[20] = “10086”;
byte stat = 0;
int value = 0;
int pin = 1;
char value_str[5];
#define BAUDRATE  9600

void setup()
{
//Serial connection.
Serial.begin(BAUDRATE);
Serial.println(“SIM808 Shield Call up testing.”);
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(BAUDRATE))
Serial.println(“\nstatus=READY”);
else Serial.println(“\nstatus=IDLE”);
delay(3000);
Serial.println(“start to call …”);
call.Call(phoneNumber);
delay(30000);
Serial.println(“end up the call …”);

}

void loop() {
//nothing to do
}

O

Open the serial monitor when upload done, you will see the SIM808 shield automatic powering on and the status LED(important) light up, as below image.

 

Now, you should hear the ring up tones.

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Hookup and Simple Test

As we know, this Duinopeak SIM808 Shield design for use as an extension board of Peakduino/Arduino UNO, and it requires a external power supply.

Prepare

Hardware

Required hardware as below:

  • Duinopeak SIM808 GPRS/GSM+GPS+Bluetooth all in one Shield
  • GSM/GPRS Antenna
  • SIM Card converter set
  • Your A Smart phone headset(with microphone)
  • Your SIM card
  • An Peakduino UNO or Arduino UNO
  • USB cable for your Peakduino UNO or Arduino UNO
  • 12V/9V/1.5A Power supply

Software

  • Arduino IDE(recommended version 1.56r2 or above)
  • Libraries for Duinopeak SIM808 Shield (For GPRS libarary please download here, or on github)

Make sure your got everyting, let’s get started.

First of all we need hook up the hardware as below.

Hook up the shield. Insert the SIM card and make sure the power pin solder jumper closed.

Remember to plug the external power supply to your Arduino/Peakduino UNO, if you use Peakduino the VIN led should be light up.

Now setup the programming environment. You need install the libarary files first, then load the test sketch and upload to your Peakduino/Arduino UNO.

#include “SIM900.h”
#include <SoftwareSerial.h>
//#include “inetGSM.h”
//#include “sms.h”
//#include “call.h”

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.duinopeak.com
//this code is based on the example of Arduino Labs.

//Simple sketch to communicate with SIM900 through AT commands.

//InetGSM inet;
//CallGSM call;
//SMSGSM sms;

int numdata;
char inSerial[40];
int i=0;

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println(“GSM Shield testing.”);
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(9600))
Serial.println(“\nstatus=READY”);
else Serial.println(“\nstatus=IDLE”);
};

void loop()
{
//Read for new byte on serial hardware,
//and write them on NewSoftSerial.
serialhwread();
//Read for new byte on NewSoftSerial.
serialswread();
};

void serialhwread()
{
i=0;
if (Serial.available() > 0) {
while (Serial.available() > 0) {
inSerial[i]=(Serial.read());
delay(10);
i++;
}

inSerial[i]=’\0′;
if(!strcmp(inSerial,”/END”)) {
Serial.println(“_”);
inSerial[0]=0x1a;
inSerial[1]=’\0′;
gsm.SimpleWriteln(inSerial);
}
//Send a saved AT command using serial port.
if(!strcmp(inSerial,”TEST”)) {
Serial.println(“SIGNAL QUALITY”);
gsm.SimpleWriteln(“AT+CSQ”);
} else {
Serial.println(inSerial);
gsm.SimpleWriteln(inSerial);
}
inSerial[0]=’\0′;
}
}

void serialswread()
{
gsm.SimpleRead();
}

Open the serial monitor when upload done, you will see the SIM808 shield automatic powering on and the status LED(important) light up, as below image.

Try a command “AT” it returns “OK” as narmal response.

 

 

Now, this simple test can verify evething is OK and ready to use, congratulations!

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Overview

Introduction

SIM808 shield is a GSM and GPS plus Bluetooth three-in-one function shield for Peakduino/Arduino. It is based on the latest GSM/GPS/Bluetooth(optional) module SIM808 from SIMCOM, supports GSM/GPRS Quad-Band network and combines GPS technology for satellite navigation.It has high GPS receive sensitivity with 22 tracking and 66 acquisition receiver channels. Besides, it also supports A-GPS that available for indoor localization and bluetooth 3.0.

The GPRS/GSM Shield is configured and controlled via its UART using simple AT commands. Based on the SIM900 module from SIMCOM, it is like a cell phone. Besides the communications features, the GPRS/GSM Shield has 6 GPIOs, 2 PWMs and an ADC.

The module is controlled by AT command via UART and supports 3.3V and 5V logical level.

Feature

  • Quad-band 850/900/1800/1900MHz
  • GPRS multi-slot class12 connectivity: max. 85.6kbps(down-load/up-load)
  • GPRS mobile station class B
  • Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands)
  • Supports Real Time Clock
  • Supply voltage range 5V ~ 12V
  • Integrated GPS/CNSS and supports A-GPS
  • Support Bluetooth 3.0
  • Onboard 3.0V to 5.0V logic level converter
  • Low power consumption, 1mA in sleep mode
  • Supports GPS NMEA protocol
  • Standard Micro SIM Card
  • Onboard USB port for firmware upgrade only(not for serial debug)

For details please refer to the SIM808 SPEC_V1507 doc.

Applications

  • M2M (Machine 2 Machine) Applicatoions – To transfer control data using SMS or GPRS between two machines located at two different factories.
  • Remote control of appliances – Send SMS while you are at your office to turn on or off your washing machine at home.
  • Remote Weather station or a Wireless Sensor Network – Make it with Peakduino and create a sensor node capable of transferring sensor data (like from a weather station – temperature, humidity etc.) to a web server (like pachube.com).
  • Vehicle Tracking System – Install GPRS+GSM+GPS Shield in your car and publish your location live on the internet. Can be used as a automotive burglar alarm.

Cautions

  • Make sure your SIM card is unlocked.
  • The product is provided as is without an insulating enclosure. Please observe ESD precautions specially in dry (low humidity) weather.
  • The factory default setting for the GPRS Shield UART is 19200 bps 8-N-1. (Can be changed using AT commands).

Here’s a quick overview of each pin mapping:

Pin Label In/Out Board Connection Pin Description
GND In Ground SIM808 module ground (0V reference)
SIM_RST In Arduino D9 Reset the SIM808 module
SIM_DTR In Arduino D8 Data terminal ready
SIM_PWR In Arduino D7 Enable or Disable the SIM module
RX In Arduino D0-D4 Serial data input
TX Out Arduino D0-D4 Serial data output
SIM_RI Out Arduino D6 Ring indicator – Output Low when incoming calls
VRTC In The button battery Backup power – keeps the RTC running (2.7-3.3V input range)
VBAT In On-board 4.0V regulator 4.0V power supply input

Layout:

Resources

Getting started with Duinopeak GPS Logger Shield-µSD Card GPS Logging for NEO-M8N

Now that we have good GPS data, the final step is to start logging it to a µSD card.

Like the last example, this sketch uses TinyGPSplus-for-Neo-M8N, it also uses Arduino’s built-in SD library.

The code is hosted on codebender and embedded below. If the embed below doesn’t load for you, check out the example code in our GitHub repository.

/******************************************************************************
This example uses SoftwareSerial to communicate with the GPS module on
pins 8 and 9, then communicates over SPI to log that data to a uSD card.

It uses the TinyGPSplus-for-Neo-M8N library to parse the NMEA strings sent by the GPS module,
and prints interesting GPS information – comma separated – to a newly created
file on the SD card.

Resources:
TinyGPSplus-for-Neo-M8N Library  – github.com/SensorsIot/TinyGPSplus-for-Neo-M8N
SD Library (Built-in)
SoftwareSerial Library (Built-in)

Development/hardware environment specifics:
Arduino IDE 1.6.7
GPS Logger Shield v2.0 – Make sure the UART jumper is set to SW-UART
Peakduino UNO, Arduino Uno, RedBoard, Pro, Mega, etc.
******************************************************************************/

#include <SPI.h>
#include <SD.h>
#include <TinyGPS++.h>

#define ARDUINO_USD_CS 8 // uSD card CS pin (pin 8 on Duinopeak GPS Logger Shield)

/////////////////////////
// Log File Defintions //
/////////////////////////
// Keep in mind, the SD library has max file name lengths of 8.3 – 8 char prefix,
// and a 3 char suffix.
// Our log files are called “gpslogXX.csv, so “gpslog99.csv” is our max file.
#define LOG_FILE_PREFIX “gpslog” // Name of the log file.
#define MAX_LOG_FILES 100 // Number of log files that can be made
#define LOG_FILE_SUFFIX “csv” // Suffix of the log file
char logFileName[13]; // Char string to store the log file name
// Data to be logged:
#define LOG_COLUMN_COUNT 8
char * log_col_names[LOG_COLUMN_COUNT] = {
“longitude”, “latitude”, “altitude”, “speed”, “course”, “date”, “time”, “satellites”
}; // log_col_names is printed at the top of the file.

//////////////////////
// Log Rate Control //
//////////////////////
#define LOG_RATE 5000 // Log every 5 seconds
unsigned long lastLog = 0; // Global var to keep of last time we logged

/////////////////////////
// TinyGPS Definitions //
/////////////////////////
TinyGPSPlus tinyGPS; // tinyGPSPlus object to be used throughout
#define GPS_BAUD 9600 // GPS module’s default baud rate

/////////////////////////////////
// GPS Serial Port Definitions //
/////////////////////////////////
// If you’re using an Arduino Uno, Mega, RedBoard, or any board that uses the
// 0/1 UART for programming/Serial monitor-ing, use SoftwareSerial:
#include <SoftwareSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 2 // GPS RX, Arduino TX pin
SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial

// Set gpsPort to either ssGPS if using SoftwareSerial or Serial1 if using an
// Arduino with a dedicated hardware serial port
#define gpsPort ssGPS  // Alternatively, use Serial1 on the Leonardo

// Define the serial monitor port. On the Uno, Mega, and Leonardo this is ‘Serial’
//  on other boards this may be ‘SerialUSB’
#define SerialMonitor Serial

void setup()
{
SerialMonitor.begin(9600);
gpsPort.begin(GPS_BAUD);

SerialMonitor.println(“Setting up SD card.”);
// see if the card is present and can be initialized:
if (!SD.begin(ARDUINO_USD_CS))
{
SerialMonitor.println(“Error initializing SD card.”);
}
updateFileName(); // Each time we start, create a new file, increment the number
printHeader(); // Print a header at the top of the new file
}

void loop()
{
if ((lastLog + LOG_RATE) <= millis())
{ // If it’s been LOG_RATE milliseconds since the last log:
if (tinyGPS.location.isUpdated()) // If the GPS data is vaild
{
if (logGPSData()) // Log the GPS data
{
SerialMonitor.println(“GPS logged.”); // Print a debug message
lastLog = millis(); // Update the lastLog variable
}
else // If we failed to log GPS
{ // Print an error, don’t update lastLog
SerialMonitor.println(“Failed to log new GPS data.”);
}
}
else // If GPS data isn’t valid
{
// Print a debug message. Maybe we don’t have enough satellites yet.
SerialMonitor.print(“No GPS data. Sats: “);
SerialMonitor.println(tinyGPS.satellites.value());
}
}

// If we’re not logging, continue to “feed” the tinyGPS object:
while (gpsPort.available())
tinyGPS.encode(gpsPort.read());
}

byte logGPSData()
{
File logFile = SD.open(logFileName, FILE_WRITE); // Open the log file

if (logFile)
{ // Print longitude, latitude, altitude (in feet), speed (in mph), course
// in (degrees), date, time, and number of satellites.
logFile.print(tinyGPS.location.lng(), 6);
logFile.print(‘,’);
logFile.print(tinyGPS.location.lat(), 6);
logFile.print(‘,’);
logFile.print(tinyGPS.altitude.feet(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.speed.mph(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.course.deg(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.date.value());
logFile.print(‘,’);
logFile.print(tinyGPS.time.value());
logFile.print(‘,’);
logFile.print(tinyGPS.satellites.value());
logFile.println();
logFile.close();

return 1; // Return success
}

return 0; // If we failed to open the file, return fail
}

// printHeader() – prints our eight column names to the top of our log file
void printHeader()
{
File logFile = SD.open(logFileName, FILE_WRITE); // Open the log file

if (logFile) // If the log file opened, print our column names to the file
{
int i = 0;
for (; i < LOG_COLUMN_COUNT; i++)
{
logFile.print(log_col_names[i]);
if (i < LOG_COLUMN_COUNT – 1) // If it’s anything but the last column
logFile.print(‘,’); // print a comma
else // If it’s the last column
logFile.println(); // print a new line
}
logFile.close(); // close the file
}
}

// updateFileName() – Looks through the log files already present on a card,
// and creates a new file with an incremented file index.
void updateFileName()
{
int i = 0;
for (; i < MAX_LOG_FILES; i++)
{
memset(logFileName, 0, strlen(logFileName)); // Clear logFileName string
// Set logFileName to “gpslogXX.csv”:
sprintf(logFileName, “%s%d.%s”, LOG_FILE_PREFIX, i, LOG_FILE_SUFFIX);
if (!SD.exists(logFileName)) // If a file doesn’t exist
{
break; // Break out of this loop. We found our index
}
else // Otherwise:
{
SerialMonitor.print(logFileName);
SerialMonitor.println(” exists”); // Print a debug statement
}
}
SerialMonitor.print(“File name: “);
SerialMonitor.println(logFileName); // Debug print the file name
}

You may need to edit the gpsPort and SerialMonitor objects, toward the top of the code to get the example to work correctly on your Arduino. The sketch defaults to using SoftwareSerial for the GPS, which should work for most boards – as long as the UART-Select jumper is set as SW-UART(D2-D7).

Before uploading the code, plug a µSD card into your GPS Logger Shield. Push it in gently until you hear a click. Then release, and let it latch into place.

Once that’s in place, upload and run! You can check the serial monitor for debugging data, or just trust that the logger is logging.

Once the GPS module gets a good fix, the Arduino will start logging longitude, latitude, altitude, speed, course, date, time, and the number of visible satellites into a CSV file. The data is set to log once every five seconds, but that’s easily tunable if you need more or less data.

Open the serial monitor you will see outputs as below:

After letting it log for a bit, turn off your Arduino, load the SD card into your computer, and check for a GPSLOG###.CSVfile. Open it up in a spreadsheet program, or just use a text editor to see what your Arduino logged.

Getting started with Duinopeak GPS Logger Shield-µSD Card GPS Logging for NEO-6M

Now that we have good GPS data, the final step is to start logging it to a µSD card.

Like the last example, this sketch uses TinyGPS++, it also uses Arduino’s built-in SD library.

Note:TinyGPS++ Example for NEO-6M only.

The code is hosted on codebender and embedded below. If the embed below doesn’t load for you, check out the example code in our GitHub repository.

/******************************************************************************
This example uses SoftwareSerial to communicate with the GPS module on
pins 8 and 9, then communicates over SPI to log that data to a uSD card.

It uses the TinyGPS++ library to parse the NMEA strings sent by the GPS module,
and prints interesting GPS information – comma separated – to a newly created
file on the SD card.

Resources:
TinyGPS++ Library  – https://github.com/mikalhart/TinyGPSPlus/releases
SD Library (Built-in)
SoftwareSerial Library (Built-in)

Development/hardware environment specifics:
Arduino IDE 1.6.7
GPS Logger Shield v2.0 – Make sure the UART switch is set to SW-UART
Arduino Uno, RedBoard, Pro, Mega, etc.
******************************************************************************/

#include <SPI.h>
#include <SD.h>
#include <TinyGPS++.h>

#define ARDUINO_USD_CS 8 // uSD card CS pin (pin 8 on Duinopeak GPS Logger Shield)

/////////////////////////
// Log File Defintions //
/////////////////////////
// Keep in mind, the SD library has max file name lengths of 8.3 – 8 char prefix,
// and a 3 char suffix.
// Our log files are called “gpslogXX.csv, so “gpslog99.csv” is our max file.
#define LOG_FILE_PREFIX “gpslog” // Name of the log file.
#define MAX_LOG_FILES 100 // Number of log files that can be made
#define LOG_FILE_SUFFIX “csv” // Suffix of the log file
char logFileName[13]; // Char string to store the log file name
// Data to be logged:
#define LOG_COLUMN_COUNT 8
char * log_col_names[LOG_COLUMN_COUNT] = {
“longitude”, “latitude”, “altitude”, “speed”, “course”, “date”, “time”, “satellites”
}; // log_col_names is printed at the top of the file.

//////////////////////
// Log Rate Control //
//////////////////////
#define LOG_RATE 5000 // Log every 5 seconds
unsigned long lastLog = 0; // Global var to keep of last time we logged

/////////////////////////
// TinyGPS Definitions //
/////////////////////////
TinyGPSPlus tinyGPS; // tinyGPSPlus object to be used throughout
#define GPS_BAUD 9600 // GPS module’s default baud rate

/////////////////////////////////
// GPS Serial Port Definitions //
/////////////////////////////////
// If you’re using an Arduino Uno, Mega, RedBoard, or any board that uses the
// 0/1 UART for programming/Serial monitor-ing, use SoftwareSerial:
#include <SoftwareSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 2 // GPS RX, Arduino TX pin
SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial

// Set gpsPort to either ssGPS if using SoftwareSerial or Serial1 if using an
// Arduino with a dedicated hardware serial port
#define gpsPort ssGPS  // Alternatively, use Serial1 on the Leonardo

// Define the serial monitor port. On the Uno, Mega, and Leonardo this is ‘Serial’
//  on other boards this may be ‘SerialUSB’
#define SerialMonitor Serial

void setup()
{
SerialMonitor.begin(9600);
gpsPort.begin(GPS_BAUD);

SerialMonitor.println(“Setting up SD card.”);
// see if the card is present and can be initialized:
if (!SD.begin(ARDUINO_USD_CS))
{
SerialMonitor.println(“Error initializing SD card.”);
}
updateFileName(); // Each time we start, create a new file, increment the number
printHeader(); // Print a header at the top of the new file
}

void loop()
{
if ((lastLog + LOG_RATE) <= millis())
{ // If it’s been LOG_RATE milliseconds since the last log:
if (tinyGPS.location.isUpdated()) // If the GPS data is vaild
{
if (logGPSData()) // Log the GPS data
{
SerialMonitor.println(“GPS logged.”); // Print a debug message
lastLog = millis(); // Update the lastLog variable
}
else // If we failed to log GPS
{ // Print an error, don’t update lastLog
SerialMonitor.println(“Failed to log new GPS data.”);
}
}
else // If GPS data isn’t valid
{
// Print a debug message. Maybe we don’t have enough satellites yet.
SerialMonitor.print(“No GPS data. Sats: “);
SerialMonitor.println(tinyGPS.satellites.value());
}
}

// If we’re not logging, continue to “feed” the tinyGPS object:
while (gpsPort.available())
tinyGPS.encode(gpsPort.read());
}

byte logGPSData()
{
File logFile = SD.open(logFileName, FILE_WRITE); // Open the log file

if (logFile)
{ // Print longitude, latitude, altitude (in feet), speed (in mph), course
// in (degrees), date, time, and number of satellites.
logFile.print(tinyGPS.location.lng(), 6);
logFile.print(‘,’);
logFile.print(tinyGPS.location.lat(), 6);
logFile.print(‘,’);
logFile.print(tinyGPS.altitude.feet(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.speed.mph(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.course.deg(), 1);
logFile.print(‘,’);
logFile.print(tinyGPS.date.value());
logFile.print(‘,’);
logFile.print(tinyGPS.time.value());
logFile.print(‘,’);
logFile.print(tinyGPS.satellites.value());
logFile.println();
logFile.close();

return 1; // Return success
}

return 0; // If we failed to open the file, return fail
}

// printHeader() – prints our eight column names to the top of our log file
void printHeader()
{
File logFile = SD.open(logFileName, FILE_WRITE); // Open the log file

if (logFile) // If the log file opened, print our column names to the file
{
int i = 0;
for (; i < LOG_COLUMN_COUNT; i++)
{
logFile.print(log_col_names[i]);
if (i < LOG_COLUMN_COUNT – 1) // If it’s anything but the last column
logFile.print(‘,’); // print a comma
else // If it’s the last column
logFile.println(); // print a new line
}
logFile.close(); // close the file
}
}

// updateFileName() – Looks through the log files already present on a card,
// and creates a new file with an incremented file index.
void updateFileName()
{
int i = 0;
for (; i < MAX_LOG_FILES; i++)
{
memset(logFileName, 0, strlen(logFileName)); // Clear logFileName string
// Set logFileName to “gpslogXX.csv”:
sprintf(logFileName, “%s%d.%s”, LOG_FILE_PREFIX, i, LOG_FILE_SUFFIX);
if (!SD.exists(logFileName)) // If a file doesn’t exist
{
break; // Break out of this loop. We found our index
}
else // Otherwise:
{
SerialMonitor.print(logFileName);
SerialMonitor.println(” exists”); // Print a debug statement
}
}
SerialMonitor.print(“File name: “);
SerialMonitor.println(logFileName); // Debug print the file name
}

You may need to edit the gpsPort and SerialMonitor objects, toward the top of the code to get the example to work correctly on your Arduino. The sketch defaults to using SoftwareSerial for the GPS, which should work for most boards – as long as the UART-Select jumper is set as SW-UART(D2-D7).

Before uploading the code, plug a µSD card into your GPS Logger Shield. Push it in gently until you hear a click. Then release, and let it latch into place.

Once that’s in place, upload and run! You can check the serial monitor for debugging data, or just trust that the logger is logging.

Once the GPS module gets a good fix, the Arduino will start logging longitude, latitude, altitude, speed, course, date, time, and the number of visible satellites into a CSV file. The data is set to log once every five seconds, but that’s easily tunable if you need more or less data.

Open the serial monitor you will see outputs as below:

After letting it log for a bit, turn off your Arduino, load the SD card into your computer, and check for a GPSLOG###.CSVfile. Open it up in a spreadsheet program, or just use a text editor to see what your Arduino logged.

Getting started with Duinopeak GPS Logger Shield-Serial Streaming for NEO-M8N

A GPS-parsing Arduino libraries specifically for M8N are TinyGPSplus-for-Neo-M8N. These libraries simplify the task of parsing the excessive NMEA strings, leaving us with just the few bits of data we care about.

You need to install the libraries on your own Arduino development machine, visit the links above to download them. Reference sparkfun’s Installing an Arduino Librarytutorial for any additional library-installing help you may need.

TinyGPS++ Example for NEO-M8N only

Here’s a quick example, which uses the TinyGPS++ library to parse NMEA strings for position, altitude, time, and date. The code is also available in GPS Shield GitHub repository.

/******************************************************************************
This example uses SoftwareSerial to communicate with the GPS module on
pins 8 and 9. It uses the TinyGPS++ library to parse the NMEA strings sent
by the GPS module, and prints interesting GPS information to the serial
monitor.

After uploading the code, open your serial monitor, set it to 9600 baud, and
watch for latitude, longitude, altitude, course, speed, date, time, and the
number of visible satellites.
******************************************************************************/

#include <TinyGPS++.h> // Include the TinyGPS++ library
TinyGPSPlus tinyGPS; // Create a TinyGPSPlus object

#define GPS_BAUD 9600 // GPS module baud rate. GP3906 defaults to 9600.

// If you’re using an Arduino Uno, Mega, RedBoard, or any board that uses the
// 0/1 UART for programming/Serial monitor-ing, use SoftwareSerial:
#include <SoftwareSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 2 // GPS RX, Arduino TX pin
SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial

// Set gpsPort to either ssGPS if using SoftwareSerial or Serial1 if using an
// Arduino with a dedicated hardware serial port
#define gpsPort ssGPS  // Alternatively, use Serial1 on the Leonardo

// Define the serial monitor port. On the Uno, Mega, and Leonardo this is ‘Serial’
//  on other boards this may be ‘SerialUSB’
#define SerialMonitor Serial

void setup()
{
SerialMonitor.begin(9600);
gpsPort.begin(GPS_BAUD);
}

void loop()
{
// print position, altitude, speed, time/date, and satellites:
printGPSInfo();

// “Smart delay” looks for GPS data while the Arduino’s not doing anything else
smartDelay(1000);
}

void printGPSInfo()
{
// Print latitude, longitude, altitude in feet, course, speed, date, time,
// and the number of visible satellites.
SerialMonitor.print(“Lat: “); SerialMonitor.println(tinyGPS.location.lat(), 6);
SerialMonitor.print(“Long: “); SerialMonitor.println(tinyGPS.location.lng(), 6);
SerialMonitor.print(“Alt: “); SerialMonitor.println(tinyGPS.altitude.feet());
SerialMonitor.print(“Course: “); SerialMonitor.println(tinyGPS.course.deg());
SerialMonitor.print(“Speed: “); SerialMonitor.println(tinyGPS.speed.mph());
SerialMonitor.print(“Date: “); printDate();
SerialMonitor.print(“Time: “); printTime();
SerialMonitor.print(“Sats: “); SerialMonitor.println(tinyGPS.satellites.value());
SerialMonitor.println();
}

// This custom version of delay() ensures that the tinyGPS object
// is being “fed”. From the TinyGPS++ examples.
static void smartDelay(unsigned long ms)
{
unsigned long start = millis();
do
{
// If data has come in from the GPS module
while (gpsPort.available())
tinyGPS.encode(gpsPort.read()); // Send it to the encode function
// tinyGPS.encode(char) continues to “load” the tinGPS object with new
// data coming in from the GPS module. As full NMEA strings begin to come in
// the tinyGPS library will be able to start parsing them for pertinent info
} while (millis() – start < ms);
}

// printDate() formats the date into dd/mm/yy.
void printDate()
{
SerialMonitor.print(tinyGPS.date.day());
SerialMonitor.print(“/”);
SerialMonitor.print(tinyGPS.date.month());
SerialMonitor.print(“/”);
SerialMonitor.println(tinyGPS.date.year());
}

// printTime() formats the time into “hh:mm:ss”, and prints leading 0’s
// where they’re called for.
void printTime()
{
SerialMonitor.print(tinyGPS.time.hour());
SerialMonitor.print(“:”);
if (tinyGPS.time.minute() < 10) SerialMonitor.print(‘0’);
SerialMonitor.print(tinyGPS.time.minute());
SerialMonitor.print(“:”);
if (tinyGPS.time.second() < 10) SerialMonitor.print(‘0’);
SerialMonitor.println(tinyGPS.time.second());
}

You may need to adjust the gpsPort and SerialMonitor defines near the top of the sketch. As it is, the sketch is set up to use the SoftwareSerial port.

After uploading the code, open up your serial monitor to watch the parsed GPS data stream.

If your module doesn’t have a good GPS fix, you’ll probably see a lot of 0’s stream by; the time should be incrementing, although it’ll be incorrect (unless you plugged your Arduino in at exactly midnight!).

If you can find a way to take your computer and Arduino setup outside, that’ll be your best bet for getting a fix. Otherwise, try to take it near an open window. The better view it has of the sky, the better chance it’ll have to find the four satellites it needs.

A successful, fixed GPS stream will look something like this:


For more information on using the TinyGPS++ Library, check out the project homepage.

Getting started with Duinopeak GPS Logger Shield-TinyGPS Serial Streaming for NEO-6M

A couple of our favorite GPS-parsing Arduino libraries are TinyGPS and TinyGPS++. These libraries simplify the task of parsing the excessive NMEA strings, leaving us with just the few bits of data we care about.

You need to install the libraries on your own Arduino development machine, visit the links above to download them. Reference sparkfun’s Installing an Arduino Librarytutorial for any additional library-installing help you may need.

TinyGPS++ Example for NEO-6M only

Here’s a quick example, which uses the TinyGPS++ library to parse NMEA strings for position, altitude, time, and date. The code is also available in GPS Shield GitHub repository.

/******************************************************************************
This example uses SoftwareSerial to communicate with the GPS module on
pins 8 and 9. It uses the TinyGPS++ library to parse the NMEA strings sent
by the GPS module, and prints interesting GPS information to the serial
monitor.

After uploading the code, open your serial monitor, set it to 9600 baud, and
watch for latitude, longitude, altitude, course, speed, date, time, and the
number of visible satellites.
******************************************************************************/

#include <TinyGPS++.h> // Include the TinyGPS++ library
TinyGPSPlus tinyGPS; // Create a TinyGPSPlus object

#define GPS_BAUD 9600 // GPS module baud rate. GP3906 defaults to 9600.

// If you’re using an Arduino Uno, Mega, RedBoard, or any board that uses the
// 0/1 UART for programming/Serial monitor-ing, use SoftwareSerial:
#include <SoftwareSerial.h>
#define ARDUINO_GPS_RX 3 // GPS TX, Arduino RX pin
#define ARDUINO_GPS_TX 2 // GPS RX, Arduino TX pin
SoftwareSerial ssGPS(ARDUINO_GPS_TX, ARDUINO_GPS_RX); // Create a SoftwareSerial

// Set gpsPort to either ssGPS if using SoftwareSerial or Serial1 if using an
// Arduino with a dedicated hardware serial port
#define gpsPort ssGPS  // Alternatively, use Serial1 on the Leonardo

// Define the serial monitor port. On the Uno, Mega, and Leonardo this is ‘Serial’
//  on other boards this may be ‘SerialUSB’
#define SerialMonitor Serial

void setup()
{
SerialMonitor.begin(9600);
gpsPort.begin(GPS_BAUD);
}

void loop()
{
// print position, altitude, speed, time/date, and satellites:
printGPSInfo();

// “Smart delay” looks for GPS data while the Arduino’s not doing anything else
smartDelay(1000);
}

void printGPSInfo()
{
// Print latitude, longitude, altitude in feet, course, speed, date, time,
// and the number of visible satellites.
SerialMonitor.print(“Lat: “); SerialMonitor.println(tinyGPS.location.lat(), 6);
SerialMonitor.print(“Long: “); SerialMonitor.println(tinyGPS.location.lng(), 6);
SerialMonitor.print(“Alt: “); SerialMonitor.println(tinyGPS.altitude.feet());
SerialMonitor.print(“Course: “); SerialMonitor.println(tinyGPS.course.deg());
SerialMonitor.print(“Speed: “); SerialMonitor.println(tinyGPS.speed.mph());
SerialMonitor.print(“Date: “); printDate();
SerialMonitor.print(“Time: “); printTime();
SerialMonitor.print(“Sats: “); SerialMonitor.println(tinyGPS.satellites.value());
SerialMonitor.println();
}

// This custom version of delay() ensures that the tinyGPS object
// is being “fed”. From the TinyGPS++ examples.
static void smartDelay(unsigned long ms)
{
unsigned long start = millis();
do
{
// If data has come in from the GPS module
while (gpsPort.available())
tinyGPS.encode(gpsPort.read()); // Send it to the encode function
// tinyGPS.encode(char) continues to “load” the tinGPS object with new
// data coming in from the GPS module. As full NMEA strings begin to come in
// the tinyGPS library will be able to start parsing them for pertinent info
} while (millis() – start < ms);
}

// printDate() formats the date into dd/mm/yy.
void printDate()
{
SerialMonitor.print(tinyGPS.date.day());
SerialMonitor.print(“/”);
SerialMonitor.print(tinyGPS.date.month());
SerialMonitor.print(“/”);
SerialMonitor.println(tinyGPS.date.year());
}

// printTime() formats the time into “hh:mm:ss”, and prints leading 0’s
// where they’re called for.
void printTime()
{
SerialMonitor.print(tinyGPS.time.hour());
SerialMonitor.print(“:”);
if (tinyGPS.time.minute() < 10) SerialMonitor.print(‘0’);
SerialMonitor.print(tinyGPS.time.minute());
SerialMonitor.print(“:”);
if (tinyGPS.time.second() < 10) SerialMonitor.print(‘0’);
SerialMonitor.println(tinyGPS.time.second());
}

You may need to adjust the gpsPort and SerialMonitor defines near the top of the sketch. As it is, the sketch is set up to use the SoftwareSerial port.

After uploading the code, open up your serial monitor to watch the parsed GPS data stream.

If your module doesn’t have a good GPS fix, you’ll probably see a lot of 0’s stream by; the time should be incrementing, although it’ll be incorrect (unless you plugged your Arduino in at exactly midnight!).

If you can find a way to take your computer and Arduino setup outside, that’ll be your best bet for getting a fix. Otherwise, try to take it near an open window. The better view it has of the sky, the better chance it’ll have to find the four satellites it needs.

A successful, fixed GPS stream will look something like this:

Lat: 40.090422
Long: -105.184534
Alt: 5243.77
Course: 295.56
Speed: 0.01
Date: 26/1/2016
Time: 20:19:34
Sats: 6

For more information on using the TinyGPS++ Library, check out the project homepage.

Getting started with Duinopeak GPS Logger Shield-Hookup Guide and Simple Test

Introduction

The Duinopeak GPS Logger Shield equips your Arduino with access to a GPS module, µSD memory card socket, and all of the other peripherals you’ll need to turn your Arduino into a position-tracking, speed-monitoring, altitude-observing wonder logger.

The shield is based around a uBlox NEO-6M/M8N GPS Module – a 66-channel GPS receiver and an up to 10Hz update rate. The GPS module will stream constant position updates over a simple serial UART, which you can then log to a µSD card and/or use for other position or time-tracking purposes.

Everything on the shield is highly configurable: A switch allows you to select the GPS module’s UART interface between either hardware or software ports, the µSD card operates over a hardware SPI port, which should be compatible with most Arduino layouts, and extra prototyping space should allow you to add those last, few components you need to complete your project.

Selecting the Serial Port

The GPS module communicates via a simple, UART (serial) interface. The UART-select switch allows you to switch that interface between either the Arduino’s hardware UART – on pins D0 and D1 – or a SoftwareSerial port on pins D2 to D7.

Should you need a reference, this table shows the map between GPS module and Arduino UART(s):

 

GPS Pin Arduino Software UART Pin Arduino Hardware UART Pin
RX 2 1 (TX)
TX 3 0 (RX)

 

If you’re using an Arduino Uno or any development board with one, pre-occupied hardware UART, you may be forced to use the software serial port. Fortunately, the GPS module’s baud rate defaults to a slow, steady 9600 bps, which SoftwareSerial shouldn’t have a problem handling.

If you need to change the software serial port pins, they can be custom-set to any other pin by setting the jumpers between pinsD2 to D7.

Power and GPS Fix Status LEDs

This pair of LEDs on the corner of the shield are a handy tool for initial troubleshooting. The green PWR LED is attached to the output of the shield’s on-board 3.3V regulator. If the shield is getting power, this LED should be on.

The red GPS FIX LED is connected the  GPS module’s “FIX” pin. It can be used to identify whether the GPS module has a proper fix or not. When you initially power the shield up, the LED should blink – indicating it’s trying to find a fix and you can rest assured that your GPS module has a good fix on your location.

Hardware Setup

Just stack the GPS Logger Shield on the Peakduino/Arduino UNO,  plug the external active GPS antenna, and plug the USB cable to power up the board.  Then check the green power LED is light on, then everythis is OK.

Note: Make sure your external antenna has a good sight to receive the GPS signal, it is recommend to put the antenna outside the window of your room. NEO-6M is need for this step, NEO-M8N is able to position in the room in the most of the time.

Software Setup

Simple Sketch: GPS Serial Passthrough

Now that your hardware is all set up, we have three pieces of example code to give you a taste of the GPS Logger Shield’s functionality. This first example isn’t all that useful, but it will, at least, make sure everything’s working. Plus it’ll show you the raw ugliness of NMEA GPS strings and make you appreciate great libraries like TinyGPS even more.

This example doesn’t require any additional libraries. Simply plug the shield into your Arduino and upload the example code. We’ve got a couple examples, depending on which Arduino and/or serial port you’re using.

SoftwareSerial Port Example

If you’re using an Arduino Mega, Arduino Uno, Redboard, any other ATmega328P-based Arduino, and have the UART-select jumpers in the SoftwareSerial position(TX-D2 and RX-D3), upload this piece of example code to your Arduino:

/******************************************************************************
This example uses SoftwareSerial to communicate with the GPS module on
pins 8 and 9. SoftwareSerial should work on most Arduinos, but it’s a
necessity on Arduino Mega’s, Arduino Uno’s, RedBoard’s and any other Arduino
based around an ATmega328P.

After uploading the code, open your serial monitor, set it to 9600 baud, and
watch the GPS module’s NMEA strings begin to flow by. See if you can pick
out the latitude and longitude.
******************************************************************************/

#include <SoftwareSerial.h> // Include the SoftwareSerial library
#define ARDUINO_GPS_RX 3 // Arduino RX pin connected to GPS TX
#define ARDUINO_GPS_TX 2 // Arduino TX pin connected to GPS RX
#define GPS_BAUD_RATE 9600 // The GPS Shield module defaults to 9600 baud
// Create a SoftwareSerial object called gps:
SoftwareSerial gpsPort(ARDUINO_GPS_TX, ARDUINO_GPS_RX);

// We’ll also define a more descriptive moniker for the Serial Monitor port.
// This is the hardware serial port on pins 0/1.
#define SerialMonitor Serial

void setup()
{
gpsPort.begin(GPS_BAUD_RATE);
SerialMonitor.begin(9600);
}

void loop()
{
if (gpsPort.available()) // If GPS data is available
SerialMonitor.write(gpsPort.read()); // Read it and print to SerialMonitor
if (SerialMonitor.available()) // If SerialMonitor data is available
gpsPort.write(SerialMonitor.read()); // Read it and send to GPS
}

This example uses the SoftwareSerial library to communicate with the GPS module, and leaves the hardware serial port for debugging with the serial monitor.

Open up your serial monitor and set the baud rate to 9600. You should immediately begin to see GPS NMEA data begin to flow by at a rate of 1Hz.

For example, one set of strings may look like:

Now we could use uBlox’s GUI tool to view the GPS stream data visually.

Dowload the GUI tool from uBlox’s website and install it.

Choose your COM port of your Arduino board and click the magic wand for autobauding.

Now, wait a second for the GPS to fix, the TP LED should blink. The blow visual data is indoor positioning(NEO-M8N only, NEO-6M must position outdoor), outdoor will be more fast and effective.

Hardware Serial Port Example

If you use Peaduino UNO Geek Edition, just very simple, set the UART-select jumpers in the HardwareSerial position(TX-D0 and RX-D1) then slide the FTDI switch to “MCU OFF”, open the Serial monitor you will get the GPS stream.

Open up your serial monitor and set the baud rate to 9600. You should immediately begin to see GPS NMEA data begin to flow by at a rate of 1Hz.

For example, one set of strings may look like:

If you’re using an Arduino UNO, or any other Arduino UNO compatible with no free UART on pins 0/1, set the UART-select jumpers in the HardwareSerial position(TX-D0 and RX-D1), and upload this example:

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

Once you’ve uploaded the sketch, open up your serial monitor and set the baud rate to 9600. You should immediately begin to see GPS NMEA data begin to flow by at a rate of 1Hz.

For example, one set of strings may look like:

If you’re using an Arduino Leonardo, Arduino Due, Arduino Zero, or any other Arduino with a free UART on pins 0/1, set the UART-select jumpers in the HardwareSerial position(TX-D0 and RX-D1), and upload this example:

/******************************************************************************
This example uses an Arduino’s hardware serial port — on pins 0 and 1 — to
communicate with the GPS module.

Hardware serial should work on any Arduino’s with a free hardware serial
UART on pins 0/1. That includes Arduino Leonardo, Zero, Due, and SparkFun’s
SAMD21 Dev Board.

After uploading the code, open your serial monitor, set it to 9600 baud, and
watch the GPS module’s NMEA strings begin to flow by. See if you can pick
out the latitude and longitude.
******************************************************************************/

#define GPS_BAUD_RATE 9600 // The GPS Shield module defaults to 9600 baud

// Define the serial monitor port. On the Leonardo this is ‘Serial’
//  but on other boards this may be ‘SerialUSB’
#define SerialMonitor Serial // e.g. Arduino Leonardo
// Define the harware serial port on pins 0/1. On the Leonardo this is ‘Serial1’
//  but on other boards this may be ‘Serial’
#define gpsPort Serial1 // e.g. Arduino Leonardo
// See https://www.arduino.cc/en/Reference/Serial to find out which Serial ports
//  you should use in the defines above.

void setup()
{
SerialMonitor.begin(9600); // Initialize the serial monitor port at 9600 baud
gpsPort.begin(GPS_BAUD_RATE); // The GPS module’s default baud is 9600
}

void loop()
{
if (gpsPort.available()) // If GPS data is available
SerialMonitor.write(gpsPort.read()); // Send it to the serial monitor
if (SerialMonitor.available()) // If data is sent to the serial monitor
gpsPort.write(SerialMonitor.read()); // send it to the GPS module
}

You may have to alter either or both of the serial port #defines at the top of the code. Refer to your development board’s datasheet or product info page for more information on which serial port is which.

Using the Serial Passthrough Sketch

Once you’ve uploaded the sketch, open up your serial monitor and set the baud rate to 9600. You should immediately begin to see GPS NMEA data begin to flow by at a rate of 1Hz.

For example, one set of strings may look like:

$GPRMC,235316.000,A,4003.9040,N,10512.5792,W,0.09,144.75,141112,,*19 $GPGGA,235317.000,4003.9039,N,10512.5793,W,1,08,1.6,1577.9,M,-20.7,M,,0000*5F $GPGSA,A,3,22,18,21,06,03,09,24,15,,,,,2.5,1.6,1.9*3E

If you don’t see anything in the serial monitor, make sure the UART-select jumper is in the correct position. Also double check that the green “power” LED is at least light up. If it’s not, the module may not be receiving power. Don’t forget place the external antenna outside the window of your room!

NMEA strings are the standard message format produced by almost all GPS receivers. They can relay all sorts of information including the time, latitude, longitude, altitude, and number of satellites visible, but unless you’re an incredibly fast parser, these sentences will mostly mean nothing. Fortunately, the Arduino can read those strings, parse them for you, and give you more human-readable pieces of data.

Getting started with Duinopeak GPS Logger Shield-Introduction & Overview

The Duinopeak GPS Logger Shield equips your Arduino with access to a GPS module, µSD memory card socket, and all of the other peripherals you’ll need to turn your Arduino into a position-tracking, speed-monitoring, altitude-observing wonder logger. The shield is based around a uBlox’s NEO-6M/M8N GPS Module – a 66-channel GPS receiver featuring a MediaTek MT3339 architecture and up to a 10Hz update rate. The GPS module will stream constant position updates over a simple TTL-level serial port, which you can then log to a µSD card and/or use for other purposes.

Everything on the shield is highly configurable: A switch allows you to select the GPS module’s UART interface between either hardware or software ports,The regular GPS pins(RX,TX) can be connected to D0-D7 of Arduino.  The µSD card operates over a hardware SPI port, which should be compatible with most Arduino layouts. The GPS Logger Shield’s main voltage supply is taken from the Arduino 5V header pin. This voltage is regulated down to 3.3V, which is supplied to both the GPS module and the µSD card. These two components should consume, about 30mA on average, but they may very occasionally spike to around 100mA.

Features:

  • On-Board uBlox’s NEO-6M/M8N GPS Module
  • Concurrent reception of up to 3 GNSS (GPS, Galileo, GLONASS, BeiDou)
  • External active GPS antenna design with high receive sensitivity, compatible normal antenna
  • Extremely fast time to first fix at low signal level
  • Indoor positioning(NEO-M8N only)
  • Onboard rechargeable battery enable backup parameters ablity
  • µSD memory card socket
  • Standard Arduino sized shield
  • Arduino reset button
  • Selectable UART jumper controls serial communications

Hardware Overview:

Here’s a quick overview of each pin mapping:

Pin Label In/Out Board Connection Pin Description
GND In Ground GPS module ground (0V reference)
SD_CS In Arduino D8 Enable the SD card operation
RX In Arduino D0-D7 Serial data input
TX Out Arduino D0-D7 Serial data output
FIX Out GPS Fix LED GPS fix indicator – blink once a fix is valid
VBAT In rechargeable battery Backup power – keeps the RTC running (2.0-4.3V input range)
3V3 In On-board 3.3V regulator 3.3V power supply input

Layout:

Schematic diagram:

 

Datasheet:

https://www.u-blox.com/en/product/neo-6-series

https://www.u-blox.com/en/product/neo-m8-series