Arduino GPS Speedometer: NEO-6M, TinyGPS++ and Big OLED Digits
Build an Arduino GPS speedometer with a NEO-6M: speed, heading and satellites via TinyGPS++, big OLED digits, 5 Hz setup, cold start times and ESP32 code.
A GPS speedometer is one of the coolest measuring projects you can build with an Arduino: no magnet on the wheel, no sensor on a cable, just the signals from satellites in the sky telling you how fast your bike, skateboard or car is moving. In this guide we'll build one with an Arduino Uno or Nano, a NEO-6M GPS module and a 0.96 inch OLED screen that shows your speed in big digits, prints the heading and satellite count and counts the distance you travel.
First you'll see how GPS measures speed and why it's often more accurate than a wheel sensor. Then we'll cover the short UBX commands that raise the module's default 1 Hz update rate to 5 Hz, a 1/5/10 Hz comparison and the cold start times. After walking through every line of the code, you'll find an ESP32 version with a faster serial port and a trip counter that survives power-off, tips for mounting on a bike or in a car, and the most common mistakes.

How does a GPS speedometer work?
Many people think GPS finds your speed by dividing the distance between two positions by the time. Modules like the NEO-6M actually calculate speed directly from the Doppler shift: as you move, the frequency of each satellite's signal changes very slightly, and the receiver derives a three-dimensional velocity vector from that change. This method is almost immune to position error, so even when your position wanders by a few metres, speed can be measured to 0.1 m/s (about 0.4 km/h). The module sends the result as NMEA text lines: the $GPRMC line holds speed (in knots) and the heading angle, while the $GPGGA line holds the satellite count and HDOP. The TinyGPS++ library parses these lines and gives you the speed in km/h or mph.
| Feature | NEO-6M value | What it means for a speedometer |
|---|---|---|
| Speed accuracy | 0.1 m/s | About ±0.4 km/h, more honest than a car's dial |
| Heading accuracy | 0.5° | Only meaningful while moving; random when standing still |
| Position accuracy | 2.5 m (CEP) | Causes small errors in the trip counter |
| Maximum update rate | 5 Hz | Five speed values per second |
| First fix (cold start) | 27 s (datasheet) | 1–5 minutes in practice |
| Operating limits | 500 m/s, 50,000 m altitude | No limit for land vehicles |
| Supply (GY-NEO6MV2 board) | 3.3–5 V, about 45 mA | Can run from the Arduino's 5V pin |
Parts list
- Arduino Uno, or an Arduino Nano for a compact build (both use the same pins)
- NEO-6M GPS module (usually sold as GY-NEO6MV2, with a ceramic antenna and backup battery on board)
- 0.96 inch 128x64 SSD1306 I2C OLED screen
- 1 kΩ and 2 kΩ resistors (a voltage divider that brings the Arduino's TX line down to the GPS's 3.3 V input)
- Jumper wires and a breadboard; perfboard for a permanent version
- Power: a USB power bank, or an 18650 cell with a TP4056 charger module and a 5 V boost converter
Wiring table: Arduino Uno, Nano and ESP32
| Module pin | Arduino Uno / Nano | ESP32 | Note |
|---|---|---|---|
| GPS VCC | 5V | 3V3 | The GY-NEO6MV2 board has a 3.3 V regulator |
| GPS GND | GND | GND | Common ground |
| GPS TX | D4 (software RX) | GPIO 16 (RX2) | NMEA data from the module to the board |
| GPS RX | D3, through a 1 kΩ / 2 kΩ divider | GPIO 17 (TX2), direct | UBX configuration commands travel on this line |
| OLED VCC | 5V | 3V3 | Most modules accept 3.3–5 V |
| OLED GND | GND | GND | Common ground |
| OLED SDA | A4 | GPIO 21 | I2C data |
| OLED SCL | A5 | GPIO 22 | I2C clock |
Update rate: 1 Hz, 5 Hz and 10 Hz
Out of the box, the NEO-6M reports position and speed once per second (1 Hz). That's fine for walking, but on a bike the reading lags behind when you accelerate or brake. The module can go up to 5 Hz. The thing to watch is serial port capacity: 9600 baud carries about 960 bytes per second. With factory settings the module sends GGA, GLL, GSA, three GSV, RMC and VTG lines every second, which adds up to 450–500 bytes. Sending all of them five times a second would exceed 2,400 bytes and choke the line. The fix is to keep only the two lines a speedometer really needs (RMC and GGA, about 145 bytes together) and switch off the rest: 5 × 145 = 725 bytes, or 75 percent of the line. A project that wants 10 Hz needs both a newer module and 38400 baud.
| Update rate | Interval | Distance between readings at 50 km/h | NEO-6M | Baud needed | Good for |
|---|---|---|---|---|---|
| 1 Hz | 1000 ms | 13.9 m | Yes (factory default) | 9600, all sentences on | Walking, running, boating |
| 5 Hz | 200 ms | 2.8 m | Yes (maximum) | 9600, RMC + GGA only | Bike, scooter, car |
| 10 Hz | 100 ms | 1.4 m | No (NEO-M8N and newer) | 38400 or higher | RC car, karting, drone |
Cold start: why does the GPS take so long to get a first fix?
Before it can measure speed, the receiver must download each satellite's precise orbit data (ephemeris) one by one. This data is broadcast at only 50 bits per second and a full cycle takes 30 seconds; if trees or buildings interrupt the signal, the download starts over. That's why waiting is normal the first time you power the module or after it has been off for a long time. The small backup battery on the GY-NEO6MV2 board keeps the clock and the last orbit data while the module is off, so if you switch it back on within a few hours, the fix arrives in seconds. The LED on the module starts blinking once per second when it has a fix.
| Start type | When does it happen? | Datasheet | In practice (ceramic antenna, open sky) |
|---|---|---|---|
| Cold | First use, or backup battery flat | 27 s | 1–5 minutes, over 10 minutes in poor conditions |
| Warm | Time known but orbit data stale (off for more than a few hours) | 27 s | 30–60 s |
| Hot | Switched off recently, backup battery charged | 1 s | 1–5 s |
Step by step: a GPS speedometer with Arduino
- Open the Library Manager in the Arduino IDE and install TinyGPSPlus (Mikal Hart) and U8g2 (olikraus).
- First connect only the GPS and use the raw data sketch from the NEO-6M guide to check that NMEA lines arrive.
- Connect the OLED to A4 and A5, and the GPS RX line to D3 through the voltage divider; check the wiring against the table once more.
- Upload the code below. The screen first shows the satellite count and 'Uydu araniyor' (searching for satellites).
- Take the circuit outdoors, point the antenna at the sky and wait until the LED on the module blinks.
- Start walking: above 3 km/h the big digits change, a heading letter (N, NE, E...) appears and the trip counter increases.
1#include <TinyGPSPlus.h>
2#include <SoftwareSerial.h>
3#include <U8g2lib.h>
4#include <Wire.h>
5
6const int GPS_RX_PIN = 4; // GPS TX → D4
7const int GPS_TX_PIN = 3; // GPS RX ← D3 (1k/2k bölücü üzerinden / through a 1k/2k divider)
8const float STOP_KMH = 3.0; // bunun altı "duruyor" sayılır / below this counts as standing still
9
10TinyGPSPlus gps;
11SoftwareSerial gpsSerial(GPS_RX_PIN, GPS_TX_PIN);
12// Sayfa modu: 1 KB yerine 128 bayt RAM / page mode: 128 bytes of RAM instead of 1 KB (SDA A4, SCL A5)
13U8G2_SSD1306_128X64_NONAME_1_HW_I2C oled(U8G2_R0, U8X8_PIN_NONE);
14
15float shownSpeed = 0; // yumuşatılmış hız / smoothed speed
16float maxSpeed = 0;
17float tripMeters = 0;
18double lastLat = 0, lastLng = 0;
19bool haveLast = false;
20unsigned long lastDraw = 0;
21
22// UBX paketi gönder, sağlama toplamını kendisi hesaplar / send a UBX packet, checksum computed here
23void sendUBX(uint8_t cls, uint8_t id, const uint8_t *payload, uint8_t len) {
24 uint8_t head[4] = {cls, id, len, 0};
25 uint8_t ckA = 0, ckB = 0;
26 gpsSerial.write(0xB5);
27 gpsSerial.write(0x62);
28 for (uint8_t i = 0; i < 4; i++) { gpsSerial.write(head[i]); ckA += head[i]; ckB += ckA; }
29 for (uint8_t i = 0; i < len; i++) { gpsSerial.write(payload[i]); ckA += payload[i]; ckB += ckA; }
30 gpsSerial.write(ckA);
31 gpsSerial.write(ckB);
32 delay(50);
33}
34
35// Yalnız GGA ve RMC kalsın, 9600 baud 5 Hz'i taşısın / keep only GGA and RMC so 9600 baud can carry 5 Hz
36void configureGps(uint16_t periodMs) {
37 const uint8_t offIds[] = {0x01, 0x02, 0x03, 0x05}; // GLL, GSA, GSV, VTG
38 for (uint8_t i = 0; i < sizeof(offIds); i++) {
39 uint8_t msg[3] = {0xF0, offIds[i], 0}; // NMEA sınıfı, kimlik, oran 0 / NMEA class, id, rate 0
40 sendUBX(0x06, 0x01, msg, 3); // UBX-CFG-MSG
41 }
42 uint8_t rate[6] = {(uint8_t)(periodMs & 0xFF), (uint8_t)(periodMs >> 8), 1, 0, 1, 0};
43 sendUBX(0x06, 0x08, rate, 6); // UBX-CFG-RATE: 200 ms = 5 Hz
44}
45
46void drawScreen() {
47 char big[4], line[24], trip[8];
48 snprintf(big, sizeof(big), "%d", (int)(shownSpeed + 0.5));
49 dtostrf(tripMeters / 1000.0, 5, 2, trip);
50 oled.firstPage();
51 do {
52 oled.setFont(u8g2_font_6x10_tr);
53 snprintf(line, sizeof(line), "Sat:%d", (int)gps.satellites.value());
54 oled.drawStr(0, 9, line);
55 if (gps.course.isValid() && shownSpeed > 0) {
56 oled.drawStr(50, 9, TinyGPSPlus::cardinal(gps.course.deg())); // rota: N, NE, E... / heading
57 }
58 snprintf(line, sizeof(line), "max %d", (int)maxSpeed);
59 oled.drawStr(86, 9, line);
60 if (gps.location.isValid()) {
61 oled.setFont(u8g2_font_logisoso32_tn); // 32 piksel rakam / 32 pixel digits
62 oled.drawStr(90 - oled.getStrWidth(big), 48, big); // sağa yasla / right-align
63 oled.setFont(u8g2_font_6x10_tr);
64 oled.drawStr(96, 48, "km/h");
65 } else {
66 oled.drawStr(0, 34, "Uydu araniyor...");
67 }
68 snprintf(line, sizeof(line), "Yol/Trip:%s km", trip);
69 oled.drawStr(0, 63, line);
70 } while (oled.nextPage());
71}
72
73void setup() {
74 gpsSerial.begin(9600); // NEO-6M varsayılanı / NEO-6M default
75 oled.begin();
76 configureGps(200); // 5 Hz
77}
78
79void loop() {
80 while (gpsSerial.available()) gps.encode(gpsSerial.read());
81
82 if (gps.speed.isUpdated()) {
83 float kmh = gps.speed.kmph();
84 if (kmh < STOP_KMH) kmh = 0; // duruşta titreyen hızı sıfırla / kill jitter at standstill
85 shownSpeed = 0.7 * shownSpeed + 0.3 * kmh; // üstel ortalama / exponential average
86 if (kmh > maxSpeed && gps.satellites.value() >= 5) maxSpeed = kmh;
87 }
88
89 if (gps.location.isUpdated() && shownSpeed > STOP_KMH) {
90 double lat = gps.location.lat(), lng = gps.location.lng();
91 if (haveLast) tripMeters += TinyGPSPlus::distanceBetween(lastLat, lastLng, lat, lng);
92 lastLat = lat; lastLng = lng; haveLast = true;
93 }
94
95 if (millis() - lastDraw >= 200) { // ekran da 5 Hz / display also at 5 Hz
96 lastDraw = millis();
97 drawScreen();
98 }
99}
100How does the code work?
| Part | What it does |
|---|---|
| sendUBX() | Sends the B5 62 header, class, ID, length and payload, and computes the Fletcher checksum (ckA, ckB) |
| configureGps(200) | Switches off GLL, GSA, GSV and VTG and sets the measurement interval to 200 ms (5 Hz) |
| gps.encode() | Feeds every incoming byte to the TinyGPS++ parser; with no delay() in the loop, no bytes are lost |
| STOP_KMH | Treats speeds below 3 km/h as zero, hiding the 1–2 km/h jitter of a stationary GPS |
| shownSpeed | Exponential average: 30 percent new value, 70 percent old; the digits don't jump around |
| maxSpeed | Records top speed only with at least 5 satellites, filtering out spikes caused by reflections |
| distanceBetween() | Returns the distance between two positions in metres; only added up while moving |
| drawScreen() | Satellites, heading and top speed at the top, 32 pixel speed in the middle, trip counter at the bottom |
It matters that the trip counter only increases while moving. A stationary GPS's position keeps wandering within a few metres; if you added up those small jumps, the counter would grow by dozens of metres a minute even while you wait at a red light. The heading is only shown when speed is above zero for the same reason: the heading angle is meaningless when the module is standing still. TinyGPSPlus::cardinal() turns the angle into one of 16 compass abbreviations (N, NNE, NE...). If you prefer miles per hour, simply replace gps.speed.kmph() with gps.speed.mph().
Big digits on the OLED and the RAM problem
The full frame buffer of a 128x64 OLED is 1,024 bytes. The Adafruit SSD1306 library keeps this buffer in RAM, using half of the Uno's 2,048 bytes on its own. Add the GPS parser, the software serial port and the I2C buffers, and there's almost nothing left for the stack, so the board locks up or resets at random. That's why the code uses the page mode of the U8g2 library (the constructor with _1_ in its name): the screen is drawn in eight strips and only needs a 128 byte buffer, leaving about 900 bytes of free RAM after compiling. For the speed we chose the u8g2_font_logisoso32_tn font: 32 pixels tall, digits only and easy to read from a distance. If you have the 1.3 inch SH1106 version of the screen, just change the constructor to U8G2_SH1106_128X64_NONAME_1_HW_I2C. For OLED basics, see the SSD1306 guide.
ESP32 version: 38400 baud and a persistent trip counter
The ESP32's hardware UART and 320 KB of RAM give the project plenty of room. This version first raises the module's baud rate to 38400 with the UBX-CFG-PRT command, then switches off the unneeded sentences and sets the measurement interval. With a NEO-6M, leave PERIOD_MS at 200; with a newer module such as the NEO-M8N you can set it to 100 for 10 Hz. The trip and top speed are saved to flash with Preferences once a minute, so they survive a power cut. Holding the board's BOOT button for two seconds resets the counters. Since the NEO-6M and the ESP32 both use 3.3 V logic, no divider is needed.
1#include <TinyGPSPlus.h>
2#include <U8g2lib.h>
3#include <Wire.h>
4#include <Preferences.h>
5
6#define GPS_RX 16 // ESP32 RX2 ← GPS TX
7#define GPS_TX 17 // ESP32 TX2 → GPS RX (ikisi de 3,3 V, bölücü gerekmez / both 3.3 V, no divider)
8#define RESET_BTN 0 // BOOT düğmesi: 2 sn bas, yolu sıfırla / BOOT button: hold 2 s to reset trip
9const uint16_t PERIOD_MS = 200; // NEO-6M: 200 ms (5 Hz). NEO-M8N: 100 ms (10 Hz)
10const float STOP_KMH = 3.0;
11
12TinyGPSPlus gps;
13U8G2_SSD1306_128X64_NONAME_F_HW_I2C oled(U8G2_R0, U8X8_PIN_NONE); // SDA 21, SCL 22
14Preferences prefs;
15
16float shownSpeed = 0, maxSpeed = 0;
17double tripMeters = 0, lastLat = 0, lastLng = 0;
18bool haveLast = false;
19unsigned long lastDraw = 0, lastSave = 0, btnDown = 0;
20
21void sendUBX(uint8_t cls, uint8_t id, const uint8_t *payload, uint8_t len) {
22 uint8_t head[4] = {cls, id, len, 0};
23 uint8_t ckA = 0, ckB = 0;
24 Serial2.write(0xB5);
25 Serial2.write(0x62);
26 for (uint8_t i = 0; i < 4; i++) { Serial2.write(head[i]); ckA += head[i]; ckB += ckA; }
27 for (uint8_t i = 0; i < len; i++) { Serial2.write(payload[i]); ckA += payload[i]; ckB += ckA; }
28 Serial2.write(ckA);
29 Serial2.write(ckB);
30 Serial2.flush();
31 delay(50);
32}
33
34void configureGps() {
35 // UBX-CFG-PRT: UART1 38400 baud, 8N1, giriş UBX+NMEA, çıkış NMEA / in UBX+NMEA, out NMEA
36 const uint8_t prt[20] = {0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00,
37 0x00, 0x96, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00,
38 0x00, 0x00, 0x00, 0x00};
39 Serial2.begin(9600, SERIAL_8N1, GPS_RX, GPS_TX);
40 sendUBX(0x06, 0x00, prt, 20);
41 Serial2.end();
42 Serial2.begin(38400, SERIAL_8N1, GPS_RX, GPS_TX); // artık 38400 / now 38400
43
44 const uint8_t offIds[] = {0x01, 0x02, 0x03, 0x05}; // GLL, GSA, GSV, VTG kapat / off
45 for (uint8_t i = 0; i < sizeof(offIds); i++) {
46 uint8_t msg[3] = {0xF0, offIds[i], 0};
47 sendUBX(0x06, 0x01, msg, 3);
48 }
49 uint8_t rate[6] = {(uint8_t)(PERIOD_MS & 0xFF), (uint8_t)(PERIOD_MS >> 8), 1, 0, 1, 0};
50 sendUBX(0x06, 0x08, rate, 6); // UBX-CFG-RATE
51}
52
53void drawScreen() {
54 char buf[24];
55 oled.clearBuffer();
56 oled.setFont(u8g2_font_6x10_tr);
57 snprintf(buf, sizeof(buf), "Sat:%d HDOP:%.1f", (int)gps.satellites.value(), gps.hdop.hdop());
58 oled.drawStr(0, 9, buf);
59 if (gps.location.isValid()) {
60 snprintf(buf, sizeof(buf), "%d", (int)(shownSpeed + 0.5));
61 oled.setFont(u8g2_font_logisoso32_tn);
62 oled.drawStr(90 - oled.getStrWidth(buf), 48, buf);
63 oled.setFont(u8g2_font_6x10_tr);
64 oled.drawStr(96, 30, "km/h");
65 if (gps.course.isValid() && shownSpeed > 0) {
66 oled.drawStr(96, 48, TinyGPSPlus::cardinal(gps.course.deg()));
67 }
68 } else {
69 oled.drawStr(0, 34, "Uydu araniyor...");
70 }
71 snprintf(buf, sizeof(buf), "%.2f km max %d", tripMeters / 1000.0, (int)maxSpeed);
72 oled.drawStr(0, 63, buf);
73 oled.sendBuffer();
74}
75
76void setup() {
77 Serial.begin(115200);
78 pinMode(RESET_BTN, INPUT_PULLUP);
79 oled.begin();
80 prefs.begin("tacho", false);
81 tripMeters = prefs.getDouble("trip", 0); // kapanınca kaybolmasın / survive power-off
82 maxSpeed = prefs.getFloat("max", 0);
83 configureGps();
84}
85
86void loop() {
87 while (Serial2.available()) gps.encode(Serial2.read());
88
89 if (gps.speed.isUpdated()) {
90 float kmh = gps.speed.kmph();
91 if (kmh < STOP_KMH) kmh = 0;
92 shownSpeed = 0.7 * shownSpeed + 0.3 * kmh;
93 if (kmh > maxSpeed && gps.satellites.value() >= 5) maxSpeed = kmh;
94 }
95 if (gps.location.isUpdated() && shownSpeed > STOP_KMH) {
96 double lat = gps.location.lat(), lng = gps.location.lng();
97 if (haveLast) tripMeters += TinyGPSPlus::distanceBetween(lastLat, lastLng, lat, lng);
98 lastLat = lat; lastLng = lng; haveLast = true;
99 }
100
101 if (digitalRead(RESET_BTN) == LOW) { // uzun basış / long press
102 if (btnDown == 0) btnDown = millis();
103 if (millis() - btnDown > 2000) { tripMeters = 0; maxSpeed = 0; btnDown = 0; }
104 } else {
105 btnDown = 0;
106 }
107
108 if (millis() - lastSave > 60000) { // dakikada bir kaydet, flash yıpranmasın / save once a minute
109 lastSave = millis();
110 prefs.putDouble("trip", tripMeters);
111 prefs.putFloat("max", maxSpeed);
112 }
113 if (millis() - lastDraw >= 100) {
114 lastDraw = millis();
115 drawScreen();
116 }
117}
118In this code the screen refreshes ten times a second; the ESP32 easily handles U8g2's full buffer constructor (_F_). The top line also shows the HDOP value: below 1 is excellent, 1–2 is good, and above 5 means the satellite geometry is poor and the speed may be unreliable. Writing to flash every second would wear out the cells, so the save interval is deliberately 60 seconds; at worst you lose the last minute of distance. To send your position to a phone with the ESP32, you can combine this code with the SMS method from the GPS tracker article.
Mounting on a bike or in a car
- Antenna direction: The flat face of the ceramic antenna must face the sky. On a bike the middle of the handlebar works best; in a car, the top of the dashboard right under the windscreen.
- Enclosure: A plastic box lets the signal through, a metal one blocks it. Seal the lid with silicone against rain, but never put the antenna under metal foil or carbon.
- Heat-reflective windscreens: Some cars have metal-coated glass that weakens the signal. In that case move an external active antenna with a u.FL connector to the dotted black area of the windscreen or onto the roof.
- Vibration: Jumper wires come loose on a bike within a few kilometres. Solder the permanent version on perfboard and fix the board with foam tape.
- Power on a bike: A 2,000 mAh power bank is plenty. The Uno, NEO-6M and OLED draw about 100 mA together, which means more than 15 hours of use. You can work it out for your own battery with the battery life tool.
- Power in a car: Don't connect the 12–14.4 V from the cigarette lighter socket to the Uno's VIN; voltage spikes in a car's electrical system stress the regulator. Use a good USB car charger or an LM2596 buck converter set to 5 V.
- Readability: An OLED is hard to read in direct sunlight. Shade the screen with a small visor, or lower the contrast with oled.setContrast() for night use.
GPS speedometer project ideas
- Bike computer: Show speed, distance, top speed and average speed on one screen and log the ride to an SD card.
- Speed limit warning: Sound a buzzer when you exceed a set value; set a safe limit for a skateboard or e-scooter.
- Lap timer: End the lap when you return to the start point and show the time; ideal for karting or a running track.
- Virtual fence: A system that warns you when you leave a set area is in the GPS geofence guide.
- Remote tracking: Combine the ESP32 version with the SIM800L tracker to send position and speed by SMS.
- Model boat or RC car: Measure top speed with a 10 Hz module and show it on the screen.
Common mistakes and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| Screen stuck on 'Uydu araniyor' | Indoors, antenna upside down or a cold start | Go outside, turn the flat face of the antenna upwards and wait 5–10 minutes |
| Screen completely blank | Wrong I2C address or SDA/SCL swapped | Check A4-SDA and A5-SCL; pick the right constructor for an SH1106 screen |
| Speed changes once a second, no 5 Hz | GPS RX line not connected, commands don't reach the module | Check the wire from D3 through the divider to GPS RX |
| Shows 1–2 km/h while standing still | Natural GPS jitter | That's normal; keep STOP_KMH between 3 and 4 km/h |
| Trip counter rises while waiting | Position drift or a threshold that's too low | Raise STOP_KMH and skip summing while HDOP is above 5 |
| Board resets at random | Out of RAM (full-buffer OLED library) | Use U8g2 page mode and shorten constant strings |
| Garbage characters on the ESP32 | Baud rate mismatch | Power-cycle the module; the code switches from 9600 to 38400 at every boot |
A GPS speedometer is a great project that teaches serial communication, a binary protocol, filtering and screen handling all at once. If you'd like to try more circuits with screens and sensors, the OLED and ESP32 projects in the BlueGrays app give you the circuit diagram and ready-made code for every step, so you can grow this speedometer into your own bike computer.
Frequently asked questions
How accurate is a GPS speedometer?
The NEO-6M measures speed from the Doppler shift and, according to its datasheet, is accurate to 0.1 m/s, or about 0.4 km/h. Outdoors with at least 5–6 satellites, the reading is more realistic than most car speedometers. In tunnels, under dense trees or between tall buildings accuracy drops and sudden spikes can appear.
Why does GPS show a lower speed than my car?
In most countries car speedometers must never show less than the true speed, so manufacturers calibrate them a few km/h high. GPS measures the true ground speed. That's why it's normal for the GPS to show 100 km/h while the car's dial reads 104–106 km/h.
Does the NEO-6M support 10 Hz?
No, the NEO-6M's maximum update rate is 5 Hz. For 10 Hz and above you need a newer u-blox module such as the NEO-M8N. Because more data flows at that rate, the serial port must also run at 38400 baud or higher.
Why can't my GPS module find a position?
The most common reason is testing indoors; GPS signals can't get through concrete and metal. On first power-up a cold start can take 5–10 minutes, so keep the module still outdoors during that time. Also make sure the flat face of the antenna points up and the u.FL connector is firmly seated.
Can I build a GPS speedometer with an Arduino Nano?
Yes. The Nano uses the same ATmega328P as the Uno; pins D3, D4, A4 and A5 work the same way and the code in this guide runs unchanged. Its small size makes it much easier to fit in a box on a bike's handlebar.
How do I read speed in km/h with TinyGPS++?
After passing every incoming byte to the parser with gps.encode(), gps.speed.kmph() returns the speed in km/h. Use gps.speed.mph() for miles per hour and gps.speed.mps() for metres per second. You can check whether a new value has arrived with gps.speed.isUpdated().
Projects to build after reading this
See all projects
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)
The ESP32's Deep Sleep mode shuts down the CPU and most peripherals, cutting current draw to about 10µA, which is vital for battery-powered IoT devices. This project uses three wake-up sources: a timer (15 s), an external pin (EXT0, the button on GPIO 33) and a touch pin (T0/GPIO 4). Counters marked with RTC_DATA_ATTR survive deep sleep.

