This circuit interfaces an Arduino Nano with a GPS NEO 6M module and a SIM800c GSM module. The GPS module provides location data, which is then transmitted via the GSM module. The circuit is powered by a 3.7V battery, which is managed by a TP4056 charging module.
Arduino Nano
GPS NEO 6M
SIM800c GSM Module
TP4056
3.7V Battery
Pushbutton (x2)
/*
* Arduino Nano GPS and GSM Module Interface
*
* This code reads GPS data from the NEO 6M module and sends it via the
* SIM800c GSM module. The GPS module is connected to pins D2 (TX) and D3 (RX)
* of the Arduino Nano. The GSM module is connected to pins D4 (TXD) and D5 (RXD).
*/
#include <SoftwareSerial.h>
// GPS module connections
#define GPS_TX_PIN 2
#define GPS_RX_PIN 3
// GSM module connections
#define GSM_TX_PIN 4
#define GSM_RX_PIN 5
SoftwareSerial gpsSerial(GPS_TX_PIN, GPS_RX_PIN); // RX, TX
SoftwareSerial gsmSerial(GSM_TX_PIN, GSM_RX_PIN); // RX, TX
void setup() {
// Initialize serial communication
Serial.begin(9600);
gpsSerial.begin(9600);
gsmSerial.begin(9600);
// Wait for GSM module to initialize
delay(1000);
Serial.println("GSM Module Initialized");
}
void loop() {
// Read data from GPS module
if (gpsSerial.available()) {
String gpsData = gpsSerial.readString();
Serial.println("GPS Data: " + gpsData);
// Send GPS data via GSM module
gsmSerial.println(gpsData);
Serial.println("Data sent via GSM");
}
// Small delay to avoid flooding
delay(1000);
}
This code initializes the GPS and GSM modules and continuously reads GPS data, which is then sent via the GSM module. The GPS module is connected to pins D2 (TX) and D3 (RX) of the Arduino Nano, while the GSM module is connected to pins D4 (TXD) and D5 (RXD).