Nodemcu GPS Tracker using Arduino Nodemcu esp8266 and Blynk

Nodemcu GPS Tracker Project Description:


Nodemcu GPS Tracker– This tutorial is based on the Real-Time GPS tracking system using Arduino, Neo 6M GPS module, Nodemcu ESP8266 wifi module, and Blynk Application. With the help of this project, the GPS module can be tracked in real-time, which means you can track almost anything you want. This is the 2nd version of the GPS tracking system.

While in the 1st version I designed a GPS tracking system for the car accident location tracking, in which I used the GSM module. This was not a real-time tracking system, this system was designed to send a message only if the car had an accident. In this project, the limit switch was used for sensing the accident.  If you want to watch this tutorial.

Note: this old version of the Blynk app is no more functional. For the blynk mobile App setup and dashboard setup ready my article on the New Blynk V2.0. In this article I have explained how to migrate your projects from Blynk 1.0 to the new Blynk V2.0. You can also watch the video.

Amazon Links:

12v Adaptor:

Arduino Uno

Arduino Nano

Mega 2560:

Nodemcu ESP8266 WiFi Module:

LM7805 Voltage Regulator:

470uf capacitor:

330-ohm resistor:

DC Female Power Jack:

Female Headers:

Male Headers:

NEO 6M GPS module:

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines


*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Before I explain the circuit diagram and programming, first of all, I want to share with you some very useful information regarding the Arduino IDE version and Nodemcu board installation. First of all, make sure that you download the latest version of the Arduino IDE which IS 1.8.8 because the map widget needs the latest version. The next step is to click on the file

Nodemcu GPS

Then click on the preferences and make your check the compilation and upload boxes.

Nodemcu GPS

 then simply paste this

 link and click ok.

Now click on the tools menu goto boards, simply click on the boards manager and wait for a while to update. then search for the esp8266 and install…and install the latest version which is 2.4.2….  For the complete step by step board installation watch video Tutorial.

Now let’s discuss the circuit diagram.

Nodemcu GPS Tracker Circuit Diagram:

Nodemcu GPS Tracker

Nodemcu GPS

This schematic is designed in cadsoft eagle 9.1.0 version. If you want to learn how to make schematics and PCB’s then watched my tutorial.

The Nodemcu module tx and Rx pins are connected with pin7 and pin8 of the Arduino. While the Vin pin of the Nodemcu module is connected with the output of the voltage regulator. This is a regulated 5v power supply based on the lm7805 voltage regulator. Two 470uf capacitors are connected at the input and output side of the regulator.  A 330-ohm resistor is connected in series with a 2.5v led. This is a current limiting resistor. While J1 is the dc female socket, over here you can connect a 12v adaptor or battery. But you can also power up the Nodemcu module using your laptop USB port. But in my case, I am going to use a 12v adaptor.

The VCC pin of the neo 6m GPS module is connected with 3.3v and its ground is connected with the Arduino’s ground. The Tx and Rx pins of the GPS module are connected with pin number 2 and pin number 3 of the Arduino.

Blynk application designing for Real-time GPS Tracking:

Nodemcu GPS Tracker

Nodemcu GPS

For the Step by Step Blynk application designing watch Video Tutorial Click Here

Nodemcu GPS Tracker Programming:

In this project, two programs are used, one program is written for the Arduino Board while the other program is written for the Nodemcu ESP8266 Wifi Module.

For the step by step program explanation watch Video Tutorial given at the end of this article.

Arduino GPS Programming:

#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#include <stdlib.h>
static const int RXPin = 2, TXPin = 3;
static const uint32_t GPSBaud = 9600;

// some strings 
String myindex = "1"; // this number is incremented as we increase the number of GPS modules. 
// let's say if you are using 2 GPS modules, then we will use the same programming but will change the index number to 1, for third nodemcu module we change it to 2 and so on. 
String mylong = ""; // for storing the longittude value
String mylati = ""; // for storing the latitude value
String myvalue = "abc"; 

