Old Mobile Phone GSM Sim900 - New Message Notification

Ok . Now this setup will able to clean up or delete all the message inside simcard once it power up and able to notify you when there is a new message coming in . No special reason why i need to clear up all sms in the simcard every time it power up , just i scared the incoming sms will not come in if the storage is full . So i decided to clear the sms storage first every time its power up .

You may download the full code first before we proceed further . I will not go through each line with you . You may ask me on the comment section on which part you need more explanation .

Full code :  tutorial3_newSmsNotification.zip

Extract the file and open the program .

-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

Before we proceed further , here is the add-on AT+Command that will be use in this tutorial :

AT Command Sent to SIM900 : +CMGDA="DEL ALL"
Function : Delete all message

AT Command Receive from SIM900 : +CMTI: "SM",n
Function : Notify arduino if there is a new message coming in . 'n' in the at command will be represent by number of new unread message .

-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

You will noticed that there is a new line of code in the void setup . This line will sent AT command to sim900 which is to delete all the message in the memory . This is important to avoid conflict in our incomplete old mobile phone program . Delete all sms first before it go to void loop ( ) : D


-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------



So this line will call checkATcommand function from below in order to check whether there is AT command receive from software serial pin . If there is +CMTI: "SM",n receive at software serial pin, this checkATcommand will pass 'n' to the variable answer and print it on the LCD.

At this line, any data received at software serial pin will be compare with SM" . If the comparison is true , then "should be" the next data must mostly be 'n' which later will be passed to variable answer.

-------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------

Done. Feel free to comment if you see any major fault or anything you did not understand or anything that you want me to edit or add up something. Just comment it below. See you soon on next tutorial. Done for new message notification : D Hopefully we can start to read a text message in next tutorial : D

No comments:

Post a Comment