Problem with SIM800L module and Arduino Nano

Hello, I've been engaged in a project involving an Arduino Nano, and a SIM800L GSM module as the primary components. I'm encountering an issue with interfacing the SIM800L module with the Arduino.

When attempting to establish communication between the SIM800L module and the Arduino via the Arduino Serial Monitor input, I'm not observing any response. There's no indication of input commands appearing in the serial monitor, nor any output resulting from the input commands.

N.B. The SIM800L does connect to the GSM network and can be confirmed through the LED blinking pattern.

Could you please advise on potential solutions to address this issue?

1 Like

Welcome to the forum

Start by posting your current best effort to program this and describe the problems in more detail

Are you using pins 0 and 1 in the sktch by any chance ?

Apologies for the oversight in my previous message.

Regarding the pin connections between the SIM800L and Arduino Nano, they are as follows:

  • SIM800L RX to Arduino Nano D7
  • SIM800L TX to Arduino Nano D8
#include <SoftwareSerial.h>

// Create a SoftwareSerial object to communicate with the SIM800L module
SoftwareSerial mySerial(8, 7);  // SIM800L Tx & Rx connected to Arduino pins #8 & #7
void setup() {
  // Initialize serial communication with Arduino and the Arduino IDE (Serial Monitor)
  Serial.begin(9600);
  // Initialize serial communication with Arduino and the SIM800L module
  mySerial.begin(9600);
  Serial.println("Initializing...");
  delay(1000);
  mySerial.println("AT");  // Handshake test, should return "OK" on success
  updateSerial();
  mySerial.println("AT+CSQ");  // Signal quality test, value range is 0-31, 31 is the best
  updateSerial();
  mySerial.println("AT+CCID");  // Read SIM information to confirm whether the SIM is inserted
  updateSerial();
  mySerial.println("AT+CREG?");  // Check if it's registered on the network
  updateSerial();
}
void loop() {
  updateSerial();
}
void updateSerial() {
  delay(500);
  while (Serial.available()) {
    mySerial.write(Serial.read());  // Forward data from Serial to Software Serial Port
  }
  while (mySerial.available()) {
    Serial.write(mySerial.read());  // Forward data from Software Serial to Serial Port
  }
}

Upon running the code and accessing the serial monitor, I noticed that manually inputting any AT command doesn't yield the corresponding output or any output in the serial monitor.

1 Like

I'm not an expert in this topic, but here's a couple of things to check.

Are all of your devices running at the same baud rate? I see you set the baud rate to 9600 for both the hardware serial and software serial connections, but are your devices also running at that baud rate?

Next, and what I suspect is the real problem here. When entering the AT command in the Serial Monitor, try switching between the different types of line endings. There is a drop-down menu in the top right corner of the Serial Monitor that allows you indicate how you want to end a command. Namely, you can choose between New Line, Carriage Return, New Line + Carriage Return, or None.

I've run in to a similar problem as you when I was trying to communicate with a Bluetooth board, and all of my problems were solved when I switched the line ending to "No Line Ending." The device I was talking to just didn't know what to do with the New Line symbol at the end of every command so it wouldn't return anything.

I hope this helps!

2 Likes

Thank you for the suggestion, I've tried switching between different line endings, but still not taking any input or showing any output. :cry:

Check your RX and TX pins. It looks like, from the post above, you may have the RX and TX swapped.

In the softwareSerial command, I believe the parameters are mySerial(RX, TX). From what you stated in post #3, you may have the SIM800L RX pin going to the softwareSerial RX pin. Likewise for the TX pins. These should be connected so that RX from the SIM800L got to TX on the Arduino, and TX on the SIM800L should go to RX on the Arduino.

I hope it's something simple like this, because if this doesn't fix it then I'm getting close to the limit of my expertise on this topic.

To be clear, you can change it in software. Just switch the numbers in your software serial declaration so that it is SoftwareSerial mySerial(7,8); and that might fix it.

Hope this fixes it!

1 Like

Thank you for the suggestion. I encountered an issue with the baud rate, which seemed to be causing the problem. Interestingly, the system only worked when set to the baud rate of 115200. Regardless of whether I tried the initial 9600 baud rate or any other standard baud rates such as 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, or 57600—both in the code and the serial monitor selection—none of them seemed to work except for 115200.

Making adjustments to all baud rates to 115200 resolved the issue. :blush:

2 Likes

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