Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

Components and supplies

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Arduino UNO
×1
GPS Module (Generic)
NEO-6M GPS Module
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
LED (generic)
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Texas Instruments Dual H-Bridge motor drivers L293D
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Brown Dog Gadgets Solar Cockroach Vibrating Disc Motor
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
SparkFun Snappable Protoboard
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
9V battery (generic)
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
9V to Barrel Jack Connector
×1
A Box
Something to enclose the project in.
×1
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Jumper wires (generic)
×1

Necessary tools and machines

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Soldering iron (generic)
Wire Stripper

Apps and online services

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Arduino IDE

About this project

Introduction: The Problem and Solution

Everyone knows that traffic jams can be a major time waster. And it is impossible to predict how long it would take from origin to destination.

The problem of traffic jams affected me when I came to a city two months ago. Every day I spend more than two hours stuck in jams. And I felt it like why can't I utilize this time to do something?

Note: I use public transport. :-)

There are plenty of other things you can do while being stuck in traffic jam!

Some of the ones below are not just fun, but productive too:

  • Use the time to think and plan, either for current and future projects.
  • Utilize time to educate yourself, watch instructional videos or take an e-learning course on Udemy, Coursera, etc.

And of course making electronics stuffs always inspires me. So I built a destination notifier using Arduino and GPS module. So what it does is whenever you are near to your destination, it notifies you by glowing LED or through vibration (by using mini vibrating motor). I have provided circuits for both LED and vibrating motor.

For that, first you need to find latitude and longitude to define the location. Once you find your location, you can use the latitude and longitude values to find distance to the location and by keeping a range you can turn on the notifier. The logic is simple, right?!

So let's get started.......

Parts and Tools:

To get started with your destination notifier, here are the required parts:

  • Arduino UNO
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
  • NEO-6M GPS Module

GPS stands for global positioning system and can be used to determine position, time and speed if you are travelling.

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
  • This module has an external antenna and built-in EEPROM.
  • Interface: RS232 TTL
  • Power supply: 3V to 5V
  • Default baudrate: 9600 bps
  • Works with standard NMEA sentences

The NEO-6M GPS module has four pins: VCC, RX, TX, and GND. The module communicates with the Arduino via serial communication using the TX and RX pins, so the wiring couldn’t be simpler:

NEO-6M GPS ModuleWiring to Arduino UNO

VCC VIN

RX TX pin defined in the software serial

TX RX pin defined in the software serial

GND GND

L293D IC

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

The L293D is a 16-pin motor driver IC which can control upto two DC motors simultaneously in any direction.

Why to use L293D?

The input to the motor driver IC or motor driver is a low current signal.The function of the circuit is to convert the low current signal to a high current signal.This high current signal is then given to the motor.

TinyGPS++ Library :

The TinyGPS++ library makes it simple to get information on location in a format that is useful and easy to understand.

The TinyGPS++ library allows you to get way more information than just the location, and in simple way, besides the location, you can get:

>>date

>>time

>>speed

>>course

>>altitude

>>satellites

>>hdop

Capturing Latitude and Longitude:

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

I will suggest downloading fritzing files given on the end of the project for better clarification of connection or if you have any doubt feel free to ask in comments.

Arduino Code for Location Capture:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
void setup(){
Serial.begin(9600);
ss.begin(GPSBaud);
}
void loop(){
// This sketch displays information every time a new sentence is correctly encoded.
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6);
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 6);
}
}
}

Note: You must install TinyGPS++ Library

connect as per the circuit diagram and upload above code, Open serial monitor at a baud rate of 9600 and you will see the following output

Note: For getting latitude and longitude it may take some time.because the receiver need to capture the signals. whenever it starts getting signals the LED on the GPS module blinks.

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

Destination Notifier Through LED:

So to ensure that my idea works I made a prototype using LED to notify the destination. So what I did is, I added Latitude and Longitude values of destination from previous code(Read_Lat_Lng.ino) and found distance to destination from the current location. And used it for setting range at which the LED must turn on.

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

