Abishai

Providing Smart Technology Solutions

GSM Modem – Sim 300 (Sending Text SMS)

Hi guys, I just arrived from my elder brother’s ring ceremony(thank God for making it successful) & I was thinking on which topic I should write, suddenly my eyes caught the GSM modem kept on the corner of  my desk. So I decided to write about it.

I had the opportunity to work  on GSM modem at the time of my major project in my engineering. My project was “Vehicle Crash Monitoring System”. The motive was to create a device which will automatically detect the accident and call for help at the emergency no..  It is a new idea & I had to work hard on it. I had to use GSM modem for sending text sms on emergency number. Thus it call  for help when it detects the accident of  the vehicle.

For my project, I used SIM 300. This is tri-band, slim and compact so that it could be used in compact devices.  I brought it for Rs.1600 (or 28.8$ approx) from a local shop.

Now about the hardware, it consists of a DB9 port for communicating with the computer or with the micro-controller, a jack for power, a integrated module, a connector and a micro strip antenna , an interface circuit of Max 232. I am also posting the picture of my modem which is shown below.

So, to work with the modem you have to make an interfacing circuit on Max 232, which will convert the ttl logic level from the micro-controller to RS 232 level, which is 9 or 12 volts. But making that circuit was a tedious task for me, so I used another trick. I found out the tx and rx pins of ttl level in Max 232 in the modem & soldered 2 wires from it. Also a 3rd wire  from the ground of the circuit. Then I connected those wires with the respective pins of my micro-controller &  here I was ready to use my modem.

First thing to know before working on any GSM modem is to get familiarized with the “at commands”. Embedded cellular modules(GSM Modems) are mainly controlled by the use of AT commands.  AT or Attention Commands are derived from the Hayes Command set (or AT command set) from 1977 to control the 300-baud Hayes Smartmodem. They are a set of command-language or instructions that are sent to a cellular module to perform different actions. Without AT commands one could not work with the modems.

Here I will show you how to program your micro-controller for sending text message. The essential commands which will be used are:

AT+CMGF=1 // this command will instruct SIM300 module to enter text mode. After giving command you should press enter key or send it ascii 0x0D character.

AT+CMGS=”xxxxxxxxxx” // xxxxxxxxxx is the phone number. after this command press enter or send its ascii 0x0D character through micro-controller.

Now I will show you the code which I used with my arduino for sending  SMS. The code is given below:

// The code is developed by Abishai for sending text message by using Sim300.
void setup(){
Serial.begin(9600); // the GPRS baud rate
delay(2500);

Serial.println(“AT”); //To check if GSM module is working
delay(2000);
Serial.println(“AT+CMGF=1”); // set the SMS mode to text
delay(1500);
}
void loop(){

delay(1500);
Serial.print(“AT+CMGS=”);
Serial.print(34,BYTE); //ASCII of ”
Serial.print(“+919406686543”);
Serial.println(34,BYTE);

delay(1500);
Serial.println(“This is a sms from Abishai ………. just saying hello….”); //this is the message to be sent
delay(1500);
Serial.println(26,BYTE); //Ascii code of ctrl+z to send the message
while(1);
}

You can see the demonstration of one of my project using Sim 300 at the link shown below(actually this video is at the time when I was working on my major project):

Just watch this video:-

Hope you will like my work. Please comment.

