User Tools

Site Tools


digispark:tutorials:gps

This is an old revision of the document!


Pro GPS Shield Kit Tutorial

Product Description:

gps1.jpg gps6.jpg

This is an unassembled kit and requires basic soldering. This is designed for use with the Digispark development board, which is not included.

Parts:

Part Quantity Identification
Pro Combo PCB1
Serial GPS Module 1
1x40pin male 0.1“ pitch header 25 pins worth

Resistor Values: For more information on how to identify the value of the resistors we recommend these sites: A nice simple resistor calculator: http://www.ealnet.com/m-eal/resistor/resistor.htm A comprehensive article on identification: http://www.diyaudioandvideo.com/Electronics/Color/

Soldering: If you are new to soldering we recommend the following tutorials: Soldering Basics (http://www.sparkfun.com/tutorials/106) and Soldering Crash Course from the folks at Sparkfun (http://www.sparkfun.com/tutorials/354). How to solder from the Curious Inventor: http://store.curiousinventor.com/guides/How_to_Solder

Adafruit has this excellent guide that starts with the tools needed and then shows detailed pictures, including some of the common problems that beginners experience (http://learn.adafruit.com/adafruit-guide-excellent-soldering)

We assume for these assembly instructions that you know the basics of thru-hole soldering. If you don't check out the links above, these boards are very easy to solder - we promise!

Assembly:

gps1.jpg

Insert a strip of 4 header pins into the top of the board in the four holes labeled for the GPS module. Solder on the bottom of the board.

gps2.jpg

Cut two lengths of male headers each 9 pins long and one 3 pins long. Insert into corresponding positions (on the bottom of the board) and solder each pin.

Tip: Inserting the headers into a breadboard and then placing the board on top can make this process easier.

Note: If you are using stackable headers, use them here instead of the standard male headers.

gps3.jpg

Insert the GPS module into the front of the board onto the 4 pins. Solder the pins to the module, optionally snip off the excess.

gps4.jpg

gps5.jpg

Optionally - attach the antenna to the board by applying a blob of solder to each solder point and the antenna case. Don't apply too much heat or you may damage the antenna.

gps6.jpg

Programming:

NOTE: The first time you use the GPS module it may take 5 minutes or more, near a window or outside, to acquire a fix and produce data.

Sketch below is a work in progress - and is not yet fully functional! Based on: https://www.insidegadgets.com/2013/10/11/playing-around-with-gps-attiny-gps-longlat-logger/

#include <DigiCDC.h>
 
void setup() {
  // put your setup code here, to run once:
  SerialUSB.begin();
  Serial.begin(9600);
}
 
 
char tempBuffer[15];
 
 
void loop() {
  // put your main code here, to run repeatedly:
  if(Serial.available()){
    char rxData = Serial.read();
 
		// Start of frame
		if (rxData == '$') {
			// Read next chars
			ReadSerialToComma();
 
			// Check if GPRMC
			if (memcmp(tempBuffer, "GPRMC", 5) == 0) {
				ReadSerialToComma(); // Timestamp 
                                //buffer has time right now
                                SerialUSB.println(tempBuffer);
				ReadSerialToComma(); // Validity
 
				// If valid GPS data
				if (tempBuffer[0] == 'A') {
 
				  ReadSerialToComma(); // Latitude
                                  //buffer has lat right now
                                  SerialUSB.println(tempBuffer);
 
  				  ReadSerialToComma(); // N or S (ignore				
				  ReadSerialToComma(); // Longitude
                                  //buffer has lon right now
                                  SerialUSB.println(tempBuffer);
 
                                  ReadSerialToComma(); // W or E (ignore)
 
                                  ReadSerialToComma(); // Speed in knots
                                  //buffer has speed right now
                                  SerialUSB.println(tempBuffer);
 
                                  ReadSerialToComma(); // Course made good (ignore)
 
                                  ReadSerialToComma(); // Date
                                  //buffer has date right now
                                  SerialUSB.println(tempBuffer);
 
                                  SerialUSB.delay(1000); //wait 1 second before fetching again
 
 
 
 
 
 
 
 
 
				}
			}
		}
  }
  SerialUSB.refresh();
}
 
 
byte ReadSerialToComma(void) {
	int x = 0;
	tempBuffer[x] = Serial.read();
 
	while (tempBuffer[x] != ',') {
		x++;
		tempBuffer[x] = Serial.read();
                SerialUSB.refresh();
	}
 
        x++;
	tempBuffer[x] = 0;
	return x;
}
digispark/tutorials/gps.1417989780.txt.gz · Last modified: 2014/12/07 14:03 by digistump