Sending and Receiving SMS using GSM module

Hello everyone!
Hope you are being benefited from the information which I shared with you. Many of you have been working with the GSM based projects whether it is for home automation, automation, tracking and the list goes on. With the view to help everyone having problem working GSM we prepared a video for Sending and Receiving SMS with GSM module available on YouTube or you can see below.



With the target to help with the code we have shared it with you through this. All the steps are crystal clear as the video provides. We have arduino mega 2560 and GSM 900 module. The transmitter and receiver of the arduino is connected to the vice-versa of GSM module. The Ground is made common. Set the baud rate 2400 since 9600 is too high that does not support.

The code consists of AT commands (Click to download pdf of AT Command Reference) for receiving and sending SMS using GSM. 

The code used is shown below with the different probable conditions:

1) If you want to run your GSM code only once then use the program

void setup() 
{
  // put your setup code here, to run once:
  Serial.begin(2400);  //Baud rate of the GSM/GPRS Module 
  Serial.print("\r");
  delay(1000);                  
  Serial.print("AT+CMGF=1\r");    
  delay(1000);
  Serial.print("AT+CMGS=\"+xxxxxxxxxxxxx\"\r");    //Number to which you want to send the sms     with country code
  delay(1000);
  Serial.print("message from gsm module\r");   //The text of the message to be sent
  delay(1000);
  Serial.write(0x1A);
  delay(1000); 
}

void loop() 
{
//enter your program;
}

2) If you want it to run repeatedly then use the program 

void setup() 
{
//enter setup information
}

void loop() 
{
  // put your main code here, to run repeatedly:
  Serial.print("\r");
  delay(1000);                  
  Serial.print("AT+CMGF=1\r");    
  delay(1000);
  Serial.print("AT+CMGS=\"+xxxxxxxxxxxxx\"\r");    //Number to which you want to send the sms
  delay(1000);
  Serial.print("message from gsm module\r");   //The text of the message to be sent
  delay(1000);
  Serial.write(0x1A);
  delay(1000); 
}

3) If you want to create different data for the GSM and transfer different SMS at different conditions then use the program 

void setup() 
{
//enter setup information
}

void gsmsetup1() 
{
  // put your setup code here, to run once:
  Serial.begin(2400);  //Baud rate of the GSM/GPRS Module 
  Serial.print("\r");
  delay(1000);                  
  Serial.print("AT+CMGF=1\r");    
  delay(1000);
  Serial.print("AT+CMGS=\"+xxxxxxxxxxxxx\"\r");    //Number to which you want to send the sms     with country code
  delay(1000);
  Serial.print("message from gsm module\r");   //The text of the message to be sent
  delay(1000);
  Serial.write(0x1A);
  delay(1000); 
}

void loop()
{
  gsmsetup1(); //call gsmsetup1
}

You can add number of different setups and call it on the loop.

All these are tested and they worked absolutely great. Hope this was a wealthy information and you enjoyed it. Many of you might have already viewed and subscribe my channel and requested for code and if you don't have please do like, share, comment and subscribe. Any problems feel free to drop it down.

Please visit Sending or Receiving SMS using GSM module (contd.......) or click here for receiving portion.

Comments

  1. This is about sending sms.But what about receiving a message??

    ReplyDelete
    Replies
    1. Through this you can send through the GSM and receive on your device but if you are trying to make a dual communication i.e receiving to the GSM then on the program all you need to do is
      1) input the condition or compare the data you want your gsm to perform (i.e. gsm to gsm or mobile to gsm or gsm to mobile to gsm)
      2) the mobile number that is used by your GSM shield will be the receiving
      3) few further changes if you wish to make
      4) Now,you can perform dual communication

      Hope it was helpful and your query was answered. If you are still confused then I will very soon provide you with the dual communication code too. Do subscribe.

      Delete
    2. Thanks for your reply.It will be much helpful if you provide the code for dual communication.

      Delete
    3. Sending And Receiving Sms Using Gsm Module >>>>> Download Now

      >>>>> Download Full

      Sending And Receiving Sms Using Gsm Module >>>>> Download LINK

      >>>>> Download Now

      Sending And Receiving Sms Using Gsm Module >>>>> Download Full

      >>>>> Download LINK n0

      Delete
  2. It would be my pleasure helping you with a code for dual communication. Thank you for patience.

    ReplyDelete
  3. I'm looking forward to it. Thank you in advance!

    ReplyDelete
  4. i want to interface GSM with Cortex ARM-4 can you please help me....?
    How can I do that?

    ReplyDelete
  5. I need to switch on 13 pin LED via a SMS can you please help me on it. Eg if i send a SMS mention #ON switch on 13 Pin LED and if i send a SMS #OFF switch off 13 pin LED. Simply control arduino output via SMS. Am using GSM A6 Module.

    ReplyDelete
  6. Im using GSM MODULE SIM800l. How to set switch ON/OFF an ULTRASONIC and LED. Example if I send sms just text #ON to switch ON the ULTRASONIC and LED and if I send a sms #OFF switch off ULTRASONIC and LED . I want to control arduino via SMS.

    ReplyDelete
  7. Helloo sir
    can u provide code for Arduino uno(EEPROM) and fingerprint module and gsm module

    ReplyDelete
  8. Nice information provided by you, it really helped me to understand this topic. I have also referred this article to my friends and they also enjoyed this informative post.
    CoolUtils Total Audio Converter Crack

    ReplyDelete
  9. Sending And Receiving Sms Using Gsm Module >>>>> Download Now

    >>>>> Download Full

    Sending And Receiving Sms Using Gsm Module >>>>> Download LINK

    >>>>> Download Now

    Sending And Receiving Sms Using Gsm Module >>>>> Download Full

    >>>>> Download LINK Pn

    ReplyDelete

Post a Comment

Popular posts from this blog

CYBER GHOST VPN 6 FULL PREMIUM VERSION

Sending and Receiving SMS using GSM module (contd...)