Playing with GPS over Bluetooth Smart with nRF51822

GPS for Bluetooth Smart

In 2014 I've developed a Bluetooth Smart apps couple to transmit and receive a GPS location and speed with this nice technology. The apps are called LE GPS (transmitter, peripheral role) and LE GPS Rec (receiver, central role) and are available for iOS and Android. You can check that on my web site here: http://www.xdappfactory.com.

Standard

I like to use standards so everybody can use the same data. So I designed my apps to work with the Location And Navigation Service from the Bluetooth organization.

Adding nRF51822 in the play ground

After a while, I've been asked by several customers how to add this feature to their Arduino or Raspberry Pi project.

As an embedded engineer, I said myself: go for a try. By the time Nordic required a key to use their tool, and I found the HM-10 module very cheap, based on the competitor CC2541. But this device weakness was the development environment, I learned it the hard way.

I decided to give Nordic device another try with the RedLabBear Nano board.

alt text

RedbearLab Nano board

I was surprised to see that Nordic now don't require anymore a key and also provide a great free environment based on gcc. This will help me develop on my favorite OS: Mac OS X.

As I already had some code running on iOS, I just had to make it pure c, make a project thanks to the nice examples provided and I was good to go! The gcc tools provided with the SDK 10.0 are working great for the first time, it was so easy I did not even use a debugger for this project! The s120 work great as a central.

The result is a free firmware for the receiver part available on my Github page here

The link with the transmitter is automatic, and the output on the UART will be very easy to parse and use:

Position

Once the GPS send a valid position, you'll receive this sentence:

$LEGPS-POS,48.898048,N,2.286839,E,31.6

The construction of the sentence is $LEGPS-POS,1,2,3,4,5 where:

  1. Latitude in degrees
  2. N for north, S for south
  3. Longitude in degrees
  4. E for East, W for West
  5. Altitude in meters

Time

If the GPS send a valid time, you'll receive this sentence:

$LEGPS-UTC,2015,11,21,23,11,14

The construction of the sentence is $LEGPS-UTC,1,2,3,4,5,6 where:

  1. Year YYYY
  2. Month MM from 1 to 12
  3. Day DD from 1 to 31
  4. Hours HH from 1 to 23
  5. Minutes MM from 1 to 59
  6. Seconds SS from 1 to 59

Movement

If the GPS send heading or speed, you'll receive this sentence:

$LEGPS-MOV,2.3,355.8

The construction of the sentence is $LEGPS-MOV,1,2 where:

  1. Speed in meters/second
  2. Heading from 0 to 360 in degrees

Battery

If the GPS send its battery level, you'll receive this sentence:

$LEGPS-BAT,98

The construction of the sentence is $LEGPS-BAT,1 where:

  1. Battery level over 100 (as in %)

Future

I'de like to design a transmitter board with the Nordic device when I'll get time.

I hope you'll enjoy GPS on your electronic projects !

Romain

ps: I saw Nordic developers add a beta version project to support LNS, but it's not following the standard as they cut the transmitted data into chunk with additional headers... I hope they will figure out how to make it standard!

Parents Comment Children
No Data