Tuesday, 12 November 2013

Interfacing Serial Devices - Part 3 - Working with a Serial GSM Modem

GSM Modems

GSM modems are GSM devices that help you add GSM functionality to your projects. You can almost build a complete phone using a GSM modem however that would be a waste of time and energy as a phone would work out to be much more cost-efficient. While DTMF can help us control remotely, DTMF is limited when it comes to Monitoring. This is where GSM modems can help us. GSM modems could play a key role in projects requiring Remote monitoring and Control - Say an alarm system at a power plant that sends you an sms when something goes wrong and lets us access it and control it by calling from a specific number or by sending a specific SMS. In this tutorial, we will see how to interface with the popular Sim900A GSM modem

GSM Modems can be controlled Serially by sending out pre-defined commands to them. These commands are called AT commands.  Click To Download the Sim900A AT Command List. Working with GSM Modems would be a complete subject by itself and We shall limit the scope of this tutorial to focus on Calling & Messaging alone

Lets Look at some Basic Commands required to perform basic telephony operations

Calling
  • To Make a Call - ATD+91XXXXXXXXXX; Refer to Page 17 / Sec 2.2.3
  • To Hang up the Call Being Dialed - ATH Refer to Page 24 / Sec 2.2.6


Messaging
  • Set Message Type as Text - AT+CMGF=1 Refer to Page 100 / Sec 4.2.2
  • Set Message Destination Number & Type Message - AT+CMGS="+91XXXXXXXXXX" Refer to Page 107 / Sec 4.2.5  - On entering this command, the GSM modem would respond with its own terminal prompt where we need to type in the message to be sent. Once we are finished typing the message, we need to press Ctrl+Z to exit this terminal prompt. Once we exit, the modem will send the message to the user.

In addition to the above commands, the GSM modem will give us a set of Serial Messages when it receives a Call or SMS. Here are some of the messages (they will not be identical all the times!)

Incoming Calls
incoming calls return a message similar to this
RING

+CLIP: "+91XXXXXXXXXX",phonebook entry position,"",,"phonebook entry",0

Incoming SMS
incoming sms return a message similar
+CMTI: "SM",23


Read SMS
To Read the Incoming SMS, we can use the command AT+CMGR=X where X is the number returned at the last of the +CMTI output above. In our above example it is 23

This command would retrieve the SMS in the following format
+CMGR: "REC UNREAD","+91XXXXXXXXXX","phonebook entry","Date,Time"
Message Text

The above set of information is sufficient for us to work with the GSM modem. Now if you noticed, there is a lot of Text Data to be processed. Let's first get to processing Text Data (STRING) before proceeding with programming the GSM Modem.


Processing Text Data - Strings

Processing of Strings has become easier with recent versions of Arudino IDE. The datatype is now part of the core. You can read more about String Here - > http://arduino.cc/en/Reference/StringObject

Declaring a String Variable
You can declare a String Variable like any other Variable. Here are some example declarations

String  input;
String input = "";
String input = "Hello";

String Operations
Interestingly you can perform 3 Operations on the String Variable type

  1. [] (element access) => Access the element of a String
    • E.g.: input[0], this will be 'H' based on the above example
  2. + (concatenation) => Append characters to an Existing String
    • E.g.: input += 'W';  this will add 'W' towards the end of the String and now input will be "HelloW"
  3. == (comparison) => Compare a String Variable with a String
    • E.g.: if(input=="Hello") this will return true or false depending upon the value of input

String Functions
There are a number of String Functions that let you process Strings in different ways. Refer to the above String Object Reference Page for a complete list. We shall look at some of the functions we would need for our program

  1. length() => Returns the length of the given String. 
    • E.g.: int i = input.length(); this will get the length of the String input and store it in the variable i. in our case ("Hello") length will be returned as 5
  2. substring() => Extracts a substring from the given string
    • E.g.:  input.substring(1,3)  will return "el" the starting index '1' is included and the ending index '3' is excluded when extracting the substring
    • E.g.: input.sunstring(2) will return "llo". in this case only the starting index is provided. 
  3. toUpperCase() => Converts the given String to Upper Case
    • E.g.: input.toUpperCase(); will change the value of input from "Hello" to "HELLO". This makes it easier to build programs that are not case sensitive
  4. toLowerCase() => Converts the given String to Lower Case
    • E.g.: input.toLowerCase(); will change the value of input from "Hello" to "hello". This makes it easier to build programs that are not case sensitive
  5. trim() => Trims any leading / trailing white spaces in the string
    • E.g.:  Say we have a variable String input1 = "  Hello  "; with 2 leading and 2 trailing white spaces, input1.trim() will have the value "Hello" with the leading / trailing white spaces trimmed off
