SIM900a modem not working

Hello, I have this specific SIM900a module but it seems that I am not connecting. Using a sim card capable of 2g-4g. Connected rx SIM900 to pin 3 and tx SIM900 to pin2. been looking round the internet for solutions

image
image

I have used the code provided by arduino site itself here

// import the GSM library
#include <GSM.h>

// PIN Number
#define PINNUMBER ""

// initialize the library instance

GSM gsmAccess(true);     // include a 'true' parameter for debug enabled

GSMScanner scannerNetworks;

GSMModem modemTest;

// Save data variables

String IMEI = "";

// serial monitor result messages

String errortext = "ERROR";

void setup()
{

  // initialize serial communications

  Serial.begin(9600);

  Serial.println("GSM networks scanner");

  scannerNetworks.begin();

  // connection state

  boolean notConnected = true;

  // Start GSM shield

  // If your SIM has PIN, pass it as a parameter of begin() in quotes

  while(notConnected)

  {

    if(gsmAccess.begin(PINNUMBER)==GSM_READY)

      notConnected = false;

    else

    {

      Serial.println("Not connected");

      delay(1000);

    }

  }

  // get modem parameters

  // IMEI, modem unique identifier

  Serial.print("Modem IMEI: ");

  IMEI = modemTest.getIMEI();

  IMEI.replace("\n","");

  if(IMEI != NULL)

    Serial.println(IMEI);

  // currently connected carrier

  Serial.print("Current carrier: ");

  Serial.println(scannerNetworks.getCurrentCarrier());

  // returns strength and ber

  // signal strength in 0-31 scale. 31 means power > 51dBm

  // BER is the Bit Error Rate. 0-7 scale. 99=not detectable

  Serial.print("Signal Strength: ");

  Serial.print(scannerNetworks.getSignalStrength());

  Serial.println(" [0-31]");
}

void loop()
{

  // scan for existing networks, displays a list of networks

  Serial.println("Scanning available networks. May take some seconds.");

  Serial.println(scannerNetworks.readNetworks());

    // currently connected carrier

  Serial.print("Current carrier: ");

  Serial.println(scannerNetworks.getCurrentCarrier());

  // returns strength and ber

  // signal strength in 0-31 scale. 31 means power > 51dBm

  // BER is the Bit Error Rate. 0-7 scale. 99=not detectable

  Serial.print("Signal Strength: ");

  Serial.print(scannerNetworks.getSignalStrength());

  Serial.println(" [0-31]");

}
1 Like

Can you access the modem using AT commands only? It's a good test for connectivity. You can also do some limited troubleshooting via the AT commands.

1 Like

I tried sending AT command but no response, the led also keeps on blinking

you need to connect GND as well and possibly other pins (any reset?)
you need to power the module appropriately as well. (2 amps needed so not through the Arduino)

post a link to where you purchased your module.

I am powering it using a 5v 2a power brick. I also connected the GND to the arduino

https://shopee.ph/New-SIM900A-V4.0-Kit-Wireless-Extension-Module-GSM-GPRS-Board-Antenna-Tested-Worldwide-Store-i.498112208.11934200327?sp_atk

It seems like there are a lot of details missing. Instead of providing them only when asked, please combine everything that you can tell us in one post.

If you don't, it can waste a lot of time. For example, looking at the code won't help if the AT commands don't work.

I have removed the code now from arduino.

Module power source: 5v 2A power brick
Connection: GND SIM900 to GND Arduino
VR(Rx) to Pin 3 of Arduino
VT(Tx) to Pin 2 of Arduino

Blinking status: LED blinks every second

Does this mean we are not getting connected to the network?

When the SIM900A is powered on, the Status LED will blink once every second. When the GSM connection has been established the Status LED of the SIM900A will blink every 3 seconds
there is a tutorial here: (not sure what it's worth)

What could be the reason why it's not connecting, I am using a Sim card capable of 2g to 4g. I am outside testing it.

GSM/GPRS is getting extinct... may be you don't have 2G coverage in your region...

have you followed the tutorial, step by step? where does it fail?

2G network is still not a issue in my location I guess since I always see a 2g in my phone.

Problem 1. AT commands not working
Problem 2. LED is blinking every second meaning not connecting to the network

What antenna do you have connected? Have you tried a simple pass through serial sketch (provided in the Arduino example sketches), to verify the serial connection?

The one I have uploaded is from arduino sample sketches

Obviously, you had to change a few things to select the correct port etc. Can you please post the modified example sketch?

I am referring to Examples->Communication->SerialPassThrough

I did not changed anything yet

which is meant for the Arduino GSM shield — which is not what you have...

I guess you don't understand what a "serial pass through" is... it would allow you to type AT commands manually.

I got confused wait, sorry

what should I do with this one? I am not really sure what's going on. this is my first time using such modules.

/*
  SerialPassthrough sketch

  Some boards, like the Arduino 101, the MKR1000, Zero, or the Micro, have one
  hardware serial port attached to Digital pins 0-1, and a separate USB serial
  port attached to the IDE Serial Monitor. This means that the "serial
  passthrough" which is possible with the Arduino UNO (commonly used to interact
  with devices/shields that require configuration via serial AT commands) will
  not work by default.

  This sketch allows you to emulate the serial passthrough behaviour. Any text
  you type in the IDE Serial monitor will be written out to the serial port on
  Digital pins 0 and 1, and vice-versa.

  On the 101, MKR1000, Zero, and Micro, "Serial" refers to the USB Serial port
  attached to the Serial Monitor, and "Serial1" refers to the hardware serial
  port attached to pins 0 and 1. This sketch will emulate Serial passthrough
  using those two Serial ports on the boards mentioned above, but you can change
  these names to connect any two serial ports on a board that has multiple ports.

  created 23 May 2016
  by Erik Nyquist

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialPassthrough
*/

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

void loop() {
  if (Serial.available()) {      // If anything comes in Serial (USB),
    Serial1.write(Serial.read());   // read it and send it out Serial1 (pins 0 & 1)
  }

  if (Serial1.available()) {     // If anything comes in Serial1 (pins 0 & 1)
    Serial.write(Serial1.read());   // read it and send it out Serial (USB)
  }
}

Substitute the SoftwareSerial port for 'Serial1'. Obviously, you have to include and provision the Software serial library for that. You should know how to do that because your GSM sketch must have it.