Overview
In this project, we will make Speedometer using GPS Module, Arduino & OLED Display. A speedometer or a speed meter is a gauge that measures and displays the instantaneous speed of a vehicle. Many speedometers use a rotating flexible cable driven by gearing linked to the vehicle’s transmission. But many modern speedometers are electronic.
In order to build a GPS Speedometer, we need a GPS Receiver. The most popular GPS Receiver is ublox NEO-6M GPS Module. But we will use Quectel L86 GPS Module as it is tiny with a very small antenna. By interfacing L86 GPS Module with Arduino and 0.96″ OLED Display, the speed related parameters can be displayed on OLED Screen.
Bill of Materials
To make Arduino GPS Speedometer, we need following components. You can purchase all the components online from Amazon.
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino Nano Board | 1 | Amazon | AliExpress |
| 2 | L80/L86 GPS | 1 | Amazon | AliExpress |
| 3 | 0.96" I2C OLED Display | 1 | Amazon | AliExpress |
| 4 | Jumper Wires | 20 | Amazon | AliExpress |
| 5 | Breadboard | 1 | Amazon | AliExpress |
How GPS measures Speed?
GPS devices can measure speeds in two ways:
1. Method 1: The first and simpler method is based on how far the receiver has moved since the last measurement. Such speed calculations are not subject to the same sources of error as the vehicle’s speedometer (wheel size, transmission/drive ratios). Instead, the GPS’s positional accuracy, and therefore the accuracy of its calculated speed, is dependent on the satellite signal quality at the time. Speed calculations will be more accurate at higher speeds when the ratio of positional error to positional change is lower. The GPS software may also use a moving average calculation to reduce error. Some GPS devices do not take into account the vertical position of the car so will under-report the speed by the road’s gradient.
2. Method 2: Alternatively, the GPS may take advantage of the Doppler effect to estimate its velocity. In ideal conditions, the accuracy for commercial devices is within 0.2–0.5 km/h, but it may worsen if the signal quality degrades.
Quectel L86/L80 GPS Module
The L86 Module is an ideal solution for wearable fitness devices due to its ultra-compact design and low power demands. Its Low Power feature enables GPS connectivity at around half the power consumption of normal mode while in static receiving mode. Combined with its precision and high sensitivity, this makes the L86 suitable also for a broad range of IoT applications such as portable devices, automotive, personal tracking, security, and industrial PDAs.
The L86 has a patch antenna on top measuring 16.0mm × 16.0mm × 6.45mm, with 66 acquisition channels and 22 tracking channels. It acquires and tracks satellites in the shortest time even at the indoor signal level. The module operates at 2.8V~4.3V with a typical power consumption of 20mA and in Standby mode power consumption is around 1.0mA. To learn more about the L86 GPS module, you can check the L86 Datasheet.
The Quectel L86/L80 GPS Module has 12 pins as shown in the image below.
The L86 is a tiny SMD-type Module that doesn’t have any male/female header pins for testing. So you can use the male header pin with 2.54 spacing and solder them on the L86 PCB from the bottom.
Once, you solder all the 12 Pins on the L86 Module, the Module becomes breadboard friendly. You can now insert the module on the breadboard easily.
Arduino GPS Speedometer Circuit Diagram
Now let us see the circuit diagram of Arduino GPS Speedometer. The connection diagram is fairly simple as shown in image below.
The Quectel L86 GPS module has 12 pins but we will only use 5 pins for our project. Connect the VCC & GND pin of L86 to the 3.3V & GND pin of Arduino. Connect the V_BCKP pin of L86 to 3.3V, if this pin remains unconnected the module won’t work. The Rx & Tx pin of L86 goes to Arduino digital pin 2 & 3 respectively.
The OLED Display is an I2C Module. Connect the VCC & GND Pin of OLED to Arduino 3.3V & GND Pin. Similarly, connect the SDA & SCL pin to Arduino A4 & A5 pin respectively.
Project PCB Gerber File & PCB Ordering Online
If you don’t want to assemble the circuit on a breadboard and you want PCB for the project, then here is the PCB for you. The PCB Board for GPS Speedometer is designed using EasyEDA online Circuit Schematics & PCB designing tool. First the schematic is designed and then the schematic is converted into PCB.
The Gerber File for the PCB is given below. You can simply download the Gerber File and order the PCB from ALLPCB at 1$ only.
You can use this Gerber file to order high quality PCB for this project. To do that visit the ALLPCB official website by clicking here: https://www.allpcb.com/.
You can now upload the Gerber File by choosing the Quote Now option. From these options, you can choose the Material Type, Dimensions, Quantity, Thickness, Solder Mask Color and other required parameters.
After filling all details, select your country and shipping method. Finally you can place the order.
Source Code/Program
The best part about the L80 GPS Module is, it supports Tiny GPS++ Library. Download the library and add it to the Arduino library folder. Apart from Tiny GPS++ Library, the code also requires SSD1306 Library called as Adafruit SSD1306 library.
Here is the complete code. You can copy the code and upload it to the Arduino Nano Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
#include <SoftwareSerial.h> #include <Wire.h> #include <Adafruit_SSD1306.h> #include <TinyGPS++.h> #define rxPin 2 #define txPin 3 SoftwareSerial mygps(rxPin, txPin); #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels #define OLED_RESET -1 //Reset pin # (or -1 if sharing Arduino reset pin) #define SCREEN_ADDRESS 0x3C //See datasheet for Address Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); TinyGPSPlus gps; void setup() { Serial.begin(115200); mygps.begin(9600); if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { Serial.println(F("SSD1306 allocation failed")); for (;;); // Don't proceed, loop forever } display.clearDisplay(); display.display(); delay(2000); } void loop() { boolean newData = false; for (unsigned long start = millis(); millis() - start < 1000;) { while (mygps.available()) { if (gps.encode(mygps.read())) { newData = true; } } } //If newData is true if (newData == true) { newData = false; display.setTextColor(SSD1306_WHITE); if (gps.location.isValid() == 1) { //String gps_speed = String(gps.speed.kmph()); display.setCursor(0, 0); display.setTextSize(3); display.print(gps.speed.kmph()); display.setCursor(75, 20); display.setTextSize(2); display.print("km/h"); display.setTextSize(1); display.setCursor(0, 50); display.print("SAT:"); display.setCursor(25, 50); display.print(gps.satellites.value()); display.setTextSize(1); display.setCursor(70, 50); display.print("ALT:"); display.setCursor(95, 50); display.print(gps.altitude.meters(), 0); display.display(); delay(1500); display.clearDisplay(); } } else { display.setTextColor(SSD1306_WHITE); display.setCursor(0, 0); display.setTextSize(3); display.print("No Data"); display.display(); delay(1500); display.clearDisplay(); } } |
Testing the Arduino GPS Speedometer
Upload the above code to the Arduino Nano Board. Initially the OLED Display will show no data. This is because the L86 GPS receiver is not synchronized with satellite system.
After waiting for a while, the GPS starts receiving the signal from the nearest satellite system. The receiving of signal and synchronization with satellite depends upon the indoor-outdoor conditions. After proper synchronization with the satellite, the OLED screen shows the speed in kilometers per hour (kmph). It may show zero speed when it is kept at rest.
While the GPS Speedometer is placed in a moving vehicle it starts showing the speed in kmph. It also shows the total satellite connected to the system as well as the altitude in meters.
Video Tutorial & Guide
This is how we can build an Arduino Speedometer using GPS Module and Arduino. There are so many applications of Speedometers. It can be used to measure the speed of cars, bicycles, walks, races, or even boats, buses, trains, bicycles, and planes.




















9 Comments
hi, in the gerber pcb you added 3 condensers, what are the values for them?
C1=C3=0.1uF, C2=10uF
I see in the pictures you posted you had an L80-r and L80-m39 and a L86 GPS module. which one did you end up using. Also will all of them work?
All of them are similar with the same pins. Any of them will work.
how to change the code to show speed in knots ?
Can I use a larger screen for a larger display?
Not sure how you got this to work. I was working on a similar project and just couldn’t get the SoftwareSerial to work with the I2C of the OLED. I read that the interrupts in SoftwareSerial mess with the I2C. I uploaded your code and I get the same issue with this:
Serial.println(F(“SSD1306 allocation failed”));
for (;;); // Don’t proceed, loop forever
hi is it possible to logg the speed information for every seconds in excel
Im having trouble making this work. Ive bought all the exact hardware listed, connected it correctly, copy and pasted the code, but it never seems to get GPS location. NO DATA is displayed constantly. Im pretty sure ive soldered the GPS pins correctly. Any ideas?