237 comments on “GSM Modem – Sim 300 (Sending Text SMS)

  1. Reema
    January 20, 2014

    does anyone have the program code for this project using 89c52 instead of using arduino??
    please reply soon,whosoever has it or can help me out..i’l be really very thankful.

  2. karthik
    February 3, 2014

    sir can u tell me how to connect txd rxd and gnd pins of sim300 to MAX232 to 6 and 7 pins of pins?plzz help me

  3. gauravtalele
    February 4, 2014

    hi Abishai
    i am working on the same project that can send the sms but ur code doesnt working with my kit. i am having the sim 300 and arduino dumilinove so whatcan i do plese suggest

    • Abishai
      February 5, 2014

      Which version of arduino software are you using???

  4. jana
    February 8, 2014

    can u give me the code for send text message using sim900a in AT89C51 microcontroller.???

  5. akash patil
    February 10, 2014

    How to interface it using 8051…????????

  6. dipen
    February 27, 2014

    sir when working with arduino uno and gsm sim 300, is it possible to read the message that is recieved on modem without using gsm initialization part in the arduino code?
    i tried this but was not able to receive message…however i am able to send message without initialization of gsm.
    can u pls post the code for receiving message?

  7. Ankita
    April 7, 2014

    please can i get the circuit diagram and datasheet of this GSM MODULE SIM300. i want to use it for my project. it would be a real help.

  8. Pritam
    April 12, 2014

    hey abiashai,
    My project is Obstacle detection for blind person, in which i am using gps module to find where she/he is? & send a message to a particular mobile , So that his family also knows where is he/she?
    my project is nearly similar to your project, only difference is that i need to use push button to track location instead of pressure sensor.
    so, can you provide your code ?
    Component that i am using is :- Arduino kit, GPS module(SKG 13C) with GPS antenna

    • Abishai
      April 13, 2014

      Very innovative idea Pritam. In your project, you will have to use a GSM modem to send SMS. The code is all in front of you.

      • Pritam
        April 14, 2014

        DO you have any idea of working of GPS module(SKG 13C).

  9. ankit
    April 14, 2014

    sir, basically i am using sim300 and arduino uno . i want to send serial data available as a response msg if i send some sms like “on” to gsm modem

  10. ankit
    April 14, 2014

    plz suggest some code

  11. Pulkit
    April 27, 2014

    Hey, I’m working on the exact same project as you are! The codes provided by Abishai make sense but I’m not able to run them on the new Arduino compiler.

    Have you found any fix for that?
    Pls contact me on pulkitganjoo@gmail.com! We can discuss our progress & help each other.

  12. uday
    July 22, 2014

    is it necessary to recharge the GSM SIM for receiving SMS to user?

    • Abishai
      July 22, 2014

      No Uday, it is only necessary if you want to send SMS through the modem. Receiving SMS is free, so no need to recharge.

  13. sakshi
    August 22, 2014

    sir can you please send out the circuit diagram for GSM Modem. It’s very much required and please send it fast. It will really be thankful.

  14. ashu
    September 5, 2014

    i want an assembly language code for calling and giving missed call to a number using sim300 connected via rs232 through 8051. I have tried ATDXXXX; command and ATH command but i’m not getting the desired result.Please provide me the code or the logic.

  15. grace
    September 21, 2014

    Hey i have failed to get any gsm module i was looking for using proteus isis.could you please help me on that issue

    • Abishai
      September 23, 2014

      Ya sure. I do have some modems available. If you want you can contact.

  16. MuhammadAbidAliShah
    January 8, 2015

    well done

  17. chandra mouli
    January 18, 2015

    this is mouli send code written by u is working……..
    can u give me for sms recive

  18. ram
    February 12, 2015

    Hi abhi Iam interfacing gsm 300 with msp430 g25553 iam receiving msg also but how to display the message as been sent in lcd display

  19. geeta
    March 7, 2015

    Sir can u give me the code for receiving sms to the sim300 board i am unable to get the output

  20. hany
    March 8, 2015

    Is it possible to send the code to gsm mouli any phone number gives you the coordinates of his whereabouts, such as mcc/mnc/lac/ cill id

    • Abishai
      March 9, 2015

      Yes it is possible. You will need to make changes in the program.

  21. siddhant Karmacharya
    March 13, 2015

    can you plz send me the documentation of this project at as soon as possible at sid.karmacharya@gmail.com

    it would help me a lot submitting the fesibilty report to the college as i am looking forward to do my FYP on the samp topic….

    Thank you in advance :):) !!!!!!!!!

  22. ronak bera
    March 25, 2015

    how to connect uC AT89S52 and gsm sim300 module in kail based on android phone through sms

  23. jay
    March 31, 2015

    I have not used Piezo sensor. what changes should i make in the above program. Also i am facing a problem that the network LED remains ON and does not blink. Pls help asap!!!!!!!!!!!!!!!!!!!!!

  24. A_T
    April 12, 2015

    i have run this code but i am receiving blank messages on my phone,although it shows the whole message on serial monitor…please help out??

  25. c
    May 19, 2015

    hi
    can you tell me if i can build gsm sim 300 because i am using it for my wireless led display

    • Abishai
      May 19, 2015

      I don’t think that you can build Sim300 at home. Sim300 modules are available as a small packed circuit. All the tiny components are fitted inside that can not be made with our hands so easily. I have a core module available with me.

  26. Prashant Kumar Paradkar
    August 9, 2015

    Hi,
    is there any way to track the current location of the device without using gps, for ex:by accessing the MCC and MNC and local area code of the SIM number from network operator.

  27. rashmi agrawal
    February 2, 2016

    The GSM modem indeed sends a SMS using at commands but the message received is always empty/blank or shows unreadable signs.Please help me to receive correct send SMS.

    • Abishai
      February 9, 2016

      Sure, what do you want to be written in your text message?

  28. Esra'a
    February 14, 2016

    Does this code work in sim900 ??

    • Abishai
      February 15, 2016

      Yes it will work for sim 900 but you will have to edit a slight.

  29. charan v
    February 17, 2016

    Sir can gsm supports ivrs system.for example when the gsm makes call to customer call then they will tell us to press 1,2,3,5,6 etc can gsm select any one option
    Sir if u have any information about please help me sir

    • Abishai
      February 17, 2016

      Yes it can be done. What is your project?

      • charan v
        February 18, 2016

        Sir can u send me the materials and programs related to that please sir I am in very trouble situation in our college
        Automatic booking system is our project
        Please help me sir

  30. P C Pant
    February 25, 2016

    Sir can you tell me how can I connect a telephone with GSM300 modem as there is a RG socket but no dial tone is available when connect a phone

  31. sridhar
    February 28, 2016

    sir i was doing a gsm based simultion project in proteus software. pls help me to how to send a message to gsm module without hardware interface with pc

  32. veera sridhar
    February 28, 2016

    sir i was doing a gsm based simultion project in proteus software. pls help me to how to send a message to gsm module without gsm hardware interface with pc.

  33. vyshakh
    April 3, 2016

    i have the same problem with sim300
    my project name is baby incubator.
    there is a gsm modue in my project am using ATMEGA16A AVR microcontroller.
    when i check my project using terminal the project is working but when i use sim300 the msg is not receiving. i think the problem is with power.
    bcoz some times the gsm is working properly

  34. subrajit
    May 28, 2016

    hi abishai..i want the program for at89c51 to turn on/off led by sms using gsm module300 and displayed in 16*2 lcd.can u help..its really urgent.

  35. Kapawar Santosh Shrihari
    July 24, 2016

    nice information

  36. rawkstargirl
    August 23, 2016

    sir, which part to edit if using sim900??

  37. urooj
    October 22, 2016

    yes even i want to know that which part have to edit for sim900???

  38. sandeep kc
    November 1, 2016

    void setup(){
    Serial.begin(9600); // the GPRS baud rate
    delay(2500);

    Serial.println(“AT”); //To check if GSM module is working
    delay(2000);
    Serial.println(“AT+CMGF=1”); // set the SMS mode to text
    delay(1500);
    }
    void loop(){

    delay(1500);
    Serial.print(“AT+CMGS=”);
    Serial.println(34,HEX); //ASCII of “
    Serial.print(“+919048167356”);
    Serial.println(34,HEX);

    delay(1500);
    Serial.println(“This is a sms from Abishai ………. just saying hello….”); //this is the message to be sent
    delay(1500);
    Serial.println(26,HEX);
    while(1);
    }

    while running this program

    error occurs
    and the error message is ” stray ‘\342’ in program”

    and my arduino board is ATmega328

    • JYOTHISH
      March 4, 2017

      I also have the same problem, I am using ATMEGA 2560, Please give me a solution.

  39. sriram
    January 13, 2017

    i am working on the same project that can send the SMS but ur code doesnt working with my kit. i am having the sim 300 and arduino dumilinove so whatcan i do please suggest also send code

  40. Rahul Vishwakarma
    February 10, 2017

    sir as many other my question is same that i am receiving blank sms on my phonebut whole sms is printing on serial monitor. please help me sir whats the problem is?

    • Abishai
      March 5, 2017

      Yes, I read so many comments complaining about text message not sent. I would encourage you to check the baud rate of the GSM module. And if you are using a module other than SIM300, then it’s better to go through the AT commands for that specific module which might significantly differ from SIM300’s AT commands. Other reason might be that the updated serial library or the updated Arduino IDE might need some modification for my old code!

  41. mohamad syamim
    April 2, 2017

    Hi abishai…what type of sensor you are using to detect the impact?thanks

    • Abishai
      April 7, 2017

      I used a piezoelectric sensor to detect the impact, which is obtained from a piezoelectric buzzer. Piezoelectric crystal has a property of generating voltage when subject to mechanical force.

  42. GANESH KARABALWAD
    April 12, 2017

    sir can you just send the code for receiving the message we need it

  43. GANESH KARABALWAD
    April 12, 2017

    and again can you just help us to interfacing fingerprint sensor with arduino
    to get message if fingerprint fails 3 times

  44. naziruddin
    January 26, 2018

    +CME ERROR: unable to get control of required module means what is the solution

  45. debash
    March 22, 2018

    Program is not working..can you please help me !!!

    Thank you

    • Abi
      March 23, 2018

      Hey Debash, what is the error message? I wrote the code few years back and since then these libraries have been updated.

      • debash
        March 23, 2018

        Thank you sir for replying.
        Actually i tried HEX command instead of BYTE and i was able to compile the program…in serial monitor i am getting 22 infront of my mobile number and 22 infront of my message….and i am not getting message in specified number…thank you

      • debash
        March 23, 2018

        I am getting 22 before my number and message in serial monitor but i am not receiving any sms in my phone.i used HEX instead of BYTE as program was not compiling….can u please help me out….thank you

Leave a reply to sakshi Cancel reply

Information

This entry was posted on June 3, 2012 by in Uncategorized.
Arduining

Physical Computing Mini-Projects

Abishai

Providing Smart Technology Solutions