View location data sent by NEO-M6 GPS using ESP32 board

What is GPS ?

GPS stands for Global Positioning System. It is a satellite-based navigation system that allows users to determine their precise location and track their movement anywhere on the Earth’s surface. The GPS system is operated by the United States government and consists of a network of satellites, ground control stations, and receivers.

The GPS system works by sending signals from satellites in orbit around the Earth to GPS receivers on the ground. The GPS receiver then calculates its location by measuring the time it takes for the signal to reach it from multiple satellites. By combining the location information from multiple satellites, the GPS receiver can determine its latitude, longitude, and altitude.

GPS technology is used in a wide range of applications, including navigation for ships, planes, and automobiles, location tracking for personal devices, mapping and surveying, and scientific research. It has become an essential tool for many industries and is relied upon by millions of people around the world.

The ESP32 is a powerful microcontroller that has built-in Wi-Fi and Bluetooth capabilities. It can be used in a wide range of applications, from home automation to robotics. When it comes to GPS, the ESP32 can be used to receive data from a GPS module and process it.

To use GPS with the ESP32, you will need to connect a GPS module to the microcontroller. There are many different GPS modules available on the market, but some of the popular ones are the Ublox NEO-6M and NEO-7M. These modules use the NMEA protocol to communicate with the microcontroller.

Purpose of  this tutorial

The purpose of this tutorial is using the SSD1306 Display, NEO-M6 GPS, and ESP32 to create a wide range of electronic projects, such as GPS trackers, weather stations, and smart home automation systems. The ESP32 can be used to read data from the NEO-M6 GPS and display it on the SSD1306 Display, creating a simple GPS display.

The NEO-M6 is a standalone GPS module made by u-blox. It is capable of receiving GPS, GLONASS, Galileo, and BeiDou signals to determine real-time position. This module can be used with different microcontrollers, including the ESP32 board. The ESP32 board is a low-cost development platform based on the ESP32 microcontroller from Espressif. It has several communication interfaces, including Wi-Fi, Bluetooth, and SPI, which allow you to connect different sensors and external modules. The ESP32 board can be programmed using the Arduino programming language or using the Espressif IDE. To use the NEO-M6 GPS module with the ESP32 board, you can connect the GPS module to the ESP32 board via a serial connection (UART). To do this, you need to connect the TX and RX pins of the GPS module to the RX and TX pins of the ESP32 board, respectively. You can also use a software library to communicate with the GPS module via the UART interface. Once you have established communication between the GPS module and the ESP32 board, you can use the position data provided by the GPS module for different applications, such as real-time location tracking, navigation, and geolocation.

The NEO-M6 GPS module provides accurate localization data in the form of latitude, longitude, altitude, and time information. This data is obtained by processing signals from GPS, GLONASS, and Galileo satellite systems.

  1. The latitude and longitude information provided by the NEO-M6 GPS module indicates the geographic coordinates of the receiver’s position on the Earth’s surface. The latitude is measured in degrees north or south of the equator, while the longitude is measured in degrees east or west of the prime meridian.
  2. The altitude information provided by the NEO-M6 GPS module indicates the vertical distance of the receiver’s position above or below the Earth’s mean sea level. This information is useful in applications that require precise height measurements, such as surveying or aerial photography.
  3. The time information provided by the NEO-M6 GPS module is synchronized with the atomic clocks on board the GPS, GLONASS, and Galileo satellites, providing accurate and synchronized timing information.

Overall, the localization data provided by the NEO-M6 GPS module is essential for various applications that require accurate positioning and timing information. This data can be used in navigation systems, mapping applications, surveying, geocaching, and many other applications.


To connect a NEO-6M GPS module to an ESP32 microcontroller, you will need to follow these steps:

  1. Obtain a NEO-6M GPS module and an ESP32 microcontroller board.
  2. Connect the NEO-6M GPS module to the ESP32 using the following connections:
    • Connect the VCC pin on the NEO-6M module to the 3.3V pin on the ESP32.
    • Connect the GND pin on the NEO-6M module to the GND pin on the ESP32.
    • Connect the TX pin on the NEO-6M module to the RX pin on the ESP32.
    • Connect the RX pin on the NEO-6M module to the TX pin on the ESP32.

To connect a SSD1306 Display to an ESP32 microcontroller, you will need to follow these steps:

  • Connect the VCC pin on the SSD1306 Display to the 3.3V pin on the ESP32.
  • Connect the GND pin on the SSD1306 Display to the GND pin on the ESP32.
  • Connect the SCL pin on the SSD1306 Display to the 22 pin on the ESP32.
  • Connect the SDA pin on the SSD1306 Display to the 21 pin on the ESP32.


The necessary components


