0
\$\begingroup\$

I am using Arduino Uno and trying to connect to a SIM900A GSM module using serial communication. I am not receiving anything from the module at all. The module powers on and has another LED flashing at 800ms

I have connected the following

  • 5V from Arduino to 5V power supply input on GSM

  • GND from Arduino to GND power supply input on GSM

  • Pin 2 (Rx) from Arduino to Tx serial on GSM

  • Pin 3 (Tx) from Arduino to Rx serial on GSM

  • GND from Arduino to GND serial on GSM

Breakout-board schematic from this page.

enter image description here

I have tried both Arduino's built in serial comm and also software serial using pins 2 and 3.

Information about SIM900 can be found here.

picture of the module

The code that I am currently running, using software serial:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

const int baud = 9600;

void setup() {
  mySerial.begin(baud);
  Serial.begin(baud);

  while (mySerial.available() < 0) {
    mySerial.write("AT");
    delay(2000);
  }
}

void loop() {
  if (mySerial.available() > 0) {
    Serial.write(mySerial.read());
  }
}

I have also tried different baud rates but still haven't received anything from the module at all.

\$\endgroup\$
4
  • \$\begingroup\$ FYI I've decided to remove my answer, as I am finding conflicting information about two very similar modules. Without having your specific module in my hands to do the reverse-engineering myself, I cannot be sure that my comments (given with the best of intentions and after spending time on research) won't cause further problems. Although I sometimes buy modules from Amazon/Ebay "for play", I always expect that I will have to reverse-engineer them, due to the typically poor (or missing) documentation. Unfortunately this seems to be one of those occasions for you too. Good luck! \$\endgroup\$
    – SamGibson
    Commented Apr 19, 2016 at 12:53
  • \$\begingroup\$ Have you tried the "normal" serial pins? \$\endgroup\$
    – devanand
    Commented Apr 19, 2016 at 13:04
  • \$\begingroup\$ Yes I have tried the inbuilt serial pins, I've also tried another Arduino and tried setting up serial connection between two arduinos both ways to check if they work. \$\endgroup\$ Commented Apr 19, 2016 at 13:13
  • \$\begingroup\$ According to the SIM900 documentation, DTR (pin 3 of the SIM900A) must be connected to ground through 10K resistor if DTR is not connected to DTE (see Connection under linked page in post). But DTR is not connected to ground in the schematic linked in post, could this be an issue? \$\endgroup\$ Commented Apr 19, 2016 at 15:40

3 Answers 3

2
\$\begingroup\$

One problem I can see in your code is the following line:

while (mySerial.available() < 0) {

The available() method returns the number of characters available and will never be negative, so that means your AT command will never be transmitted, in fact your main code probably isn't starting up. Also you're not terminating the command with a carriage return so try the following code:

while (mySerial.available() == 0) {
  mySerial.println("AT");
  delay(2000);
}

Often when playing around with a new GSM module I find it more convenient to be able to type things from a PC to check operation, so maybe for a start you could use something like this to pass data through:

void loop() {
  if (mySerial.available() > 0)
    Serial.write(mySerial.read());
  if (Serial.available() > 0)
    mySerial.write(Serial.read());
}

I used a very similar board recently with a SIM900 loaded that didn't come with much in the way of documentation and while searching I found some Arduino boards are set for auto-baud and some are fixed at 19200, so using a baud rate of 19200 that should work either way might be your best starting point.

\$\endgroup\$
0
\$\begingroup\$

Power. Do you have adequate power for your SIM900 module? Some shields will use more current than the Arduino can supply (up to 2A), so you may need an external high-current supply.

http://tronixstuff.com/2014/01/08/tutorial-arduino-and-sim900-gsm-modules/

\$\endgroup\$
0
\$\begingroup\$

Are you sending only one AT command and waiting for response? If the module is in sleep mode(AT+CSCLK=1,AT+CSCLK=2) then it is possible that your module will consider the first AT command as wakeup call and start answering next coming AT command. Send atleast two commands to make sure that module is not responding.

And if the module is in Auto baud mode(AT+IPR=0) then it will set its baud rate based on first command given to it. So always the first command given to the module should always be in capital letters.

There are a set of reasons why the module might not be responding. It will be a good idea to try to communicate with the module through a serial port terminal software rather than trying to debug directly connected to Arduino. There you can see what exactly the module is doing, If you see any response from module on terminal then possibly there is something wrong on Arduino side.

I recently wrote a article on it, if you want to check it out.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.