dGPS and BrickPi


I have the DI-dGPS connected to my BrickPi and I have tried the test python program DI-dGPS_test.py which seems to be working.

Latitude and longitude however are not being displayed as decimal values. How do I convert latitude and longitude readout from this program into decimals that can be used in Google Maps?




Hey StevenL89,

Yup, you should just convert it in python by dividing by 10,000,000 I think. We have a quick description of what’s going on here:


Because of NXT-G 1.0’s integer math limitations, the Dexter Industries GPS sensor sends and receives data in the format ddmmmmmm. Therefore, data must be input into the GPS sensor in integer format (no decimals).

Latitude is represented by an 8-digit integer. If the position is in the northern hemisphere, the number is positive. If the position is in the southern hemisphere, the latitude is negative.
Longitude is represented by a 9-digit integer. If the position is in the eastern hemisphere, the number is positive. If the position is in the western hemisphere, the number is negative.

Would it be more convenient in our example if we just divided by 10,000,000? Should we change the example?


This works for latitude but my longitude reading appears to be way off. Longitude is reading 4221223752 and I am in New York. Is this a firmware issue?




Are you tacking another number on there at the end somehow in the python code? Your firmware is definitely working correctly, I think the number is somehow being processed wrongly, or something is being tacked on at the end somehow.


I am using the test code that came in Sensor Examples in the BrickPi_Python folder.

The program is DI-dGPS_test.py



Hi Steven,
We have chased down the problem and there was a bug in the python code. We’ll make the changes and update the code ASAP.


Hi Steven,
The dGPS_test.py has been updated in our BrickPi_Python Repository. Hope this helps. If you are facing any other problems just let us know.



It works great now. Thanks.