GPS Module Interface

Read latitude, longitude, and time from a GPS module.

Circuit Diagram
Circuit diagram for GPS Module Interface
Wire Connections & Pin Configuration

Wire Color Connections:

Green → Pin 4 (RX) to GPS TX
Blue → Pin 3 (TX) to GPS RX
Red → 5V to GPS VCC
Black → GND to GPS GND

Pin Configuration:

Arduino Digital Pin 4 (RX) → GPS TX
Arduino Digital Pin 3 (TX) → GPS RX
Arduino 5V → GPS VCC
Arduino GND → GPS GND
Arduino Code
Edit
#include <SoftwareSerial.h>

int RXPin = 4;  // Receiver pin (connected to TX of GPS module)
int TXPin = 3;  // Transmitter pin (connected to RX of GPS module)
int GPSBaud = 9600;  // GPS communication baud rate

// Create a software serial port named 'gpsSerial'
SoftwareSerial gpsSerial(RXPin, TXPin);

void setup() {
  Serial.begin(9600);       // Start Serial Monitor
  gpsSerial.begin(GPSBaud); // Start communication with GPS module
}

void loop() {
  // Continuously read and forward GPS data to Serial Monitor
  while (gpsSerial.available() > 0) {
    Serial.write(gpsSerial.read());
  }
}

Instruction Details

Wiring: Connect GPS TX to Arduino Digital Pin 4 (RX), GPS RX to Arduino Digital Pin 3 (TX). Connect VCC to 5V and GND to GND.
Library: Not required (SoftwareSerial built-in).
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: Open Serial Monitor (Tools → Serial Monitor) at 9600 baud. Raw NMEA data displays. Place module outdoors or near window for satellite lock.

How to Use

  1. Connect the required components as per the Pin Configuration above
  2. Open Arduino IDE and create a new sketch
  3. Copy and paste the code above
  4. Select your Arduino board and COM port from Tools menu
  5. Click the Upload button to upload the code to your Arduino
  6. Open Serial Monitor (if applicable) to see the output

Components Required

  • Arduino Uno
  • NEO-6M or similar GPS Module
  • Breadboard
  • Jumper Wires

Category: Sensors