Code:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
// For stats that happen every 5 seconds
unsigned long last = 0UL;
int ledPin = 13;
void setup()
{
Serial.begin(115200);
ss.begin(GPSBaud);
pinMode(ledPin, OUTPUT);
}
void loop()
{
// Dispatch incoming characters
while (ss.available() > 0)
gps.encode(ss.read());
if (gps.location.isUpdated())
{
Serial.print(F(" Lat="));
Serial.print(gps.location.lat(), 6);
Serial.print(F(" Long="));
Serial.println(gps.location.lng(), 6);
}
else if (millis() - last > 5000)
{
Serial.println();
if (gps.location.isValid())
{
// replace 'Dest_LAT' and 'Dest_LON' values basedon your location
// you can find Latitude and Longitude from Read_Lat_Lng.ino
static const double Dest_LAT = 18.786254, Dest_LON = 73.880798;
double distanceToDest =
TinyGPSPlus::distanceBetween(
gps.location.lat(),
gps.location.lng(),
Dest_LAT,
Dest_LON);
Serial.print(F("Distance to Destination ="));
Serial.print(distanceToDest/1000, 6); // *Prints distance to destination
if(distanceToDest/1000 < 0.050000) //Here when distanceToDest/1000 is less than 0.050000 LED turns on . So change *distance to destination as per your requirement.
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}
if (gps.charsProcessed() < 10)
Serial.println(F("WARNING: No GPS data. Check wiring."));
last = millis();
Serial.println();
}
}

Upload the code and you will see the following on the serial monitor.

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

So the distance to destination can be used to define the range at which the output operation (notification) must perform.

The Final One!

OK my prototype worked fine. Now I want to enclose my project into a box which can fit an Arduino, GPS module, motor with driver IC, and the 9V power supply.

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

Connection to the L293D IC

Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module
  • Connect 5V to Enable 1, Vs and Vss on the L293D
  • Connect digital output pins (we are using 6 and 7 ) to input 1 and input 2 on the L293D.
  • Connect your Arduino's GND to both GND pins on the same side of the L293D
  • Finally connect output 1 and output 2 of the L293D to your motor pins.
Build a GPS Destination Notifier with Arduino UNO & NEO‑6M Module

Code:

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
// For stats that happen every 5 seconds
unsigned long last = 0UL;
int motorpin1=6;
int motorpin2=7;
void setup()
{
Serial.begin(115200);
ss.begin(GPSBaud);
pinMode(motorpin1,OUTPUT);
pinMode(motorpin2,OUTPUT);
}
void loop()
{
// Dispatch incoming characters
while (ss.available() > 0)
gps.encode(ss.read());
if (gps.location.isUpdated())
{
Serial.print(F(" Lat="));
Serial.print(gps.location.lat(), 6);
Serial.print(F(" Long="));
Serial.println(gps.location.lng(), 6);
}
else if (millis() - last > 5000)
{
Serial.println();
if (gps.location.isValid())
{
// replace 'Dest_LAT' and 'Dest_LON' values based on your location
// you can find Latitude and Longitude from Read_Lat_Lng.ino
static const double Dest_LAT = 18.786254, Dest_LON = 73.880798;
double distanceToDest =
TinyGPSPlus::distanceBetween(
gps.location.lat(),
gps.location.lng(),
Dest_LAT,
Dest_LON);
Serial.print(F("Distance to Destination ="));
Serial.print(distanceToDest/1000, 6); // *Prints distance to destination
if(distanceToDest/1000 < 0.050000) //Here when distanceToDest/1000 is less than 0.050000 LED turns on . So change *distance to destination as per your requirement.
{
digitalWrite(motorpin1,LOW);
digitalWrite(motorpin2,HIGH);
}
else
{
digitalWrite(motorpin1,HIGH);
digitalWrite(motorpin2,HIGH);
}
}
if (gps.charsProcessed() < 10)
Serial.println(F("WARNING: No GPS data. Check wiring."));
last = millis();
Serial.println();
}
}

Happy making!

Code

  • Read_Lat_Lng.ino
  • Destination_notifier_LED.ino
  • Destination_notifier_motor.ino
Read_Lat_Lng.inoArduino
 
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup(){
  Serial.begin(9600);
  ss.begin(GPSBaud);
}

void loop(){
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0){
    gps.encode(ss.read());
    if (gps.location.isUpdated()){
      Serial.print("Latitude= "); 
      Serial.print(gps.location.lat(), 6);
      Serial.print(" Longitude= "); 
      Serial.println(gps.location.lng(), 6);
    }
  }
}
Destination_notifier_LED.inoArduino
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

// For stats that happen every 5 seconds
unsigned long last = 0UL;


int ledPin = 13;


void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);

pinMode(ledPin, OUTPUT);
}

