Please see the attached GPS-Speedometer.zip for code files.
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.
gps_speedofor the gps speedometer
gps_recorderrecord the gps trip
Bill of Materials
|1||XC3712||GPS Receiver module|
|1||XC4630||2.8" TFT LCD screen.|
|Some double sided and single sided tape|
Required Software and Libraries
Version numbers are at the time of this guide and might or might not work with later version.
|NeoHWSerial||SlashDevin||Latest Github https://github.com/SlashDevin/NeoHWSerial|
Serialline. You must also modify line 150 of
FAT32filesystems 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)|
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. 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.
Programming has been done for you, so simply download the code and upload from the Arduino. Make sure to select the correct board (
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:
+11 * 60 *60 = 39600for
-4 * 60 * 60 = -14400for
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.