GPS Module

Ublox GPS Module

GPS devices are getting very small and very cheap, and they pretty much all use the NMEA standard. This transfers simple human-readable serial data at 9600 baud.

To use a GPS module, just wire it up as follows. I'm using the Ublox NEO6MV2 module:

GPS Espruino
RX C10
TX C11

Note: The Ublox NEO6MV2 has a voltage regulator on board - however if you have a different module then it might need a 3.3v supply.

For software, just do something like the following:

var gps = require("GPS").connect(Serial4, function(data) {

This will return data every second that looks a lot like:

{ "time":"16:35:29", "lat":53.068403, "lon":-4.076282,
  "fix":1, "satellites":7, "altitude":1085.0 }

The latitude and longitude are in degrees North and East respectively, and altitude is in meters.

Not getting anything? GPS devices often take several minutes to get a GPS lock and some may not output data until they have it. Mobile phones get a lock much faster because they have rough time and location information from the mobile phone mast to help with the fix.

There's a lot more data available from the GPS (such as velocity). To hook onto this you can use the line event which is called every time a line of data is received from the GPS:

var gps = require("GPS").connect(Serial4);
gps.on('line', function(line) {

You can also use the method above to help to debug if you're not receiving a callback from the GPS module.


