Progress Bar

Skip to main content

Jaycar
...

GPS Speedometer

GPS Speedometer

Difficulty

Summary

Using our Arduino-compatible GPS module and TFT Screen, this project displays basic GPS information such as longitude, latitude, altitude, speed, and distance travelled from point A to B. Information are stored on an SD card which can be exported and viewed via Google Maps. Powered from a micro-USB for easy powering off your phone charger while you're in the car.

  • Due to the limited size of the Arduino, we've separated the code into two code blocks:

    •    gps_speedo for the gps speedometer

    •    gps_recorder record the gps trip

  • While it is possible to fit the two into one sketch, it's a tight fit and not very suitable for beginners. You are welcome to try though and see what you can conjure up. We've found this way is simpler and easy for you to dig through without having to worry about removing bootloaders or otherwise.

Materials Required

1Duinotech Leonardo r3 Main BoardXC4430
1Arduino Compatible GPS RCVR Receiver ModuleXC3712
1Duinotech Arduino Compatible 2.5 Inch Colour LCD Touch Screen DisplayXC4630
  •  WW4345 Wire wrap (use any colour) - Very thin wire that's perfect for small builds.
  • XC4983 8GB SD card - Use for logging GPS data.

Version numbers are at the time of this guide and might or might not work with later version.

Library

Author

Version

NeoGps

SlashDevin

4.2.9

NeoHWSerial

SlashDevin

Latest Github https://github.com/SlashDevin/NeoHWSerial

MCUFRIEND_kbv

David Prentice

2.9.8

SdFat

Bill Greiman

1.0.7

Notes

●   NeoGps and NeoHWSerial are needed to run the GPS module, the NeoHWSerial library is a custom library that isn't yet in the library manager, but is needed to enable interrupt processing on the Serial line. You must also modify line 150 of NMEAGPS_cfg.h to read:

#define NMEAGPS_INTERRUPT_PROCESSING
  • MCUFRIEND_kbv needs to be modified to work with our TFT module. Read more here.
  • SdFat provides us with an interface to FAT32 filesystems as well as provides a SoftwareSPI bus. We use 'SoftSPI' due to the case that Leonardo does not have the SPI pins on 10~13 as traditional UNOs do. This library is perfect for our needs.

GPS module

TFT Screen

TX

Pin0 (unlabeled, next to J2)

VCC

5V

GND

GND

That's all there is to it, one connection (aside from power)

To make the unit neat and organised, we're attaching the GPS module underneath the TFT screen. seeming there's only one connection, this is non-trivial.

First we'll use some single-sided tape to cover the connection pads that are at the bottom of the TFT screen.

The tape is a bit transparent so we coloured it in for you

Next we'll remove the solder connections from the GPS module, if you're unsure, follow the Guide

Then attach the module board to the underside of the TFT screen, in a suitable location, and solder the wires to where they have to go. For this, I used wire-wrap, which is very small, and fairly easy to work with if you manage to strip them without cutting the super-thin cable.

picture including wirewrap

the only final thing is the antenna. There's two locations for this, depending on whether you want to mangle your Leonardo or not. I opted to do it, by removing the ISCP connector from the Leonardo, giving room for the antenna to sit underneath the bottom of the TFT screen and using a small bit of tape to keep it in place. you can also sit it out to the side if you want, but be sure not to bump it around too much as the antenna lead is very thin and not designed to take stress.

Picture of how we set it up by removing the ISCP

Picture of how we set it up by removing the ISCP. if you don't want to remove the ISCP, you can use the alternative position but it's recommended to support the antenna in some way so it doesn't move around

That's it! you're done.

gps

Programming has been done for you, so simply download the code and upload from the Arduino. Make sure to select the correct board ( Yun or Leonardo) and the correct Port.

At the top of the code is TZ_OFFSET which is set to 39600 - this is 39600 seconds from UTC, or +11 hours AEDT for Sydney daylight saving time. Use this to change your Time zone so it shows the correct time, for instance:

  • If you are in Brisbane: you can use +11 * 60 *60 = 39600 for AEST
  • If you are in Washington (daylight saving): you can use -4 * 60 * 60 = -14400 for EDT

The GPS_speedo program will boot up and automatically tell you your location and speed.GPS_recorder will log your trip info to SD card with standard KVML format as used by Google Maps.

We welcome suggestions and improvements to the code, send in a pull request and we'll review it to merge into main branch.

Similar projects you may be interested in