GSM Shield SLD33149P

How do I capture the output from an AT command on an Arduino?

I’m using the Arduino Uno R3 with a GSM shield. I have all the AT commands ( … _V1_00.pdf) and I can enter them just fine if I use the terminal and get output. However how can I capture the resulting output via code? The code below shows what I’ve tried but it does not work. In particular where I attempt to get the analog input and then print out the result.

[code]#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);

void setup()
  char sensorValue[32] ="";
  delay(1000);                    //Wait for a second while the modem sends an "OK"
  Serial.println("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  Serial.println("AT+CADC?");    //Get analog input
 Serial.println(;     //Print analog input
  Serial.println("AT+CMGS=\"+MSISDN\"\r");    //Start accepting the text for the message
                                                  //to be sent to the number specified.
                                                  //Replace this number with the target mobile number.
  Serial.println("!");   //The text for the message
  Serial.write(26);  //Equivalent to sending Ctrl+Z 
void loop()
    if (mySerial.available())
  if (Serial.available())


The results I am getting are:


regardless of the changes I make in my analog input

hi there,
I don’t really understand what do you want to do.
this code can capture the output from an AT command on an Arduino .

if (mySerial.available()) Serial.write(;

Well that’s exactly my problem, I don’t get any output back. Allow focus on a test case:

Serial.println("Sending AT command"); mySerial.print("AT\r"); delay(1000); if (mySerial.available()) { Serial.println("MySerial Availabe"); Serial.println(; }

When I run that the only output I get is “Sending AT command”. I would expect to also get back the “OK” that the command AT would respond with but I don’t.