Arduino GPS Shield Tutorial: Distance Calculator

Arduino GPS Shield Tutorial

Arduino GPS Shield Tutorial

Arduino GPS Shield Tutorial is about using the Arduino GPS shield on 1SHeeld to calculate the distance between your current location and the desired destination.

But let’s first talk a bit about the GPS technology.

GPS or Global Positioning System is a satellite-based radio navigation system which allows you to get your location and guide you through other locations. It does this through a well recognized and predefined map like Google maps.

But in the world of Arduino, we are going to accomplish this by the Arduino GPS Shield.

The GPS knows your location through the latitude and longitude values of your location. These values specify where exactly are you from the world.

We are going to use these two measurements to calculate the distance between your current location and the desired destination using the GPS shield on 1Sheeld in a quick and funny Arduino GPS Shield Tutorial.

Let’s talk about the idea behind this Arduino GPS Shield Tutorial.

 

Idea:

In the Arduino GPS Shield Tutorial, we will use the GPS Shield from 1Sheeld via its Android/iOS App to get the current location.

We achieve this by telling the App (by using the voice recognition shield) both the latitude and longitude of the desired location we want to reach. Then Arduino will calculate the direct distance between the 2 locations in km unit by using the GPS shield. Finally, it tells us (by using the text-to-speech shield) what the distance is.

 

Getting started:

If this is your first time to deal with 1Sheeld or you want to learn more about it, I recommend checking this quick and easy getting started tutorial.

Now, after you’ve become a little bit familiar with 1Sheeld, let’s start!

 

Step 1: Hardware components used is the Arduino GPS Shield Tutorial:

–       Arduino Uno.

–       1Sheeld+ board.

–       Arduino USB cable or 9-12v battery.

–       Android/iOS phone with 1Sheeld App installed on it.

 

Step 2: Software components:

 

Step 3: Connection and Schematic:

  • Plug the 1Sheeld board into your Arduino as this:

  • Switch the 1Sheeld power to operate on 5v (Not the 3.3v):

  • 1Sheeld have 2 modes: Uploading mode and Operating mode. You can switch between them using the switch close to the Digital pins and is called “UART SWITCH” on 1Sheeld and “SERIAL SWITCH” on 1Sheeld+.

Firstly, you slide the switch towards the “SWITCH” notation which turns the 1Sheeld board into the Uploading mode to let you upload the Arduino code.

Secondly, after you finish uploading the code, slide the switch towards the “UART” notation (or “SERIAL” at 1Sheeld+ board) which turns the 1Sheeld board into the Operating mode to communicate with your smartphone 1Sheeld App.

  • Finally, onnect the Arduino via your PC using Arduino USB cable.

 

Code:

I would recommend checking the Arduino GPS Shield documentation to know more about the Arduino GPS Shield functionalities and how to use them.

Now, switch the 1Sheeld board to the Uploading mode, upload this code:

Then, Switch the 1Sheeld board to the Operating mode then open the 1Sheeld app and connect it to the 1Sheeld board via Bluetooth.

 

Step 5: Run it:

Firstly, select the GPS, Terminal, Text-to-speech and Voice recognition shields.

Once you navigate to the voice recognizer shield and tell your phone the location you want in terms of latitude and longitude values, it will calculate the distance between the current location and the location related to the entered latitude & longitude and tells you loudly the distance and also written in the Terminal shield tab.

I wanted to know the distance between my current location “Integreight company” and the Ramsis Train Station in Cairo’s downtown. It was 8.327 km. Then I calculated it from Google maps too where the error was so little.

Google maps distance is: 8.22km according to the screenshots below.

 

That’s it, guys. I hope you enjoyed this Arduino GPS Shield Tutorial. And for any questions or even opinions about it please don’t hesitate to leave your comments down below. See you with a new short and simple Arduino tutorial 😉




Related Blogs

Arduino IoT

Arduino IoT Shield Functions Explainer

Arduino makers …. you can connect your Arduino to MQTT brokers(servers) and launch your IoT with Arduino IoT Shield! It’s the 1Sheeld IoT shield that will do the job for you. It’s one of the most important but recent Arduino shields in 1Sheeld. Simply, it turns your Arduino into MQTT client where you can publish and …

Arduino Temperature Humidity System

IoT Arduino Temperature and Humidity System

Monitor my home environmental parameters remotely is one of the most desirable things I have ever wanted to make. It’s not about purchasing such a system that can get the job done for me. But, passion to create it myself. So, today, I am going to connect the popular DHT sensor to an online MQTT …

Arduino Door Lock

IoT Arduino Door Lock using 1Sheeld and Smartphone

  “Oh God! … It seems like I have forgotten the door lock open, again” … the normal saying whenever I am in hurry to go out! Have you encountered this problem before? It always confuses me since I may even think that I have left the door lock opened, and once I go back, …

IoT Fan Control

Arduino IoT Fan Control using 1Sheeld and Smartphone

Here I am with another IoT-based home automation project; Arduino IoT Fan Control. Every day, I get back from work tired and feeling hot. No air conditioner here and the fan takes much time to start cooling the room, sadly! So, I was thinking why not controlling the fan from outside my home with my …

Arduino Light Control

IoT Arduino Light Control using 1Sheeld and Smartphone

Have you ever forgotten to turn your home lights off when you got outside? Sadly, it happens to me all the time. And this causes confusion once I get my bills! Furthermore, here is one secret about me; I am a lazy man. I always want to control my room lamp from my sweet bed. …

mqtt-protocol

MQTT Protocol – How it Works

MQTT is one of the most commonly used protocols in IoT projects. It stands for Message Queuing Telemetry Transport. In addition, it is designed as a lightweight messaging protocol that uses publish/subscribe operations to exchange data between clients and the server. Furthermore, its small size, low power usage, minimized data packets and ease of implementation …