Monday, January 10, 2011


I also wanted to provide an example of how to connect the EM-406A GPS module to the Arduino Uno.

The setup is pretty easy and equal to the setup which was used for the GpsSPOT experiment. You only have to connect the respective ports of the Arduino board.

This is a simplified schematic of the connections which have to be made:

The source code was a little bit trickier to figure out. Since the module works with a baud rate of 4800 bits per second, you have to consider appropriate delays before reading the next bit. Because we read one bit at a time, we have to use bit shifting to get the whole byte which can be translated to a character via an Ascii-table. Note that I only implemented the GPPGA format in this example.

The data is transmitted via the serial port to the PC. You can use Hyperterminal to display the data. Just configure the port where your Arduino is connected to and set a baud rate of 9600. The data is displayed in a comma seperated format which could be parsed.

Source code:

#include <string.h>

#define bit4800Delay 200
#define halfBit4800Delay 100

byte rx = 4;
byte tx = 2;

void setup() {
  //reads EM-406A tx line
  //writes to EM-406A rx line
  //if rx of the EM-406A is not used it must be set to high
  //init serial port to write output to terminal
  //init done, flash LED
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH); 
  digitalWrite(13, LOW);

byte readByte()
  byte val = 0;
  while (digitalRead(rx));
  //wait for start bit
  if (digitalRead(rx) == LOW) {
    for (int offset = 0; offset < 8; offset++) {
    val |= digitalRead(rx) << offset;
    //wait for stop bit + extra
    return val;

String getGPGGAMessage() {
  char val;
  String message = "";
  byte thresholdCounter = 0;
  while (thresholdCounter < 10) {
    val = readByte();
    if (val == '\n') {
      if (message.startsWith("$GPGGA")) {
        return message;
      } else {
        message = "";
    } else {
    // recover from bad read .. reset
      if (val == '$') {
       message = "";
      message += (char) val;
  return "";

void loop() {
And here we go with a little demonstration:



  1. Why did you use OHM resistors when the GPS is rated to run on 70mA @ 4.5 - 6.5VDC?

    1. Hi Nick,

      you are right with the energy ratings of the GPS module. And generally it would work by just connecting it without resistors. However, the 5V pin on the Arduino Uno bypasses the voltage regulator and can be instable. Since the current output is rated at max 200mA on that particular pin, the 10 Ohm and 47 Ohm resistors are placed in the circuit as a simple safety mechanism. The resistors are current limitators so that the module can't get damaged or fried by too much current if interferences happen. The 57 Ohm limit the max current to 87mA. Ohm's Law: I = V / R (0,087A = 5V / 57Ohm)