void loop()
{
  // Dispatch incoming characters
  while (ss.available() > 0)
    gps.encode(ss.read());

  if (gps.location.isUpdated())
  {
    
    Serial.print(F("  Lat="));
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(" Long="));
    Serial.println(gps.location.lng(), 6);
  }



  else if (millis() - last > 5000)
  {
    Serial.println();
    if (gps.location.isValid())
    {

      // replace 'Dest_LAT' and 'Dest_LON' values basedon your location  
      // you can find Latitude and Longitude from Read_Lat_Lng.ino  
      static const double Dest_LAT = 18.786254, Dest_LON = 73.880798;
      double distanceToDest =
        TinyGPSPlus::distanceBetween(
          gps.location.lat(),
          gps.location.lng(),
          Dest_LAT, 
          Dest_LON);
      

      Serial.print(F("Distance to Destination ="));
      Serial.print(distanceToDest/1000, 6);       // *Prints distance to destination 
      
      if(distanceToDest/1000 < 0.050000)   //Here when distanceToDest/1000 is less than  0.050000  LED turns on . So change *distance to destination as per your requirement. 
      {
        digitalWrite(ledPin, HIGH);
      }
      else
      {
        digitalWrite(ledPin, LOW);
      }
    }

   

    if (gps.charsProcessed() < 10)
      Serial.println(F("WARNING: No GPS data.  Check wiring."));

    last = millis();
    Serial.println();
  }
}
Destination_notifier_motor.inoArduino
#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

// For stats that happen every 5 seconds
unsigned long last = 0UL;


int motorpin1=6;
int motorpin2=7;


void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);

pinMode(motorpin1,OUTPUT);
pinMode(motorpin2,OUTPUT);
  
}

void loop()
{
  // Dispatch incoming characters
  while (ss.available() > 0)
    gps.encode(ss.read());

  if (gps.location.isUpdated())
  {
    
    Serial.print(F("  Lat="));
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(" Long="));
    Serial.println(gps.location.lng(), 6);
  }



  else if (millis() - last > 5000)
  {
    Serial.println();
    if (gps.location.isValid())
    {

      // replace 'Dest_LAT' and 'Dest_LON' values basedon your location  
      // you can find Latitude and Longitude from Read_Lat_Lng.ino  
      static const double Dest_LAT = 18.786254, Dest_LON = 73.880798;
      double distanceToDest =
        TinyGPSPlus::distanceBetween(
          gps.location.lat(),
          gps.location.lng(),
          Dest_LAT, 
          Dest_LON);
      

      Serial.print(F("Distance to Destination ="));
      Serial.print(distanceToDest/1000, 6);       // *Prints distance to destination 
      
      if(distanceToDest/1000 < 0.050000)   //Here when distanceToDest/1000 is less than  0.050000  LED turns on . So change *distance to destination as per your requirement. 
      {
        
  digitalWrite(motorpin1,LOW);
  digitalWrite(motorpin2,HIGH);
      }
      else
      {
       digitalWrite(motorpin1,HIGH);
       digitalWrite(motorpin2,HIGH); 
      }
    }

   

    if (gps.charsProcessed() < 10)
      Serial.println(F("WARNING: No GPS data.  Check wiring."));

    last = millis();
    Serial.println();
  }
}

Schematics

read_lat_lng_l3VSL54w0k.fzzdestination_notifier_led_c7qaqTImXg.fzzdestination_notifier_motor_fGc8OV6Y0w.fzz

Manufacturing process

  1. JX Wave Generator – Arduino-Compatible DDS Oscillator with OLED Display
  2. Build an Arduino Iron Man: Components, Sensors, and Step‑by‑Step Guide
  3. Find Me: Smart Item Locator with Arduino and Bluetooth
  4. Connecting Arduino Mega to a NEO‑6M GPS Module: A Step‑by‑Step Guide
  5. DIY Arduino Humidifier Controller with Relay – Safe High‑Voltage Setup
  6. u-blox LEA‑6H 02 GPS Module: Arduino & Python Integration Guide
  7. Build a Custom Arduino Joystick Steering Wheel for Gaming
  8. Arduino 101: Build a Pedometer with DHT11 Sensor & LCD Display
  9. PhoneLocator: Securely Locate Your Phone Anywhere
  10. Arduino Due Project Kit: TFT, GPS, RTC, Sensors, Bluetooth & Joystick – Full Component List