user11672: I'm working with arduino nano and it has interfaced with SIM900 GSM. I'm sending "AT\r" to GSM modem, but not getting response. 
void setup()
{
  Serial.begin(9600);
  Serial.println("Setup is Ready");  
}

void loop()
{
   Serial.write("AT\r");
   delay(1000);
   if(Serial.available() > 0)
   {
     Serial.println("Data received");
     Serial.println(Serial.read());
   }

}

Serial monitor:
Setup is Ready
ATATATATATATATATATATATATATATATATATAT
I've set the 9600 baudrate to modem and my rx and tx is connected correctly...
What is the problem? 
Thanks

user781: You aren't talking to the SIM900. You are just communicating with the serial monitor.

user6424: You should not use the same Serial interface to debug and talk to your SIM900. You should use a SoftwareSerial interface to talk to the SIM900 and use the hardware Serial to send response back to your computer.
Try this code:
#include <SoftwareSerial.h>

const byte rxPin = 2; // Wire this to Tx Pin of SIM900
const byte txPin = 3; // Wire this to Rx Pin of SIM900

// We'll use a software serial interface to connect to SIM900
SoftwareSerial SIM900(rxPin, txPin);

void setup() {
  Serial.begin(115200);
  SIM900.begin(9600); // Change this to the baudrate used by SIM900
  delay(1000); // Let the module self-initialize
}

void loop() {
  Serial.println("Sending an AT command...");
  SIM900.println("AT");
  delay(30);
  while (SIM900.available()){
     String inData = SIM900.readStringUntil('\n');
     Serial.println("Got reponse from SIM900: " + inData);
  }  
}


11672: <p>I'm working with arduino nano and it has interfaced with SIM900 GSM. I'm sending "AT\r" to GSM modem, but not getting response. </p>

<pre><code>void setup()
{
  Serial.begin(9600);
  Serial.println("Setup is Ready");  
}

void loop()
{
   Serial.write("AT\r");
   delay(1000);
   if(Serial.available() &gt; 0)
   {
     Serial.println("Data received");
     Serial.println(Serial.read());
   }

}
</code></pre>

<p>Serial monitor:</p>

<p>Setup is Ready</p>

<p>ATATATATATATATATATATATATATATATATATAT</p>

<p>I've set the 9600 baudrate to modem and my rx and tx is connected correctly...
What is the problem? </p>

<p>Thanks</p>
 781: <p>You aren't talking to the SIM900. You are just communicating with the serial monitor.</p>
 6424: <p>You should not use the same Serial interface to debug and talk to your SIM900. You should use a SoftwareSerial interface to talk to the SIM900 and use the hardware Serial to send response back to your computer.</p>

<p>Try this code:</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;

const byte rxPin = 2; // Wire this to Tx Pin of SIM900
const byte txPin = 3; // Wire this to Rx Pin of SIM900

// We'll use a software serial interface to connect to SIM900
SoftwareSerial SIM900(rxPin, txPin);

void setup() {
  Serial.begin(115200);
  SIM900.begin(9600); // Change this to the baudrate used by SIM900
  delay(1000); // Let the module self-initialize
}

void loop() {
  Serial.println("Sending an AT command...");
  SIM900.println("AT");
  delay(30);
  while (SIM900.available()){
     String inData = SIM900.readStringUntil('\n');
     Serial.println("Got reponse from SIM900: " + inData);
  }  
}
</code></pre>