char buff[10];
// The TinyGPS++ object
TinyGPSPlus gps;

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

SoftwareSerial nodemcu(7, 8); // for gsm module

int led = 13; // tilt sensor output indication

String textForSMS;
 int limits = 4; // limit switch
 double longitude; 
 double latitude;
void setup()
  Serial.println(" logging time completed!");
  pinMode(limits, INPUT);
  digitalWrite(limits, HIGH);

  Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
  Serial.print(F("Testing TinyGPS++ library v. ")); 


void loop()

    // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0)
    if (gps.encode(

  if (millis() > 5000 && gps.charsProcessed() < 10)
    Serial.println(F("No GPS detected: check wiring."));
 // for the button 
  if(digitalRead(limits) == HIGH)
latitude =, 6 ;
longitude = gps.location.lng(), 6 ;
// for latitude
  mylati = dtostrf(latitude, 3, 6, buff);
  mylong = dtostrf(longitude, 3, 6, buff);
 textForSMS = textForSMS + myindex + "," + mylati + "," + mylong + "," + myvalue +","; 
// textForSMS = textForSMS + myindex + "," + "34.014623" + "," + "72.164979" + "," + myvalue +",";
  textForSMS = ""; 
  digitalWrite(limits, HIGH);
   digitalWrite(led, LOW);

void displayInfo()
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
    Serial.print(, 6);
    Serial.print(gps.location.lng(), 6);
    Serial.print(" ");

  Serial.print(F("  Date/Time: "));
  if (

  Serial.print(F(" "));
  if (gps.time.isValid())
    if (gps.time.hour() < 10) Serial.print(F("0"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));


Nodemcu esp8266 wifi module Programming:

// make sure to use the latest version 1.8.8 of Arduino ide
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
#include <SimpleTimer.h>

WidgetMap myMap(V0);
char auth[] = "5b282ebfba3140fcb794199f760f5b8a";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ZONG MBB-E8231-6E63";
char pass[] = "08659650";

SimpleTimer timer;

String myString; // complete message from Arduino, which consists of snesors data
char rdata; // received characters
String gpsdata = "";

int myindex;
float mylat;
float mylon;
String myvalue;
double fahad;  

int firstVal, secondVal, thirdVal; // sensors
// This function sends Arduino's up time every second to Virtual Pin (1).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V1, millis() / 1000);


void setup()
  // Debug console

  Blynk.begin(auth, ssid, pass);

  timer.setInterval(1000L, sensorvalue1);


void loop()
  if (Serial.available() == 0 )
  {;; // Initiates BlynkTimer

  if (Serial.available() > 0 )
    rdata =;
    myString = myString + rdata;
    // Serial.print(rdata);
    if ( rdata == '\n')
      gpsdata = myString;
      String k = getValue(myString, ',', 0); // index
      String m = getValue(myString, ',', 1); // lati
      String n = getValue(myString, ',', 2); // longi
      String o = getValue(myString, ',', 3); // Value

      myindex = k.toInt();
      mylat = m.toFloat();
      mylon = n.toFloat();
      myvalue = o;


      myString = "";
      // end new code


void sensorvalue1()
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  // Blynk.virtualWrite(V2, gpsdata);
  myMap.location( myindex, mylat, mylon, myvalue);


String getValue(String data, char separator, int index)
  int found = 0;
  int strIndex[] = { 0, -1 };
  int maxIndex = data.length() - 1;

  for (int i = 0; i <= maxIndex && found <= index; i++) {
    if (data.charAt(i) == separator || i == maxIndex) {
      strIndex[0] = strIndex[1] + 1;
      strIndex[1] = (i == maxIndex) ? i + 1 : i;
  return found > index ? data.substring(strIndex[0], strIndex[1]) : "";

Watch Video Tutorial:

Arduino Project: GPS Tracker using Nodemcu esp8266 and Blynk application “Real-time tracking map”


Other GPS Related Projects:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...


  1. hello sir, kindly I’m following your procedure of this project but I got problem with SimpleTimer, would you help me sir?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button