NodeMCU ESP8266 12e With GPS & OLED Display
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.
STEP 3: Upload the Code
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
cemtanca01 2 years ago
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.
ernestomoralesh 2 years ago
Thanks and regards all
asifulawal2 2 years ago
Phamaral 3 years ago
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?
PriyankC 4 years ago
Mark Conner 4 years ago
code25 4 years ago
Is there any way to add an SD card to log data? Thanks
RüçhanÇataklı 4 years ago
ProfessorHussam 5 years ago
vmed 5 years ago
yigitozen 5 years ago
Add your local time zone for correct time.
vmed 5 years ago
yigitozen 5 years ago
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
vmed 5 years ago
#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);
}
yigitozen 5 years ago
yigitozen 5 years ago
iamchinnapat 7 years ago
vmed 5 years ago
Conor M 6 years ago
Same, everything works apart from the gps
RicardoS216 6 years ago
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.