GPS Distance Calculator (for Golf)




Introduction: GPS Distance Calculator (for Golf)

This device was created for a final project for a class by a group of students at Indiana University. As sport fans, we thought it would be really useful to create a tool that would measure distance between two points. This could be used for many different sports, but we focused on golf. A handheld unit that could measure distance in yards from where a ball is hit and where it ends up is really what we were motivated to construct. Distance markers on golf courses are not always accurate and it is very important to know correct yardages to play well. This system could be used to keep track of the average distance for a certain club or to check the accuracy of yardage markers at the course.It works by recording latitude and longitude points of where the ball was hit from, and then calculate the distance from that location to wherever the ball lands.

The materials needed for this project are as follows :

Additionally you will need to install the Arduino IDE and a couple of libraries for it.

I sadly must report that our code was stored on my Indiana University Box account which was apparently deleted after my graduation, so I am not able to provide that any longer. If anyone who downloaded it before it was taken down is able to send it to me I would love to put it back up.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Solder Headers

The Ultimate GPS Logger and LCD Screen w/ Buttons each come with headers to be soldered on to allow them to be stacked onto your Arduino. Interestingly enough, the GPS shield came with male headers, and the LCD shield came with female headers. For this project, the LCD screen should have the male pins and the GPS should have female pins. This may have been a mistake by the company that sent us the LCD screen, as it doesn't make much sense to put something on top of the screen, but it worked out to our advantage.

Warning: Soldering can be dangerous, and all precautions should be taken. Use lead-free solder to be extra safe, wear protective eye-wear, and do not inhale any of the fumes! This is melting / burning metal, and it is not something to take lightly if you are not experienced.

When soldering the GPS headers, what we did was let it balance on the female pins upside down, and soldered each pin. We found that the best technique was to heat up the solder at the top of the pin, and use the soldering iron to keep the metal liquid and let it slide down the pin instead of soldering right at the board. As you can see in the picture, the board can take quite a bit of damage from touching it with the iron. To solder the male pins to the LCD screen, it is easiest to plug in the headers and set the screen on top of them and then solder it.

Step 2: Test Each Shield

The next thing to do is make sure that all of the soldering you just did actually works by testing each shield individually with code provided in the libraries that you have downloaded. Any of the sample files can be used to verify your work. When testing the GPS shield, you need to make sure that the device has a satellite fix, this can be observed by the flashing red light on the shield. If there is no fix it will flash red about every other second, and once it gets a connection, it will flash red once every 15 seconds. Testing the LCD screen should be very straightforward, simply plug it into the Arduino and upload a provided file and it should work.

Hint: Make sure the switch on the GPS shield is switched to software serial, and if there are still issues try switching it to direct and back to soft serial. The switch on this shield seemed to not serve its purpose, and sometimes seemed to cause issues.

Step 3: Cut GPS Logger Shield

We unfortunately only found that this was a necessary step after soldering in our bypass connection, and suffering lots of issues with our LCD screen working but randomly getting Japanese characters, and never printing the correct GPS information. The issue was that after creating our bypass, the GPS shield was sending information to two locations. We wanted to use pins 10 and 11 for our GPS shield, and this worked with only the GPS shield connected and the defined pins changed, but it was also passing some current to pins 7 and 8 (the original pins for the shield) which was interfering with our screen.

To cut the wires inside of the GPS shield, use a flat head screwdriver or similar tool to scratch away the blue paint or surface material above the line from TX and RX to pins 8 and 7 respectively. This should expose the wire underneath, and then you can use the exacto knife to cut the lines. In the image above, if you look closely, you can see the ends of the cut wires, which can be very difficult to see even in person.

Step 4: Solder the Bypass

For this step we chose to use pins 10 and 11 for our GPS shield, and we ran wire from the RX and TX holes on the board to the associated pins as you can see in the image. We used wire wrapping wire for the first connection we made, and it for some reason did not want to cooperate with the solder (it kept sliding and connecting to other pins). So for the second connection we stripped a piece of jumper wire and used it. This part of the project works best if you have two pairs of hands, one person soldering, and the other holding up the wire with tweezers. However it could be done by one person by bending the wire on the back side of the board to keep it in place, but that makes it difficult to get solder all the way around the wire to get an optimal connection (another issue that we encountered).

Step 5: Combine Shields

The next step is to simply stack the three shields Uno -> GPS -> LCD, upload our code and test out the nearly completed device. For this part of the project, you should take it outside and try to calculate actual distances. Again you must wait until the GPS module has a fix, which may now take longer with the LCD screen on top of it. If you get Japanese characters when you try to display GPS information double check that you successfully completed step 3. If everything looks good, but you only get 0.00 anytime you calculate distance, double check the connections in step 4.

Step 6: Assemble Enclosure

We ordered a plastic box from to use as an enclosure for a device. We didn’t realize at first that our battery pack is plugged into the Arduino controller, making it outside of the enclosure. This does not cause any problems with using the tool but does make it a little harder to hold. This enclosure is very poorly made. I do not suggest anyone to buy this product. Small pieces of the enclosure broke on the first attempt of assembly. The Arduino, which is the bottom layer of the device, is screwed to the bottom of the enclosure. It fits a little crooked in the box. We would suggest buying a different enclosure or making a custom one for this GPS tracker.

Step 7: Go Golfing!

Additional Tips

Make sure to have a solder remover tool on hand before starting this project! It’s always good to solder in a well-lit area while wearing safety glasses of some kind. It is recommended to stand still and point the device upward when trying to get a satellite fix for the GPS module. Getting a connection to a GPS satellite usually takes less than 45 seconds. You may wish to buy an antenna for the device to get a faster fix and possible more accurate coordinates (highly encouraged by the manufacturer).

Future Ideas / Uses

This system could be modified to be useful in many different situations. Football teams could use this to keep an average distance for punted balls or field goals. Soccer teams could use this for similar purposes. Runners could take this device with them to keep accurate measurements of how far they run each day. This device could be improved by building a custom enclosure in order to hold the battery. Time could be added to the display menu for runners so that they know what kind of pace they are running at. An antenna could be added to the GPS module to get a satellite fix quicker and give a more accurate calculation for distance.

Thank you for reading and please feel free to ask questions!

Also check out our blog here to meet our team, and get a bit more information.

Arduino Contest

Participated in the
Arduino Contest

Be the First to Share


    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    9 Discussions


    5 years ago on Introduction

    When I compile code, it throws an error. "This report would have more information with

    "Show verbose output during compilation"

    enabled in File > Preferences.

    Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"

    Final_Working:110: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:111: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:112: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:113: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:114: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:115: error: expected constructor, destructor, or type conversion before '.' token

    Final_Working:116: error: expected constructor, destructor, or type conversion before '.' token"


    Reply 5 years ago on Introduction

    did you enable verbose output? do you have all of the libraries?

    and do those lines look like:

    Serial.print("Menu change ");


    Serial.print(" ");






    Reply 1 year ago

    can you share the code please


    2 years ago

    Does anyone have a copy of the code for this project.


    3 years ago

    I have been always frustrated from the missing double (64bit) type in Arduino world and hence the problem with properly calculating GPS distance, bearing and destination point.

    The following library uses Float64 & Math64 libs and also adds some fast and very fast implementations of trigonometric functions and fast and regular versions of GPS GPS distance, bearing and destination point.

    Feel free to use it - and any help in improving it is welcome !


    5 years ago on Introduction

    This sounds like a device that has potential to support an idea/invention I have. I would like to chat with you a bit more.


    Reply 5 years ago on Introduction

    Glad you thought so, I'd be glad to answer any questions. I can't wait to post about my next project!!