ESP32 Parking Sensor (HC-SR04 + 5-LED Bar + Buzzer + OLED)
The ESP32 version of a car parking sensor! The HC-SR04 ultrasonic sensor measures the distance to the object in front. As it gets closer, a 5-LED bar fills up (green → yellow → red) and the buzzer beeps faster. Very close (under 10 cm), a continuous alarm sounds and all LEDs light up. The SSD1306 OLED display shows the live distance in cm in large text, plus a status message.

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

Paddle Ball Game - SSD1306
A ball, two paddles and you: you play table tennis, one of the very first video games, on a small OLED screen.

OLED T-Rex Run: Arduino Dinosaur Game
The dinosaur game that pops up when your internet goes down, now on your desk: the dinosaur runs across the small OLED screen, cacti come at you, and you jump with a single button.

One-Way Communication Between 2 Arduinos
You get two Arduinos talking over a single wire: press the button on one and the LED on the other lights up, press it again and it goes off.

Real-Time Clock from the Internet via ESP32 NTP
The ESP32 connects to Wi-Fi and fetches the real time from NTP (Network Time Protocol) servers with millisecond precision. configTzTime() applies the Turkey time zone (TRT, UTC+3) automatically, and in countries with daylight saving time the DST switch is handled by a POSIX TZ string. The time is printed both to the Serial Monitor and to an optional I2C LCD.
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 500+ Arduino, ESP32, ESP8266, Pico, mBot and micro:bit projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

