Fork me on GitHub

Project Notes

#387 GpsBasics

Using a NEMA-compatible GPS module for time and location with an Arduino.



The GPS module I obtained (similar to this) is variously marketed as GY-NEO6MV2 or GY-GPS6MV2, and at least in my case uses an integrated GPS chip/module marked as XM37-1612.

GPS Module


Specifications (as far as I’ve been able to glean from the Internet):

  • Communication mode: TTL level, compatible with 3.3v / 5v system
  • Power supply: DC 2.7-5v
  • Working current: 45mA
  • txd rxd impedance: 510R
  • Default transmission speed: 9600
  • Time to catch: warm start: 1s
  • Cold start: 27s
  • Temp: -40 ~ 85 ℃
  • Positioning accuracy: 5m
  • Module size: 25 mm x 35 mm (approximately)
  • Antenna size: 25 mm x 25 mm


  • use the XM37-1612 module. MTK platform, with high gain active antenna
  • TTL level, compatible with the 3.3v / 5v system
  • the default baud rate: 9600
  • with rechargeable backup battery, can save the ephemeris data when it power off, and make the boot warm.
  • Suitable for RC Quadcopter, Browser

Listening to Raw GPS Module Output

The module has basic serial RX/TX connectors, that runs at 9600 baud. To examine the raw output, here I’m connecting directly to the module with a CH340G-based USB to UART adapter, and using screen to display the output.

On MacOSX, the programmer shows up as a character device:

$ ls -1 /dev/cu*
/dev/cu.wchusbserial14530 # <- this one (it appeared after connecting the module)

The simplest way of getting connected on MacOSX is to use screen, at 9600 baud:

$ screen /dev/cu.wchusbserial14530 9600

The NEMA Protocol

This module appears to be constructed with a boot-time configuration:

  • Protocol: NMEA, Input/output, ASCII, 0183, 2.3 (compatible to 3.0)
  • Messages: GSV, RMC, GSA, GGA, GLL, VTG, TXT
  • Baud rate: 9600

The NEMA protocol is apparently one of those nasty proprietary and copyrighted standards, intended for Serial-Data Networking of Marine Electronic Devices. The full NMEA Standards are priced way beyond the reach of a weekend tinkerer. But happily there is enough information floating around the net to at least make sense of the messages coming out of NEMA-compatible products.

With the help of Glenn Baddeley’s GPS - NMEA sentence information site, I can make some sense out of the trace captured above. For example:


Here we have a number of $GPxxx sentences:

  • $GPGSV - GPS Satellites in View
  • $GPRMC - Recommended Minimum Specific GPS/TRANSIT Data
  • $GPVTG - Track Made Good and Ground Speed
  • $GPGGA - Global Positioning System Fix Data

Followed by interpreted sentences from the GPS unit:

  • $GPGLL - Geographic position, latitude / longitude
  • $GPGSA - GPS DOP and active satellites

Using NEMA GPS Data on an Arduino

The TinyGPSPlus library parses the NEMA codes and provides a nice API for getting the results. It can work in conjunction with SoftwareSerial library to allow GPS serial connections on pins other than 0/1.


The GpsBasics.ino sketch is a simple demonstration, heavily influenced by the TinyGPSPlus examples.

I’m using an Arduino with Nokia 5110 Shield, so in addition to logging detailed GPS readings to the serial port, it displays the basic time and location information on the LCD.

Libraries Used


A summary is displayed on the LCD:


And details logged to serial output:





Pin Connections

Module Schematic Label Arduino Script Label
VCC VCC 5v -

Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.