ESP32 is a system-on-chip (SoC) microcontroller designed by Espressif Systems. It is a successor to the ESP8266 chip, and it comes with many improvements over its predecessor, such as dual-core processors, increased memory, and support for Bluetooth and Wi-Fi.

The ESP32 has a powerful CPU with two Tensilica LX6 cores, clocked at up to 240 MHz. It also has a large amount of on-board memory, including up to 520 KB of SRAM and 4 MB of flash memory. The chip supports Bluetooth Low Energy (BLE), Wi-Fi, and a wide range of other communication protocols, making it a popular choice for IoT projects.

The ESP32 can be programmed using the Arduino IDE, as well as other programming languages such as Python and MicroPython. It also has a built-in support for various sensors and peripherals, such as touch sensors, temperature sensors, and analog-to-digital converters (ADCs), making it a versatile platform for building IoT devices.

Overall, the ESP32 is a powerful microcontroller with a wide range of features and capabilities, making it a popular choice for IoT projects, robotics, and other embedded systems applications.


NEO-M6 is a GPS (Global Positioning System) module manufactured by u-blox. It is a compact and low-power consumption GPS receiver that is widely used in various applications, such as drones, robotics, vehicles, and personal navigation devices.

The NEO-M6 module uses u-blox’s latest generation of GPS technology to provide accurate positioning information. It supports GPS, GLONASS, and Galileo satellite systems and can receive signals from up to 72 satellites simultaneously. This enables the module to provide accurate position, velocity, and timing information even in challenging environments, such as urban canyons or deep indoor locations.

The NEO-M6 GPS module is easy to use and can be integrated into a variety of systems with its compact form factor and simple serial communication protocol. It also supports a range of positioning modes, including standalone, assisted, and differential GPS, which can further improve its accuracy.

Overall, the NEO-M6 GPS module is a reliable and versatile solution for applications that require accurate positioning information. It can be used as a standalone module or integrated into a larger system to provide precise location data.

SSD1306 Display

The SSD1306 is a popular OLED (Organic Light Emitting Diode) display controller produced by Solomon Systech. The controller is commonly used in small display modules for embedded systems and IoT devices due to its low power consumption, high contrast ratio, and easy interfacing.

The SSD1306 controller supports various display resolutions, including 128×64, 128×32, and 96×16, and it can display up to 128 characters per line. It also features built-in functions for controlling the display’s brightness, contrast, and scrolling, making it easy to customize the display’s appearance.

The SSD1306 controller communicates with a microcontroller or other host device using the I2C or SPI serial communication protocol. It can operate at a low voltage of 3.3V, making it suitable for battery-powered applications.

Overall, the SSD1306 OLED display controller is a reliable and easy-to-use solution for adding small, high-quality displays to embedded systems and IoT devices. Its low power consumption, high contrast ratio, and simple interfacing make it a popular choice for various applications, including wearable devices, sensors, and control panels.

Connecting wires

Connecting wires are electrical wires used to connect various electrical components in a circuit. They are an essential component of any electrical or electronic system, as they are used to transfer electrical energy and signals between the different parts of the circuit.

Test plate

A test plate is a type of device used in robotics to test the functionality and performance of various components or systems. It is typically a physical platform or structure that is designed to hold and support various test items or devices, such as sensors, actuators, motors, or other types of mechanical or electrical components. Test plates can be used to simulate different environments or conditions, such as temperature, humidity, vibration, or other factors, in order to evaluate the performance of the components or systems being tested. They can also be used to perform a variety of diagnostic or diagnostic tests, such as stress testing, endurance testing, or other types of evaluations.

Micropython program

The ESP32 microcontroller is capable of running MicroPython, a version of the Python programming language optimized for embedded systems. Running MicroPython on the ESP32 enables developers to write code in Python and execute it directly on the ESP32, allowing for faster prototyping and easier development.

MicroPython for the ESP32 provides a high-level programming interface that abstracts away many of the low-level details of the microcontroller’s hardware. This makes it easier for developers to write and debug code for the ESP32. It also provides built-in support for the ESP32‘s various peripherals, such as GPIO, SPI, I2C, UART, and PWM, making it easy to interact with sensors, actuators, and other hardware components.

Here is the Micropython program which allows you to read the location data sent by the NEO-M6 GPS and display them on the SSD1306 display.

Location data types are:

  • Latitude and Longitude: This data indicates the exact geographic position of the device using latitude and longitude coordinates.

  • Altitude: This data indicates the altitude of the device in relation to sea level.

  • Time: The NEO-M6 GPS can provide the exact time from the received GPS signals, which can be useful for synchronizing the clocks of different devices.

  • Number of Satellites: The GPS receiver can also provide information on the number of GPS satellites it is connected to, which can help gauge the accuracy of the location data provided.

You need to import these two libraries: ssd1306 and micropyGPS


0 commentaire

Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top