Now try the following program to understand the usage of all the above functions. The program receives a String Serially, Trims it, Extracts a substring and prints both the lower and upper case versions of it along with the length before and after trimming.

Here's the Program
/*  Induino R3 User Guide - Program 17.0 - Working with Strings - Basic String Operations
The program receives a String Serially, Trims it, Extracts a substring and prints both the lower and upper case versions of it
It also prints the length of the string before and after trimming
use the following string input as text (key it in from the Serial monitor)
"   This is a Test String   " // there are 3 leading and 3 trailing spaces
 */


String input=""; // Declare an Empty String Variable
String input_trimmed="";// a variable to store the trimmed string
String substring=""; // a variable to store the substring 
int length_before_trim = 0, length_after_trim = 0, length_substring=0; // 3 variables for storing the string lengths

void setup()
{
  Serial.begin(9600); // Initialise Serial Communication
}

void loop()
{
  if(Serial.available()) // Check if there is incoming data in the Serial Buffer
  {
    input = ""; // reset the input variable
    while(Serial.available()) // Process incoming data till the buffer becomes empty
    {     
      input += (char)Serial.read();// Read a byte of data, convert it to character and append it to the string variable
      delay(1);
    }
    Serial.println();
    input_trimmed = input; // assign the trimmed variable with the input value
    input_trimmed.trim();
    substring = input_trimmed.substring(10,14);
    length_before_trim = input.length();
    length_after_trim = input_trimmed.length();
    length_substring = substring.length();
    Serial.println("Your Original Input : " +input);
    Serial.print("Length of Your Original Input : ");
    Serial.println(length_before_trim);
    Serial.println("The Trimmed Input : " +input_trimmed);
    Serial.print("Length of Trimmed Input : ");
    Serial.println(length_after_trim);
    Serial.println("Substring : " +substring);
    Serial.print("Length of Substring : ");
    Serial.println(length_substring);
  }
}
      

Now open the Serial Monitor and paste the following text "   This is a Test String   " and press enter. you should see the output. Depending upon your settings for the serial monitor, the length of the input text will vary (carriage return, newline character, etc are treated as characters and counted)

Interfacing the GSM Modem

Now that we have seen how to work with Strings, lets proceed to see how we can interface the GSM modem.

Hardware Connections
  1. Insert your Sim Card into the GSM modem
  2. Connect the Tx pin of the GSM modem to Digital pin 3 of the Induino R3 / Arduino
  3. Connect the Rx pin of the GSM modem to Digital pin 4 of the Induino R3 / Arduino
  4. Connect the Gnd pin of the GSM modem to the Gnd pin of the Induino R3 / Arduino
  5. Power the GSM modem using an external 12V DC Adaptor (The +5V from the Induino R3 / Arduino is not sufficient!)
  6. Ensure the Network LED blinks with a 2 second delay and not 1 second delay. 2 second delay = connected to network, 1 second delay = unable to connect to network
  7. Additionally, call the number of the simcard in the GSM modem and check if it rings - Ensure you are NOT getting a out of coverage area / switched off message.
Programming it!
Here's a simple program to make a call/ hangup / send an sms based on button presses. you can modify this to suit your application. This program sends the value of the on-board LDR as a sms message.

Here's the Program
/*  Induino R3 User Guide - Program 17.1 - A Simple program to make a call/ hangup / send an sms based on button presses */


#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4);    //RX and TX pins to communicate with GSM module

#define sms_key  7
#define call_key 9
#define end_key 8

String number ="XXXXXXXXXX"; // The Number to which message / call is to be made

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

  pinMode(sms_key,INPUT);
  pinMode(call_key,INPUT);
  pinMode(end_key,INPUT);
  digitalWrite(sms_key,HIGH);
  digitalWrite(call_key,HIGH);
  digitalWrite(end_key,HIGH);
}

void loop()
{
  
  
   //This part sends an sms everytime sms_key is pressed
  if (digitalRead(sms_key)==LOW) // Check if the sms key is being pressed
  {
    int ldr = analogRead(3); // read the on-board LDR value (only on the Induino R3 Board)
    String val = (String)ldr; // Convert the value to a String 
    
    mySerial.println("AT+CMGF=1"); // Set the Mode as Text Mode
    delay(150);
    mySerial.println("AT+CMGS=\"+91"+number+"\"");  // Specify the Destination number in international format
    delay(150);
    mySerial.print("Hello..! The Current LDR Value is.."+val); // Enter the message and append the ldr value
    delay(150);
    mySerial.write((byte)0x1A);                                // End of message character 0x1A : Equivalent to Ctrl+z
    delay(50);
    mySerial.println();
  }
   
   //This section generates a call when call_key is pressed
   
  else if (digitalRead(call_key)==LOW) // Check if the call key is being pressed
  {
    mySerial.println("ATD+91"+number+";");  //Specify the number to call
    while(digitalRead(call_key)==LOW);
    delay(50);
  }
  
  //This section is to hang the call

  else if (digitalRead(end_key)==LOW) // Check if the hang up key is being pressed
  {
    mySerial.println("ATH");
    while(digitalRead(end_key)==LOW);
    delay(50);
  }
}  

Now Lets see how to handle a incoming call. We will match the number of the incoming call and if it matches to a preset number, then we will hang up the incoming call and revert with the LDR Value. In addition, we will add a simple debug / command interface which will allow us to issue commands directly to the gsm modem using the Serial Monitor.

Here's the Program
/*  Induino R3 User Guide - Program 17.2 - A Simple program to Respond to an Incomign Call
 The Program sends a SMS with the on-board LDR Value if the Call originates from a specific Number*/


#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4);    //RX and TX pins to communicate with GSM module

String number ="xxxxxxxxxx"; // The Authorised Number to which message
String gsm_input = "";

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);
  delay(100);
  // Enable Caller Identification to ensure we are able to get the Caller Number
  mySerial.print("AT+CLIP=1\r");
  delay(100);
}

void loop()
{
  // We use the regular Serial Port for Debugging and Testing Commands Directly using the Serial monitor
  // You can issue serial commands directly from the Serial monitor, ensure you have selected Carriage Return in the Serial monitor
  if(Serial.available()) // Check if there is data available
  {
    String input ="";
    while(Serial.available()) // read the data into a variable as long as the buffer is not empty
    {
      input += (char)Serial.read();
      delay(30);
    }
    // in order to enable the user to test sending messages, when the user enters the text 'ascii' at the end of the message in the Serial monitor 
    //the ascii value for CTRL Z is sent out to the gsm modem
    if(input =="ascii") 
    {
      mySerial.write((byte)0x1A); // The value for CTRL Z
      delay(50);
      mySerial.println();
    }
    else // if the ascii text is not found then we print the input received from the Serial monitor directly to the gsm modem
    {
      mySerial.println(input);
      Serial.println(input);
    }
  }

  // Check data ouput of the GSM modem to identify incoming calls / messagess.
  if(mySerial.available()) 
  {
    String gsm_input="";
    while(mySerial.available()) // read the data into a variable as long as the buffer is not empty
    {
      gsm_input += (char)mySerial.read();
      delay(5);// Playaround with this timing if you have missing serial data / garbled Serial data coming from the GSM modem
    }
    gsm_input.trim(); // Trim all the leading / trailing white spaces from the input
    Serial.print("Printing Trimmed GSM Response : "); // print the input to the serial monitor for debugging
    Serial.println(gsm_input);
    Serial.print("Printing Trimmed GSM Response Length : ");
    Serial.println(gsm_input.length()); 
    
    
    // Check if the Input received frm the GSM modem contains the work "+CLIP", If it contains, it means there is a incoming call
    if(find_string(gsm_input,"+CLIP") ) 
    {
      Serial.println("Incoming Call");
      if(find_string(gsm_input,number)) // Check if the Input received frm the GSM modem contains the Authenticated Number
      {
        Serial.println("Authenticated Call, Sending SMS");
        mySerial.println("ATH"); // Hang up on the incoming Call once We know its a authenticated call
        delay(1000); 
        String msg = "The Current LDR Value is : "; // Compose the outgoing message base
        int val = analogRead(3); // Get the LDR Value
        msg += (String)val; // Convert the LDR value to a String and append it to the message text    
        send_sms(number, msg); // Send sms to the authenticaed number with the ldr value
      }
    }
  }
}

// A Function to send SMS to a given Number 
void send_sms(String Number, String Message)
{
  mySerial.println("AT+CMGF=1"); // Set the Mode as Text Mode
  delay(150);
  mySerial.println("AT+CMGS=\"+91"+Number+"\"");  // Specify the Destination number in international format
  delay(150);
  mySerial.print(Message); // The Message
  delay(150);
  mySerial.write((byte)0x1A);  // End of message character 0x1A : ASCII Equivalent to Ctrl+z
  delay(50);
  mySerial.println();
}


// A Function to locate a given search string in a given base string
boolean find_string(String base, String search)
{
  int len = search.length(); // find the length of the base string

  for(int m = 0; m<(base.length()-len);m++)// Iterate from the beginning of the base string till the end minus length of the substring
  {    
    if(base.substring(m,(m+len))==search) // Check if the extracted Substring Matches the Search String
    {
      return true;        // if it matches exit the function with a true value
    }
  }
  return false; // if the above loop did not find any matches, control would come here and return a false value
}


With the Above program to type a command to the gsm modem, open serial monitor and type in the command and press enter. to send a message us the same instructions however at the end of the message type in 'ascii' this will automatically send a CtrlZ sequence to the gsm modem as per our program.

Next Lets see how to read a incoming SMS from an authorized number and process it. We will see how to look for a text "switch on" perform a controlling activity based on the current state and send a sms response to the authorized number.

Here's the Program
/*  Induino R3 User Guide - Program 17.3 - A Simple program to Respond to an Incomign SMS
 The Program Checks the SMS content for matching text, validates the action request and 
 sends a SMS response to a specific Number*/


#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4);    //RX and TX pins to communicate with GSM module

String response1 = "switch on";
String response2 = "switch off";

int state = 0;

String number ="xxxxxxxxxx"; // The Authorised Number to which message
String gsm_input = "";

String no ="";
String msg ="";

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);
  delay(100);
  // Enable Caller Identification to ensure we are able to get the Caller Number
  mySerial.print("AT+CLIP=1\r");
  delay(100);
  pinMode(13,OUTPUT);
}

void loop()
{
  // We use the regular Serial Port for Debugging and Testing Commands Directly using the Serial monitor
  // You can issue serial commands directly from the Serial monitor, ensure you have selected Carriage Return in the Serial monitor
  if(Serial.available()) // Check if there is data available
  {
    String input ="";
    while(Serial.available()) // read the data into a variable as long as the buffer is not empty
    {
      input += (char)Serial.read();
      delay(30);
    }
    // in order to enable the user to test sending messages, when the user enters the text 'ascii' at the end of the message in the Serial monitor 
    //the ascii value for CTRL Z is sent out to the gsm modem
    if(input =="ascii") 
    {
      mySerial.write((byte)0x1A); // The value for CTRL Z
      delay(50);
      mySerial.println();
    }
    else // if the ascii text is not found then we print the input received from the Serial monitor directly to the gsm modem
    {
      mySerial.println(input);
      Serial.println(input);
    }
  }

  // Check data ouput of the GSM modem to identify incoming calls / messagess.
  if(mySerial.available()) 
  {
    String gsm_input="";
    while(mySerial.available()) // read the data into a variable as long as the buffer is not empty
    {
      gsm_input += (char)mySerial.read();
      delay(5);// Playaround with this timing if you have missing serial data / garbled Serial data coming from the GSM modem
    }
    gsm_input.trim(); // Trim all the leading / trailing white spaces from the input
    Serial.print("Printing Trimmed GSM Response : "); // print the input to the serial monitor for debugging
    Serial.println(gsm_input);
    Serial.print("Printing Trimmed GSM Response Length : ");
    Serial.println(gsm_input.length()); 


    // Check if the Input received frm the GSM modem contains the work "+CMTI", If it contains, it means there is a incoming sms
    // The CMTI response will also contain the message location number for the message recieved. this is the location from where the message
    // has to be retrieved. The message location number is preceeded by a ','
    if(find_string(gsm_input,"+CMTI") ) 
    {
      Serial.println("Incoming SMS");
      int loc = find_char_loc(gsm_input,','); // Find the starting location of the message location number. the message location number is preceeded by a ','
      no = gsm_input.substring(loc+1); // extract the message location number from the CMTI response
      mySerial.println("AT+CMGR="+no);     // send a AT command to the GSM modem to retrieve the message from the given location
    }

    //Check if the Input received frm the GSM modem contains the work "+CMGR", 
    //If it contains, it means this is the message data which we had requested    
    if(find_string(gsm_input,"+CMGR") && find_string(gsm_input,number)) // Check for the authenticated number
    {      
      Serial.println("Authenticated  SMS");   
      gsm_input.toLowerCase();   // convert the gsm input to lower case so that there is no case sensitivity
      if(find_string(gsm_input,response1)) // Check if the message contains the text stored in the response1 variable
      {
        if(state) // check the current state of the device and rewrite the reponse sms accordingly
        {
          msg = "Device is Already ON";
        }
        else
        {
          state =!state;
          digitalWrite(13,state);
          msg = "Device Switched ON";
        }
        delay(1000);
        send_sms(number,msg);// Send the Response SMS
      }
      if(find_string(gsm_input,response2))// Check if the message contains the text stored in the response1 variable
      {
        if(state==0)// check the current state of the device and rewrite the reponse sms accordingly
        {
          msg = "Device is Already OFF";
        }
        else
        {
          state =!state;
          digitalWrite(13,state);
          msg = "Device Switched OFF";
        }
        delay(1000);
        send_sms(number,msg); // Send the Response SMS
      } 

    }

  }
}

// A Function to send SMS to a given Number 
void send_sms(String Number, String Message)
{
  mySerial.println("AT+CMGF=1"); // Set the Mode as Text Mode
  delay(150);
  mySerial.println("AT+CMGS=\"+91"+Number+"\"");  // Specify the Destination number in international format
  delay(150);
  mySerial.print(Message); // The Message
  delay(150);
  mySerial.write((byte)0x1A);  // End of message character 0x1A : ASCII Equivalent to Ctrl+z
  delay(50);
  mySerial.println();
}


// A Function to locate a given search string in a given base string
boolean find_string(String base, String search)
{
  Serial.println("Function Find String!");
  int len = search.length(); // find the length of the base string
  for(int m = 0; m<((base.length()-len)+1);m++)// Iterate from the beginning of the base string till the end minus length of the substring
  { 
     
    if(base.substring(m,(m+len))==search) // Check if the extracted Substring Matches the Search String
    {
      return true;        // if it matches exit the function with a true value
    }
    
  }
  return false; // if the above loop did not find any matches, control would come here and return a false value
}


// A Function to locate a given search character in a given base string and return its position 
boolean find_char_loc(String base, char search)
{
  for(int m = 0; m < base.length();m++)// Iterate from the beginning of the base string till the end minus length of the substring
  {    
    if(base[m]==search) // Check if the character Matches the Search character
    {
      return m;        // if it matches exit the function with the current location value
    }
  }
  return 0; // if the above loop did not find any matches, control would come here and return a zero value
}


A Quick Troubleshooting Tip (If you are having troubles with incoming messages)
Courtesy:  Our Customer Joji Mundakel 
Locate the file SoftwareSerial.h, and in the file, modify the following variable 

 _SS_MAX_RX_BUFF to 128 instead of 64


Thats It For This Part! Enjoy... and feel free to drop us an email with questions you might have -> info@simplelabs.co.in

 Visit www.simplelabs.co.in for more interesting products


31 comments:

  1. I used tat LDR value sending message from via GSM900 connected with Induino R3. but there is no response. connections are given according to your instructions only

    ReplyDelete
  2. Well you need to be specific as to where it fails... kindly go through all the tutorials in the order, learn and give us some debugging info for us to be helpful...

    ReplyDelete
  3. can u give some steps on how to send mms using arduino

    ReplyDelete
  4. hii and Can you show me the connection diagram of "Sim900 and arduino for MMS and SMS"....??

    ReplyDelete
  5. Hi All, MMS would be beyond the scope of this tutorial.

    ReplyDelete
  6. Hi Sir i want to ask, what we should put in here String gsm_input = ""; ,becuse i dont know how to get the system auththentic

    ReplyDelete
  7. And at this part did i need to add +CLIP in the sms when send into gsm to get authentic

    // Check if the Input received frm the GSM modem contains the work "+CLIP", If it contains, it means there is a incoming call
    if(find_string(gsm_input,"+CLIP") )

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Hi sir...How to send a sms to multiple numbers ?

    ReplyDelete
  10. Sir,
    Project No 17_3 is not working. It is giving Function Find String! two times as error if monitored serially. Please help

    ReplyDelete
  11. ..Switch On Switch Off with SMS project 17.3 giving error in boolean find_string..

    ReplyDelete
  12. Hi Prakash,
    tried GSM 900 today and had some problems and solved some. other readers might find it useful
    1. voice call not going on the command ATDxxxx
    added ;(semicolon ) at the end of the number and it worked
    2. the caller identification was not working
    issued the command AT+CLIP=1 and it worked

    ReplyDelete
    Replies
    1. Thanks! Will check and update this part...

      Delete
    2. This comment has been removed by the author.

      Delete
    3. Thanks! Updated the code with the CLIP part! I owe you one on this, this was causing so much chaos! Appreciate it.

      Delete
  13. 3. incoming messages were not read correctly.
    Changed SoftwareSerial.h _SS_MAX_RX_BUFF to 128 instead of 64 and it worked. May need to increase in case of longer messages

    ReplyDelete
    Replies
    1. Thanks Again! Will check and update this part too

      Delete
  14. digital pin 3 and 4 is not a TX and RX pin in Arduino uno, so is it possible to serially communicate GSM with UNO

    ReplyDelete
    Replies
    1. You can still use the pins 3 & 4. We are using Software Serial and any 2 pins can be used for this.

      Delete
  15. How to send SMS through multiple SMS and how to support Hindi sms.pl find out my solution as soon as possible .pl sir..........

    ReplyDelete
  16. How to send SMS to multiple number SMS and how to support Hindi sms.pl find out my solution as soon as possible .pl sir..........

    ReplyDelete
  17. Hi Prakash!
    I am using an Arduino UNO R3 not an induino and I purchased the GSM Modem from the simplelabs website. I have given the connections exactly as you told above. I tried the first gsm tutorial given using buttons. But since i did not have any buttons, I Initiated the sms command when i press "S" in my keyboard.
    i.e. while(serial.available()>0) x=serial.read() if(x=='S')... the sms command as given...
    But i am not getting any sms. Similarly tried the call part using letter "C".. No calls were received in my mobile.
    The network led blinks at 2s delay and the modem beeps if i try to call the sim in it.
    Please help me out!
    Thanks

    ReplyDelete
    Replies
    1. Also, i did not connect anything for the 5v pin in the modem.

      Delete
    2. Hi,

      Try the following. Remove the Atmega IC. Connect the GSM Rx to Rx, Tx to Tx and GND to GND. Power the GSM separately, Open the Serial Terminal and Try sending AT commands directly to the modem. Also make calls to the modem and see if you get responses on the serial terminal. Post your results here

      Delete
  18. I actually connected the wrong tx and Rx pins. I gave them to the drx and dtx pins present near the gnd pin. But the correct ones were lablelled somehwere near the buzzer. So I couldn't find them initially. Now everything works fine.

    Thanks a lot Prakash, for your help and this amazing post. This was very helpful for me as a first time user for using arduino and gsm.

    ReplyDelete
  19. Hi,
    I'm using Arduino uno with SIM908 module. i want to run GSM/GPS module simultaneously. And how to interface arduino with SIM908 for these code lines -

    digitalWrite(3,LOW);//disable GSM TX、RX
    digitalWrite(4,HIGH);//disable GPS TX、RX

    PLZ, help me to come out from problem.

    Thankyou!!

    ReplyDelete
    Replies
    1. I Mean, have to connect pin no. 3 of arduino to RX,TX of SIM908 module to run GSM module. and pin no.4 to Rx,Tx of SIM908 module to run GPS module?

      Delete
  20. can i use GPRS accesspoint facility with induino ?

    ReplyDelete
  21. I am unable to get this.
    pinMode(sms_key,INPUT);
    pinMode(call_key,INPUT);
    pinMode(end_key,INPUT);
    digitalWrite(sms_key,HIGH);
    digitalWrite(call_key,HIGH);
    digitalWrite(end_key,HIGH);
    }

    Firstly they are set high.
    And in loop they are checked for low ? Why ?
    And what does it mean to check is sms_key is pressed?

    ReplyDelete
  22. i want to store the incoming calls or missed call numbers of gsm modem in an array. i am using atmega 32 controller.

    ReplyDelete
  23. The return type for the function "find_char_loc()" should be "int" instead of "boolean" :
    boolean find_char_loc(String base, char search)

    btw excellent tutorial...

    ReplyDelete