NodeMCU ESP8266 12e With GPS & OLED Display

80K10160

Intro: NodeMCU ESP8266 12e With GPS & OLED Display

In this Instructable I will describe how to hookup a Ublox 6m GPS module and an OLED display to the NodeMCU or ESP8266-12e wifi module to display your current GPS location and other info.

Check out my Youtube Video describing this. Youtube Video

STEP 1: Ingredients - What You Will Need


In this Instructable I will describe how to hookup a Ublox 6m GPS module and an OLED display to the NodeMCU or ESP8266-12e wifi module to display your current GPS location and other info. With a little extra programming you could use it to broadcast your GPS location to the internet using the wifi on the esp8266, and upload it to ioadafruit or another MQTT cloud server. Maybe attach it to your dog a see where and how much he roams around the yard!

Step One: The ingredients

1. You'll need an ESP8266 - e12 wifi module

2. An OLED display ($5- $10 from Ebay)

3. A Ublox 6m GPS receiver or similiar model

4. A breadboard and some jumper wires

STEP 2: Hooking It Up

1. First place the ESP8266 on a breadboard

2. Connect a jumper wire from the Ground and Output VCC of the ESP to the power and ground rails of the breadboard.

3. Connect the Ground and VCC of the GPS and the Oled Display to the power rails of the breadboard. Make sure Ground is to (Ground -) and VCC is to the (Red +)

4. Connect the SCL Pin of the Oled display to the ESP D1 pin (the Yellow wire in the picture), and connect the SDA Pin of the Oled display to D2 pin (the Blue wire in the picture) These are your I2C communication connections.

5. Connect the TX pin of the GPS to the D6 pin of the ESP (the Blue wire), and connect the RX pin of the GPS to the D7 pin of the ESP (the white wire) These are your Serial communication pins. You could choose just about any data pins you like, but you will also have to make the necessary changes in the code.

Here is a link to a pinout diagram of the ESP-12e Board to assist you.

Acrobotic Pinout

STEP 3: Upload the Code

First, I assume you have the Arduino IDE already installed (preferably 1.6.4 or later) and that you have installed all the necessary libraries such as: TinyGPS plus, Software Serial, and the Adafruit OLED display library. You can get these from Github.

If not, install the latest version of the Arduino IDE and the libraries first.

I also assume you have installed all the necessary drivers for your computer to recognize the ESP8266, if not Adafruit has an excellent tutorial here. Adafruit ESP8266 Tutorial This is crucial if this is your first time using the ESP8266

Next, go to github and download the code and run it in the Arduino IDE.

Enter your latitude and longitude into the area of code "Home_LAT =" and "Home_LNG=" below

Compile it and upload to your NodeMcu esp-12e, In the Arduino IDE be sure to select your correct board (ESP-12E Module in my case) and the Memory size - 4M(3M SPIFFS)

Go for a walk or drive and watch your GPS position update, remember to keep your eyes on the road.

38 Comments

nice project thanks, its working.but the person who try and didnt work
1. most of the FAKE NODEMCU does not gives 3.3v = they nearly 3.2 volt thats why neo6m does not works.
2. cut the neo6m antenna onboard golden adaptor and the one with cable golden soket and solder it directly and you will see how powerfull it is
3. flash nodemcu manual = nodemcu build.com
4. have fun guys.
Hello, Can somebody help me to connect it to an arduino nano?
Thanks and regards all
Can you please provide circuit diagram or proteus simulation file?
After a lot of fiddling i got it to work, but i only get GPS data with
the RX pin disconnected. As soon as i connect it i stop getting data.
Does anybody have a clue on what might be going on here?
Dude, You forgot to provide the github URL.
Hi sir!

Is there any way to add an SD card to log data? Thanks
hi, ı want to made with gps coordinates and speedometer . this project similar, but only difference ı use 20x4 lcd screen. I need code .So can you help to me ?
Hi, how can I set the correct time? It gives me one hour less
Hey, displayed time is GMT. (In my case three hours less.)
Add your local time zone for correct time.
Hi, thanks for answering. In which line of the code should I change the time, in my case it is Spain. Thank you
Please find the matching lines of code and replace with the following:

if((gps.time.hour()+1)%24){display.print("0");}
display.print((gps.time.hour()+3)%24); // GPS time UTC
display.print(":");
if(gps.time.minute()<10){display.print("0");}
display.print(gps.time.minute()); // Minutes
display.print(":");
if(gps.time.second()<10){display.print("0");}
display.println(gps.time.second()); // Seconds

This will also turn 5:8:12 to 05:08:12
Sorry to bother you but the code does not have those lines.

#include // Tiny GPS Plus Library
#include // Software Serial Library so we can use other Pins for communication with the GPS module
#include // Adafruit oled library for display
Adafruit_ssd1306syp display(11,10); // OLED display (SDA to Pin 11), (SCL to Pin 10)

static const int RXPin = 12, TXPin = 13; // Ublox 6m GPS module to pins 12 and 13
static const uint32_t GPSBaud = 9600; // Ublox GPS default Baud Rate is 9600
const double Home_LAT = 39.44722; // Your Home Latitude
const double Home_LNG = -0.39192; // Your Home Longitude
TinyGPSPlus gps; // Create an Instance of the TinyGPS++ object called gps
SoftwareSerial ss(RXPin, TXPin); // The serial connection to the GPS device
void setup()
{
display.initialize(); // Initialize OLED display
display.clear(); // Clear OLED display
display.setTextSize(1); // Set OLED text size to small
display.setTextColor(WHITE); // Set OLED color to White
display.setCursor(35,20); // Set cursor to 0,0
display.println("GPS System");
display.setCursor(45,30);
display.println("VICTOR");
//display.println(TinyGPSPlus::libraryVersion());
display.update(); // Update display
delay(3000); // Pause 1.5 seconds
ss.begin(GPSBaud); // Set Software Serial Comm Speed to 9600
}
void loop()
{
display.clear();
display.setCursor(0,0);
display.print("Latitud : ");
display.println(gps.location.lat(), 5);
display.print("Longitud : ");
display.println(gps.location.lng(), 5);
display.print("Satelites : ");
display.println(gps.satellites.value());
display.print("ALtura : ");
display.print(gps.altitude.meters());
display.println("m");
display.print("Time UTC+1: ");
display.print(gps.time.hour()); // GPS time UTC
display.print(":");
display.print(gps.time.minute()); // Minutes
display.print(":");
display.println(gps.time.second()); // Seconds
display.print("Heading : ");
display.println(gps.course.deg());
display.print("Velocidad : ");
display.println(gps.speed.kmph());
unsigned long Distance_To_Home = (unsigned long)TinyGPSPlus::distanceBetween(gps.location.lat(),gps.location.lng(),Home_LAT, Home_LNG);
display.print("Km to Home: "); // Have TinyGPS Calculate distance to home and display it
display.print(Distance_To_Home);
display.update(); // Update display
delay(200);
smartDelay(500); // Run Procedure smartDelay
if (millis() > 5000 && gps.charsProcessed() < 10)
display.println(F("No GPS data received: check wiring"));
}
static void smartDelay(unsigned long ms) // This custom version of delay() ensures that the gps object is being "fed".
{
unsigned long start = millis();
do
{
while (ss.available())
gps.encode(ss.read());
} while (millis() - start < ms);
}
Great project, thanks. Note that, "KM to Home" is actually calculated and displayed in meters not KMs.
Where exactly did you buy your OLED display. Mine is quite dim.
I used your code with my nodemcu and neo-m8n. It's can compile and upload but nothing happen.
The same thing happens to me, everything works even when the gps flashes, but no value works on the display. I have tried changing digital pins even with an arduino one in its corresponding TX and RX

Same, everything works apart from the gps

Tthere is a problem in instructions about TX and RX connections, TX in GPS must be conected to D7, and RX in GPS must be conected to D6.

More Comments