Wednesday 24 January 2018

Arduino IoT Tutorial 7 – Your Location using GPS

Components Required:
1. Arduino Uno
2. Linux PC/Windows PC (Tested with Windows 10, Ubuntu 14.04 LTS)
3. USB cable A to B
4SIM28ML GPS Module
5Jumper Wires
Way to go ->
1. Connect Arduino Uno to PC via the USB cable.
2. Upload GPS.ino to the Arduino. (TinyGPS library used)
GPS.ino
#include <TinyGPS.h>

TinyGPS gps;

long lat, lon;

void setup() {
  Serial.begin(9600);
}

void loop() {
  while (Serial.available())
  {
    int c = Serial.read();
    gps.encode(c);
  }

  gps.get_position(&lat, &lon);
  Serial.print("Latitude, Longitude: "); Serial.print(lat * pow(10, -6)); Serial.print(", "); Serial.println(lon * pow(10, -6));
}


Hardware Connections ->
1. GPS Module to Arduino Uno


Note:- Make sure you disconnect the Tx (GPS Module) to Rx (Arduino Uno) connection every time you upload the Arduino sketch (GPS.ino).

No comments:

Post a Comment

SMART BLIND STICK The smart blind stick is the project made to help the blind people who is suffering when walking.It just uses to de...