GPS data display via OTG cable

This app intelligently reads the output from a GPS module. The GPS is connected to the Android device via a TTL/USB converter and an OTG cable.

The app parses the NMEA sentences outputted by the GPS and displays:

. the raw data
. the parameters of interest (lat,lon,speed...)
. the full NMEA sentences
. a map showing current location

The data display is static, unlike when using a USB serial terminal app which will show a scrolling display of the sentences.

Am looking forward to comments and suggestions.

GPS_via_OTG_v1b.aia (201.8 KB)
some screenshots:

  1. raw data, in USB serial terminal app
  2. sentences, after positional fix (my app) - static, not scrolling
  3. parameters, after positional fix (my app)

Opening screen.

Map view:

Can you tell me why you started this project. It l looks very specialized to me.

Hello Peter.
I've been playing around with GPS for about three years. I'm not referring to the commercial units that do everything for you such as what Garmin sell or are in modern cars.

I mean the single board modules that are commonly available on ebay. Just search "Neo 6M module" for examples. These modules emit a stream of serial text data on their TX pin and you have to process that data stream to get useful information.

Most makers use Arduino for processing the GPS output and so have I. The smart phone or tablet makes a a far better display than the normal display devices used with Arduino.

GPS is somewhat maddening -- great when it works, frustrating when it doesn't. I wanted the simplest setup to monitor the output from startup. That's what this app does for me and it works well. I can easily see if the GPS is getting satellite data. I wanted the minimum of DIY components, so I've omitted any Arduino. It should be easily applied by others.

Thanks for the interest.


1 Like

Just to make it complete some info on the gps module used.

1 Like

Since you enjoy experimenting John, you might try the Advanced Location Sensor by Niclas Gins. ALS uses a device's gps and will display the NMEA sentences.

I've been experimenting with gps for a long time. I connected surplus single channel gps receivers to my PC many years ago. Your app is quite clever. :slight_smile: I created similar Windows programs using surplus truck gps modules... long time ago. Have fun.


This photo shows my physical setup. The phone is running a USB serial terminal app, not my app. This setup promises to be highly portable if the two boards can be put in a robust housing without the breadboard.

GPS to phone by OTG


Thanks, Steve. I'll look into ALS.

I'm quite naive about the location capability of smart phones. I've enjoyed working with GPS modules.


Here's my latest version. It includes a view that gives all satellite signal stregths (32x), shown as numerical values and graphical indication (bars).

GPS_via_OTG_v1f.aia (253.7 KB)

1 Like

Here is a screenshot of the view of sat signals:

Nice :slight_smile:

now perhaps plot them?

Keep up the good work.

Thanks, Steve.

Is that screenshot from an App Inventor app? I couldn't find any app to process GPS output.

Yes Cedric. It uses the Advanced Location Sensor extension and a Canvas to plot the NMEA results in a polar plot.

Find Niclas's Gins free ALS extension

Latest version:
GPS_via_OTG_v1g.aia (251.8 KB)

Works well. The sentences are often corrupted and I have included error traps to block most corrupted sentences. Has anyone developed blocks to do checksum?

See item 6 in Using LINUX commands in App Inventor. Extension

I find that satellite data NMEA sentences are remarkably accurate (using the ALS extension with an Android device). If corrupted data strings is a huge problem I suspect sampling from your Arduino maybe too fast and cutting off data; perhaps a slower sampling rate? Yes, most sentences contain a checksum you could compare with the data you read. I solved data quality by filtering out 'sentences' that I do not use. Perhaps you can limit what 'sentences' are read?

Hi Steve.

I'll look into that, ta.

Yeah, corrupted is perhaps the wrong word. The raw data appears fine. I can read it with the Serial OTG Terminal app and it looks fine.

The app reads a line of data from the serial connection which I need it to be a complete & perfect NMEA sentence, starting with '$' and ending with the checksum. The line read by the app is often a mishmash of the raw data. For instance, a full sentence and a portion of the next. So it might be something along the lines you suggest. I can control the app clock speed so I'll see if that helps.

There's no Arduino device involved. Its: GPS --> TTL/USB conv. --> OTG cable --> phone. so there's no software processing the data stream other than whatever is done in the TTL/USB converter. I would have thought the phone app might be too slow to keep the buffer from filling. I normally set the app clock interval to zero and it empties the buffer within a second which is the output rate of the GPS, ie, 1Hz.

I want all six sentences the GPS is outputting.

The app works well, but sometimes there are Notifications indicating the line read is not a true sentence.