Speedometers are utilized to estimate the traveling speed of a vehicle. Here we are using GPS to estimate the speed of a moving vehicle.

Summary:

Speedometers are utilized to estimate the traveling speed of a vehicle. Here we are using GPS to estimate the speed of a moving vehicle.

About Project

NEO6M GPS Module

In this project, we are using the NEO6M GPS module. The NEO-6M GPS module is a well known GPS receiver with a built-in ceramic antenna, which also offers strong satellite searchability.

With the on-board signal indicator, we can easily analyze the network status of the module. It has a data backup battery so that the module can protect the data when the central power is shut down unexpectedly.

NEO6M GPS Module.jpg

Features:

  • Operating voltage: (2.7-3.6)V DC
  • Operating Current: 67 mA
  • Baud rate: 4800-230400 bps (9600 Default)
  • Communication Protocol: NEMA
  • Interface: UART
  • External antenna and built-in EEPROM.

I2C OLED Display

OLED can be easily interfaced with other microcontrollers to build some interesting projects.

I2C OLED.jpg

Technical Specifications:

  • Driver IC: SH1106
  • Input Voltage: 3.3V-5V DC
  • Resolution: 128x64
  • Interface: I2C
  • Current consumption: 8 mA
  • Viewing angle: >160 degree
        #include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <Adafruit_SH1106.h>
#define OLED_ADDRESS   0x3C
#define OLED_RESET -1
Adafruit_SH1106 display(OLED_RESET);
int RX = 2, TX = 3;
TinyGPSPlus gps;
SoftwareSerial gpssoft(RX, TX);
void setup()
{
  Serial.begin(9600);
  gpssoft.begin(9600);
  display.begin(SH1106_SWITCHCAPVCC, OLED_ADDRESS);
  display.clearDisplay();
  display.display();
}
void loop()
{
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(27, 2);
  display.print("CIRCUIT DIGEST");
  display.setTextSize(1);
  display.setCursor(35, 20);
  display.print("SPEED(KMPH)");
  display.display();
  while (gpssoft.available() > 0)
    if (gps.encode(gpssoft.read()))
      displayspeed();
  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    display.setTextSize(1);
    display.setCursor(35, 40);
    display.print("Error!!!");
    display.display();
    while (true);
  }
}
void displayspeed()
{
  if (gps.speed.isValid())
  {
    display.setTextSize(2);
    display.setCursor(40, 40);
    display.print(gps.speed.kmph());
    display.display();
  }
  else
  {
    display.setTextSize(1);
    display.setCursor(35, 40);
    display.print("No Data!!!");
    display.display();
  }
  delay(100);
}
    

IoT Training will help to learn more about IoT Solutions

rasika Joshi
hIoTron offers an End-to-End IoT Training with live use cases using IoT hardware kit.