Thursday, June 6, 2013

GPS for the Beaglebone Black: D2523T 50 Channel Helical GPS Receiver

The 50 Channel D2523T Helical GPS Receiver is a pricier GPS choice at $79, but I find that it works better than the cheaper 50 Channel GP-635T GPS Receiver ($39). I live in a multistory building in downtown Minneapolis. I can only get the GP-635T to work (sometimes) out on my balcony.  D2523T Helical GPS Receiver works inside near a window or glass door. Once it has acquired a signal, I can move it 12 to 15 back from the door or window without losing the signal.

[Note: As of October, 2013, Sparkfun no longer carries thie D2523T, but a Google search will locate other sources.]

I'm using this interface cable to connect the D2523T GPS module to this GPS breakout on a breadboard.

Connections 


GPS Breakout  Beaglebone Black
Pin 3 (3V3)   P9 3
Pin 4 (GND)   P9 1
Pin 5 (TX)    P9 26
Pin 6 (RX)    P9 24

See this post for the configuration needed to use the Beaglebone Black's pins for serial (UART) communication.


Python Code


The following code pulls the latitude and longitude from the $GPRMC sentence.

import serial
import time
import datetime
import re
import os

os.system("echo uart1 > /sys/devices/bone_capemgr.9/slots")

serial = serial.Serial("/dev/ttyO1", baudrate=9600)

resp = ""

while True:
        while (serial.inWaiting() > 0):
                resp += serial.read()
                if "\r\n" in resp:
                        if "$GPRMC" in resp:
                                data = resp.split(',')
                                info = data[3] + " " + data[4] + " " + data[5] + " " + data[6]
                                print info
                        resp = ""

5 comments:

  1. That's great! a question, If I use a beaglebone black with Android, is it GPS receiver works with gps app in Android?

    regards.
    Juan C.

    ReplyDelete
    Replies
    1. Hi Juan -

      I got another Beaglebone Black a couple weeks ago so I could try another OS besides Ångström Linux, but I haven't gotten around to it. I'm not sure (yet) if the Android OS on the Beaglebone Black uses the same approach to configuring the I/O pins or not. If you are able to find out, please do post here. I would appreciate knowing how it works.

      --Brad

      Delete
    2. Hi Brad,

      Now I have a beaglebone black and I try to install android. The installation has been successful but I don't know how to configure the I/O pins. I followed next tutorial
      http://icculus.org/~hendersa/android/

      I hope that you can help me or maybe you can give me more ideas about this topic.

      Juan C.

      Delete
  2. HI Brad
    i have a beaglebone black and i try to install the gps program to find locatio e.g. but have errors i dont know why im using gps vayu 2g beaglebone cape,can you help me to finish my work?

    ReplyDelete
  3. do you have any example i C programing?

    ReplyDelete