How to connect Arduino Nani with NEO 6M & SIM800L v2.0

Hello.

I want to make a gps tracker using arduino nano, gps module neo 6m, and sim 800L v.2

Till now, i did the connection between arduino Nano and neo6m. The problem is that i didn t find any code that makes these two modules to communicate togheter. I mean the neo 6m and sim800L.

Can someone to help me giving hints how to connect those 3 components togheter and give a code to recive the Lat, and Long when i send an SMS to my SIM800L module?
Also, this SIM800L v2.0 can work just with the 5V provided from Arduino Nano?

This is my code now.

#include <TinyGPS++.h> //Libary TinyGPS
#include <SoftwareSerial.h> //Libarary bawaan

// Choose two Arduino pins to use for software serial
int RXPin = 2; //Connect ke TX GPS
int TXPin = 3; //Connect ke RX GPS

int GPSBaud = 9600; //Biarin default

// Membuat objek TinyGPS++
TinyGPSPlus gps;

// Mmebuat koneksi serial dengan nama "gpsSerial"
SoftwareSerial gpsSerial(RXPin, TXPin);

void setup()
{
  //Memulai koneksi serial pada baudrate 9600
  Serial.begin(9600);

  //Memulai koneksi serial dengan sensor
  gpsSerial.begin(GPSBaud);
}

void loop()
{
  //Membuat tampilan data ketika terdapat koneksi
  while (gpsSerial.available() > 0)
    if (gps.encode(gpsSerial.read()))
      displayInfo();

  // Jika dalam 5 detik tidak ada koneksi, maka akan muncul error "No GPS detected"
  // Periksa sambungan dan reset arduino
  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println("No GPS detected");
    while(true);
  }
}

void displayInfo()
{
  if (gps.location.isValid())
  {
    Serial.print("Latitude: ");
    Serial.println(gps.location.lat(), 6);
    Serial.print("Longitude: ");
    Serial.println(gps.location.lng(), 6);
    Serial.print("Altitude: ");
    Serial.println(gps.altitude.meters());
  }
  else
  {
    Serial.println("Location: Not Available");
  }
  
  Serial.print("Date: ");
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print("/");
    Serial.print(gps.date.day());
    Serial.print("/");
    Serial.println(gps.date.year());
  }
  else
  {
    Serial.println("Not Available");
  }

  Serial.print("Time: ");
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(":");
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(":");
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(".");
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.println(gps.time.centisecond());
  }
  else
  {
    Serial.println("Not Available");
  }

  Serial.println();
  Serial.println();
  delay(1000);
}

ThankYou

SoftwareSerial has major limitations, e.g. if both the GPS and SIM800 require serial communications a Nano is not a good choice
move to a microcontroller with several hardware serial interfaces
e.g. connecting a SIM800L EVB modem to Arduino Mega Serial1 I used

// Arduino Mega connections
//SIM800L 5V  POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L VDD to Mega 5V
//SIM800L TXD to Mega RX1 pin 19
//SIM800L RXD to Mega TX1 pin 18
//SIM800L UART TTL GND and RST not connected

I need to make a gps tracker and to put it inside my electric scooter. I need to use small size of components

consider using an ESP32, e.g. SIM800 EVB module with a ESP32 NodeMCH
image

e.g. serial monitor output

at
OK
at+cgmi
SIMCOM_Ltd
OK
at+cgmm
SIMCOM_SIM800L
OK
at+cgmr
Revision:1418B05SIM800L24
OK

Man, ESP32 NodeMCH, need a permanently wifi connection?

I was suggesting connecting the SIM800 to the ESP32 - it has three hardware serial ports and post 4 shows s SIM800 connected to one of them
the SIM800L works on 2G networks, so it will only work in your country if 2G networks are available. 2G and 3G networks are being shut down in many countries. Check if you have 2G network

I can't understand what you re trying to say. But, i have 2G and 3G in my country and i was wondering if i use arduino nano. I saw on youtube that is possible.

SoftwareSerial cannot transmit and receive data at the same time which may be your problem

try AltSoftSerial on the Nano
e.g. I have run the following code on a UNO

// SIM800l AltSoftSerial test 

#include <AltSoftSerial.h>

// Mega SIM800l  test
//SIM800L 5V  POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L TXD to Mega RX pin 48
//SIM800L RXD to Mega TX pin 46
//SIM800L VDD to Mega 5V

//SIM800L UART TTL GND and RST not connected

//SIM800L TXD to UNO RX pin 8
//SIM800L RXD to UNO TX pin 9

// taking the RST pin to GND for a couple of seconds which will reset the device

//  RS232 shield 
//   RS232 TXD to UNO pin 9
//  =[===RS232 RXD to UNO pin 8
AltSoftSerial simSerial;

void setup() {
  Serial.begin(115200);
  Serial.println("AltSoftSerial test");
  //Begin serial communication with Arduino and SIM800L
  simSerial.begin(9600);
  Serial.println("SIM module intialized");
}

void loop() {
  if (Serial.available()) {
    char command = Serial.read();
    //Serial.println(command);
    simSerial.print(command);
  }
  while (simSerial.available()) {
    char reponse = simSerial.read();
    Serial.print(reponse);
  }
}

when I enter AT commands the serial monitor displays

AT
OK
AT+CGMI
SIMCOM_Ltd
OK
AT+CGMM
SIMCOM_SIM800L

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.