This article describes the AT commands for reading, sending and deleting SMS from the SIM900 GSM modem inbox. Before you send any SMS or CALL command to the SIM900 modem via the UART interface after power up, wait for the CALL READY message from the SIM900.

The CALL READY message from the SIM900 indicates that the modem is powered up and has acquired a valid network. Next thing is to make sure you have set the SIM900 into TEXT mode by sending the command AT+CMGF=1; followed by a carriage return(\r\n).

If you are facing any problem with respect to modem not responding to commands read my previous article to solve it.. it applies to SIM900 problems too. 

Reading a SMS message from the Inbox:

  • To read the first SMS from the inbox send the command AT+CMGR=1 followed by \r\n. The modem will reply with the text of the first SMS in the inbox along with senders mobile number and date and time.
  • To read the second SMS from the inbox send the command AT+CMGR=2 followed by \r\n. The modem will reply with the text of the second SMS in the inbox along with senders mobile number and date and time.

... and so on. The maximum number of SMS messages in the inbox depends on the SIMCARD you have put in the modem.

  • To read all the SMS messages from the inbox send the command AT+CMGL=ALL followed by \r\n.  The modem will reply with the text, senders number, timestamp of the all the messages in the inbox in one shot. 

Sending SMS message from SIM900:

  • To send SMS from SIM900 send the command AT+CMGS=9900243245 followed by /r/n and then the message text and then the ascii code of Ctrl^Z character which is 0x1A

ex: To send "Hello" to 9900243245 mobile number

AT+CMGS=9900243245 followed by \r\n 

Hello

Ctrl^Z ascii code 0x1A followed by \r\n (Ascii code for \n is 0x0A and Ascii code for \r is 0x0D)


Deleting a SMS message from the Inbox:

  • To delete the first message from the inbox send the command AT+CMGD=1 followed by \r\n. The modem will delete the first message in the inbox.
  • To delete the second message from the inbox send the command AT+CMGD=2 followed by \r\n. The modem will delete the second message in the inbox.

... and so on. The maximum number of messages in the inbox depends on the SIMCARD you have put in the modem.


Calling to a number using SIM900:

  • To call to a number send the command ATD followed by the mobile number and carriage return ,

To call the mobile number 9900243245 send the command as,

ATD9900243245 \r\n


Hanging up a call in SIM900:

  • To hang up a ringing call or a call in progress send the command ATH; followed by carriage return

ATH\r\n


Recieving a call in SIM900:

  • To receive a ringing call, Send the command ATA; followed by carriage return

ATA\r\n

 


Finding the number of the incoming call in SIM900:

  • To get the number of the incoming call you need to enable the Caller Line Identification in SIM900.
  • To enable the incoming caller line identification issue the command AT+CLIP=1 followed by carriage return

AT+CLIP=1\r\n  

Once you issue this command, any incoming call will be notified in the following format,

RING

+CLIP:+9916258273

Here +9916259273 is the number of the incoming call. 

Click on below Image to Watch the video for Live demonstration of the above commands: 

 

 

 




About the Author

is the author of this blog and is an Embedded systems design engineer by profession & Founder @ Valetron Systems Pvt Ltd


Email:This email address is being protected from spambots. You need JavaScript enabled to view it.

Find us on Google+

HIRE ME FOR YOUR PROJECT AS A FREELANCER

 

EasyEDA: Free Circuit Design Software

  • Easy Schematic Capture
  • Powerful Circuit Simulation
  • Online PCB design

Design Your Circuit and PCB here:

https://easyeda.com/editor

Cheap PCB Manufacturing

Electronic Components Online Store