Read GPS data from thingspeak and show it in the Google map using ESP12e Nodemcu and GPS Neo 6M Module

Programming ESP12E NodeMCU Module to upload GPS data on Thingspeak

Introduction

We will be programming ESP12E NodeMCU Module to upload GPS data on Thingspeak. In the previous tutorial we created a thingspeak channel and copy pasted credentials on a notepad file. We will now use these credentials which we got from our new created channel to upload the data onto them. In the first lesson  we setup the breadboard circuit ESP12E NodeMCU and connected it to Neo 6M GPS module. Now lets program and see the uploaded data on the thingspeak chart. Follow the below instructions step by step:

  1. You will need the "Tiny GPS Plus" library for this tutorial. Visit the following link and add it to the arduino library.

https://github.com/mikalhart/TinyGPSPlus

Download the zip and include it in the arduino library.

Programming-ESP12E-NodeMCU-Module-to-upload-GPS-data-on-Thingspeak

Programming-ESP12E-NodeMCU-Module-to-upload-GPS-data-on-Thingspeak

(If you don't know how to add new library to Arduino IDE then follow this tutorial : "Adding External Library in Arduino")

2. Now create a new sketch and copy and paste the following code:

 

3. Replace the following things with your own thingspeak credentials:
1. Your wifi username and password
2. Your "Thingspeak Write API Key"

Creating-Thingspeak-channel-for-storing-GPS-data-received-from-ESP12E-NodeMCU-Module (7)

Creating-Thingspeak-channel-for-storing-GPS-data-received-from-ESP12E-NodeMCU-Module (7)

4. Save the program and flash ESP12E NodeMCU Module with this program.

Now, wait till your Neo 6M GPS module's led has started blinking. It might take around 2-10 minutes but it will start blinking. Have patience. And then go check your thingspeak channel. If you have done everything right, then ESP12E NodeMCU will start updating the channel with a delay of 15 seconds. And you will get something like show in the below image:
(Hiding my data because I don't want anyone stalking around 😀 )

 

Creating-Thingspeak-channel-for-storing-GPS-data-received-from-ESP12E-NodeMCU-Module (6)

Creating-Thingspeak-channel-for-storing-GPS-data-received-from-ESP12E-NodeMCU-Module (6)

Hope you enjoyed the tutorial, In the next step, we will parse this thingspeak data and show it in a Google map with marker. Click on the below next chapter to go ahead.

Please login to get access to the quiz
Creating Thingspeak channel for storing GPS data received from ESP12E NodeMCU Module (Prev Lesson)
(Next Lesson) Showing Thingspeak GPS data in Google Maps using Javascript and HTML
Back to Read GPS data from thingspeak and show it in the Google map using ESP12e Nodemcu and GPS Neo 6M Module

Comments ( 20 )

  • Freddie Snijman

    Thank you so much, excellent! Working just fine.

    • I am glad that it worked for you. Please share this website with your friends. 🙂

  • Chalamba

    Can we use arduino and esp8266 instead of ESP12E NodeMCU

  • Sravya

    i have a dobt i love this project but i want to extended it more bcuz i want to do as my final year project can u suggest any possible way

    • I am glad that you liked project. Yes, you can make a GPS tracker and accident detection system. You can use accelerometer along with GPS. Whenever there is an accident you can send sms to emergency number using “Twilio” for sms.

  • Sir can you please upload the code for sending GPS coordinates using esp8266 to ubidots (cloud)

  • Vince

    vivek,

    thanks for the project. the first iot gps tracking system that ive ever gotten to work! i even insrted an extra line into your code so that it would allow me to access the internet via an iphone hotspot:

    between

    “Serial.begin(115200);”

    and

    “ss.begin(GPSBaud);”

    insert this:

    “WiFi.mode(WIFI_STA);”

    anyway, i tried to register to your site, but i never received the verification email (checked my spam, junk, etc. and its not there either). thanks again for the awesome project.

    vince

    • Thanks Vince, I am glad that you liked it. You can register using your google + account.

  • Yogesh nikam

    Hello, this code worked for me for my college project but when i combine this code with my other sensor codes then it wont work i trying to combine it with Pulse sensor amped and DHT 11 temperature sensor both the sensor codes are working properely but GPS isnt working on COM port its showing 0 0 0 0 0 ANd invalid location date and time. Also with the google maps program the zooming function wont work and whenever it works it doesnt show thwe imagery when focused on a proper location

  • Kalyan

    Can we do it using esp8266 wifi module and Arduino Uno?

  • Darwish Emre

    Hello sir, why i cant compile that code.

    Error compiling for board for NodeMcu 1.0 (ESP 12E-Module)
    #include “ThingSpeak.h”

    compilation terminated.
    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

    Please help.

    • It seems your library has not be imported properly.

  • Gye beak jeon

    Thank you for your project. But I want the esp8266.h file. If you see this comment, please send esp8266.h file to rydus0604@naver.com.

  • Mathivanan

    i am not getting proper time . can you give a solution

    • What time are you getting? Can you paste it here?

Post a Reply