pcbway

receive sms sim900 and pic, pic microcontroller sms receiving,receive sms with pic and sim,Receive SMS with AT Commands using Sim900 & PIC MicrocontrollerHello friends, I hope you all are fine and having fun with your lives. Today, I am going to share a new project which is Receive SMS with Sim900 & PIC Microcontroller using AT Commands. I have already posted this same project on Arduino named as Receive SMS with AT Commands using Sim900 & Arduino. In that project, I have interfaced SIM900 module with Arduino but today I am gonna interface it with PIC Microcontroller.

I have also designed a GSM Library for Proteus using which you can easily now simulate your SIM900D module in Proteus. Sim900 Module is used to send and receive SMS and it is widely used in automation and security projects. I have also posted another Project in which I have designed the Proteus simulation of GSM based Home Security System. I have already posted the Send SMS with PIC Microcontroller & SIM900 project in which we have seen How to send SMS from your GSM module to your mobile phone but today we will send SMS from our mobile phone and then will receive this SMS on the SIM900 module and will perform certain action. Forexample you want to turn your Light ON using GSM then what you need to do is to send SMS from your mobile to SIM900 module and when it receives the message, it will do the required task. Moreover if you are working on Sending SMS instead of receiving then you should have a look at How to Send SMS with PIC Microcontroller & SIM900d and if this sending is via Arduino board then there’s How to Send SMS with Arduino and Sim900.

I have used PIC18F452 for this project but you can use this code for any PIC Microcontroller but it has to support the serial port. Moreover, I have used MikroC Pro for PIC Compiler to design code for receive SMS with AT commands using SIM900 & PIC Microcontroller. So, let’s have a look at How to Receive SMS with Sim900 & PIC Microcontroller using AT command.

Receive SMS with Sim900 & PIC Microcontroller

  • SIM900 module works on Serial Protocol. If you don’t know much about Serial Port then you should read What is Serial Port?
  • In serial Port we have two pins for communication, one is named as TX (transmitting) and other as RX (receiving).
  • In order to Receive SMS with Sim900 & PIC Microcontroller using AT command, connections are exactly the same as we did in Send SMS with PIC Microcontroller & SIM900.
  • The SIM900 module I have used for receiving SMS is shown in the below figure:

receive sms sim900 and pic, pic microcontroller sms receiving,receive sms with pic and sim,Receive SMS with AT Commands using Sim900 & PIC Microcontroller

  • If you have a different GSM module then there’s no need to get panicked because most of the GSM modules work on Serial protocol so what you need to do is to simply find the TX and RX pins of your SIM900 module.
  • As you can see inthe above SIM900 image that it has TX and RX Pins so you all need to find these pins on your SIM900 module and then connect them with RX and TX pin of your PIC Microcontroller.
    • RX pin of Sim900 into Pin # 25 (TX) of PIC Microcontroller.
    • TX pin of Sim900 into Pin # 26 (RX) of PIC Microcontroller.
  • Moreover, you will also need to common the GND of SIM900 and PIC Microcontroller, if you are using separate power supplies for PIC Microcontroller and SIM900.
  • One more thing you will also need the basic circuit of PIC Microcontroller, which is as follows:

receive sms sim900 and pic, pic microcontroller sms receiving,receive sms with pic and sim,Receive SMS with AT Commands using Sim900 & PIC Microcontroller

  • Here’s my design for How to Receive SMS with Sim900 & PIC Microcontroller using AT command on Vero Board:

receive sms sim900 and pic, pic microcontroller sms receiving,receive sms with pic and sim,Receive SMS with AT Commands using Sim900 & PIC Microcontroller

  • The above hardware design on Vero Board is exactly the same and I have done the connections of my SIM900 module with PIC Microcontrolelr on the back side.

Note:

  • The TX Pin of PIC Microcontroller will be connected with RX Pin of GSM Module.
  • The RX Pin of PIC Microcontroller will be connected with TX Pin of GSM Module.
  • GND of both GSM and PIC Microcontroller must be common.
  • Now upload the hex file of the below code in your PIC Microcontroller so that we can Receive SMS with Sim900 & PIC Microcontroller using AT command.

  • The above code is quite self explanatory but let’s have a quick explanation of this code for How to Receive SMS with Sim900 & PIC Microcontroller using AT command.
Code Explanation
  • This code is designed in MikroC Pro For PIC Compiler and its written for PIC18F4520 but you can use it with any PIC Microcontroller which supports Serial Port.
  • I have shown the working of the code in a block diagram in below figure:

receive sms sim900 and pic, pic microcontroller sms receiving,receive sms with pic and sim,Receive SMS with AT Commands using Sim900 & PIC Microcontroller

  • In this code I am using three functions other than the main function, named as:
    • Config();
    • RecSMS();
    • ClearBuffers();
  • First of all, I have used the Config() function, which is doing the Configuration settings of our GSM Module.
  • In these configurations, I am making the Echo OFF and also converting my GSM modem to text messages.
  • In the RecSMS() function, I am checking for +CMT, once its received then I have extracted the SMS body and the mobile number from it.
  • In the ClearBuffers() function, I am clearing all the variables so that we can receive the next SMS.

So, that’s all for today. I hope you guys are gonna enjoy this project How to Receive SMS with Sim900 & PIC Microcontroller using AT command. So, will meet you guys in the next tutorial. Till then take care and have fun !!! 🙂

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment