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.
Please visit Sending or Receiving SMS using GSM module (contd.......) or click here for receiving portion.
This is about sending sms.But what about receiving a message??
ReplyDeleteThrough 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
Delete1) 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.
Thanks for your reply.It will be much helpful if you provide the code for dual communication.
DeleteSending And Receiving Sms Using Gsm Module >>>>> Download Now
Delete>>>>> 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
It would be my pleasure helping you with a code for dual communication. Thank you for patience.
ReplyDeleteI'm looking forward to it. Thank you in advance!
ReplyDeletei want to interface GSM with Cortex ARM-4 can you please help me....?
ReplyDeleteHow can I do that?
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.
ReplyDeleteIm 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.
ReplyDeleteHelloo sir
ReplyDeletecan u provide code for Arduino uno(EEPROM) and fingerprint module and gsm module
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.
ReplyDeleteCoolUtils Total Audio Converter Crack
Appreciation is a wonderful thing...thanks for sharing kepp it up. Azkapc.com
ReplyDeleteUmmy Video Downloader Crack
Davinci Resolve Studio Crack
iMyFone LockWiper Crack
CyberGhost VPN Crack
PassFab iPhone Unlocker Crack
Sending And Receiving Sms Using Gsm Module >>>>> Download Now
ReplyDelete>>>>> 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