Connect Phi-1 shield with an EM 406A GPS

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

Have you thought of making a fun Geocache box for outdoor adventure or a wonderful reverse-Geocache box for friends or loved ones? Maybe you want a GPS tracker for field trips or position-sensitive projects? Yes, you can buy a GPS shield from sparkfun but then you also need other functions for your project, like an EEPROM to log positions and LCD with push buttons, then a real time clock in case your GPS loses signal. Maybe add a speaker. Then you need a bunch of shields. Asume they are all compatible with their pins (good luck if they’re made by different people), then as your shields stack sky high, so is your cost. 

My Phi-1 shield can solve this problem. It easily connects to a 16X2 character display onboard, 6 buttons, speaker and LED, real time clock, EEPROM, and GPS connector. The board design has a surface mount connector to incorporate an EM 406A GPS. But I have not been able to purchase a GPS module till recently so here goes how to add a GPS onboard and make this shield a multi-functional sweet tech pie 🙂

First, purchase a Phi-1 shield from dipmicro. I would go with the kit. If the kit is not available, just go down the page and purchase the items listed below. If the yellow LCD is not available, buy a different one. If the variable resistor is out of stock, buy another one like this. The only thing missing is an EEPROM. It really depends on how much storage you need. I use this but you can also buy the 1024KBit version for more space.

Then, purchase a GPS module and connector socket from a reputable vendor. I purchased mine from sparkfun:

GPS module:

EM 406A

Connector socket (to be soldered on the Phi-1 shield):

EM 406A compatible socket

I would purchase at least two of these sockets since they’re tiny and may get damaged if not soldered properly.

If you have not yet soldered your Phi-1 shield, make the above socket your priority. It is easier if you don’t have already soldered all parts that will be in the way when you solder this socket. If you have not handled surface mount components, google a few videos on how to hand solder them. I did it just by carefully soldering with a fine soldering iron tip and patience.

My suggestion: set the board on a flat surface. Put the socket on the board. Position the socket so that it is lined up with the solder pads. Make sure you get the right orientation. First solder the two side pins (possibly strain releif). Heat your iron, clean its tip, add very small amount of solder. If you see a solder ball forming on the tip, wipe it off. Then carefully place the tip on the solder pad and the side pin and hold it there for several seconds. Once you can see the solder start to move to the solder pad and the pin, hold a few moment and move to the other side pin. Occasionally the surface tension of the solder is large enough to drag the socket out of alignment. Just watch out for that.

Once the side pins are secure, check to make sure the solder pads on the PCB are lined up with the pins on the socket. Repeat with the minimal solder and hold the tip on the pin to solder all 6 connections. When done, inspect with a magnifying glass to make sure there is no shorting.

Now solder six female pins to the holes that break out the socket connection, just above the socket. Also solder the 5V and GND with female pins to its right (between the two channels on the right). This will make wiring extremely easy.

Now, wire the GPS as per picture:

Top pin to GND, 2nd pin to 5V, 3rd pin to analog 0, 4th pin to analog 1. You may use pins other than analog 0 and 1 and you need to change the definition in the code to reflect the change. These pins are used by the B and A buttons so you will no longer be able to use these buttons. If arduino has more pins, or you’re using the Phi-1 shield with mega board, go right ahead to use some unused pins.

Now, put some double sided tape on the botton of the gps module and tape it to the board, with the position and orientation indicated by the picture below. You should check clearance (avoid the metal in the red circle) by carefully putting the LCD back on the shield. If you get the GPS to the right location, the LCD should be slightly above the GPS but not touching it. I think I’m just that good of a designer 🙂

Plug in the GPS to the socket, observe that the grey line will appear on the right side, per the connections picture. Secure the connection.

Load the sample code. Make sure if you have changed which arduino pin the GPS is connected to, make change in the code as well. Power it up and wait. Nothing? Well, the GPS takes a while to start up and inside of a building is always going to be poor reception, especially on the first floor. I will try it in a car, with a 9V battery. Notice that the red LED on the GPS will flash at 1 second interval if it has a lock on the satellites. It is steady if it is powered on but has not locked on the satellites. Make sure you see the flash.

You can see the GPS module sits nicely underneath the LCD. The red color on the push buttons comes from the flashing light of the GPS indicator LED.

Here is a picture showing my GPS coordinate, and my El cheapo TomTom GPS with no reception. The coordinates are in 10-5 degree units.

Here is the code:

GPS basic display

Support library The newsoftserial and tinygps are needed for the code. These can also be downloaded at the author’s website. After you download the libraries, unzip them under your arduino sketch/libraries folder so that you will have something like arduino/sketchbooks/libraries/NewSoftSerial.

%d bloggers like this: