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.
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:
- Latitude in degrees
- N for north, S for south
- Longitude in degrees
- E for East, W for West
- 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:
- Year YYYY
- Month MM from 1 to 12
- Day DD from 1 to 31
- Hours HH from 1 to 23
- Minutes MM from 1 to 59
- 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:
- Speed in meters/second
- 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:
- 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!