Skip to content
Embedded World – Anything about Embedded Systems design and development
  • About
  • Embedded
  • Android
  • Project Ideas
    • Embedded Projects
    • MATLAB Projects
    • DSP Projects
  • Search Parts
  • Web

Using Arduino with SIM900/SIM800 for receiving SMS commands

July 10, 2019 222-using-arduino-with-sim900-sim800-for-receiving-sms-commands

The logic is quite simple, We just look for consecutive occurrence of commads like @C1, @C2 or CMD. Whenever the if condition is satisfied the code can take an action like turning ON or OFF a device which might be useful in building automation application for example.

This code is applicable for SIM800,SIM808,SIM908,SIM800C,SIM800H,SIM900A etc all modules as AT commands remain the same.

For more in depth explanation of the concept or live demo look at this video,

 


  ARDUINO CODE: 
     unsigned char Buff[250];   unsigned char BuffIndex;   void setup()   {     Serial.begin(9600);     Serial.println("GSM Tutorial, Valetron Systems @raviyp.com ");     delay(3000);     Serial.println("AT+CMGF=1");     delay(3000);     Serial.println("AT+CNMI=2,2,0,0,0");     memset(Buff, '', 250); // Initialize the string     BuffIndex=5;   }         void loop()   {         while(1)       {           if(Serial.available()>0)           {               Buff[BuffIndex] = Serial.read();                          if( (Buff[BuffIndex-2] == '@') && (Buff[BuffIndex-1] == 'C') && (Buff[BuffIndex] == '1'))               {                   Serial.println("Command 1");               }               if( (Buff[BuffIndex-2] == '@') && (Buff[BuffIndex-1] == 'C') && (Buff[BuffIndex] == '2'))               {                   Serial.println("Command 2");               }               if( (Buff[BuffIndex-2] == 'C') && (Buff[BuffIndex-1] == 'M') && (Buff[BuffIndex] == 'D'))               {                   Serial.println("Command CMD");               }                                     BuffIndex++;               if(BuffIndex>250)               {                   BuffIndex=5;               }           }       }           }

Also see:

  • SIM800 series Bluetooth AT commands
  • Footprint compatible 2G, 3G, 4G modules for using in your M2M designs
  • 868 MHz frequency is not license free in India – LoRa in India
  • SIM900/SIM800 not working – Possible reasons – Tips n Tricks

 

 

PrevNext

Connecting SIM300 GSM modem to a 5V microcontroller…

Connecting SIM300 GSM modem to a 5V microcontroller
SIM300 GSM modem operates at voltages from 3.6V to 4.5V. Most of the microcontrollers we use operate…

Read more

Online compilers for C,C++,JAVA,PERL,HTML,PHP, PYTHON

Online compilers for C,C++,JAVA,PERL,HTML,PHP, PYTHON
I wanted to compile my source code written in Visual C++ and get an executable file. But i was too l…

Read more

Keil : function “assert_param” declared implicitly [Solution]

Keil : function "assert_param" declared implicitly [Solution]
When i migrated my code from IAR to Keil v5 for STM32F0 ARM cortex M0 series, The whole STD_PERIPHER…

Read more

Arduino DTMF tutorial using SIM900/SIM800 modules – LIVE…

Arduino DTMF tutorial using SIM900/SIM800 modules - LIVE DEMO
In this post we will see and understand how we can use the DTMF feature of SIM900 /SIM800  GSM modul…

Read more

Using Arduino with SIM900/SIM800 for receiving SMS commands…

Using Arduino with SIM900/SIM800 for receiving SMS commands
In this post i will be showing you how to write a simple piece of code using Arduino for SIM900 or S…

Read more

Difference between SIM908 vs SIM808 modules

Difference between SIM908 vs SIM808 modules
This article gives a brief description of the difference between SIM908 and SIM808 GSM/GPS modules. …

Read more

L293D motor driver-Working and Programming Logic

L293D motor driver-Working and Programming Logic
L293D H-bridge driver is the most commonly used driver for Bidirectional motor driving applications….

Read more

Low cost GSM/GPRS modules for purchase in India…

Low cost GSM/GPRS modules for purchase in India
Looking for a low cost GSM module for using in your projects?. Here are a few GSM modules which I ca…

Read more

Getting Network Location using SIM900 GSM modules

Getting Network Location using SIM900 GSM modules
In this article we will see how we can retrieve the cell location or network location of the SIM900 …

Read more

SIM900/SIM800 not working – Possible reasons – Tips…

SIM900/SIM800 not working - Possible reasons - Tips n Tricks
The thing with SIM900/SIM800 is there can be multiple reasons that the AT commands are not working,
…

Read more

Low cost Arduino boards for purchase in India…

Low cost Arduino boards for purchase in India
If you are looking to buy a cheap low cost Arduino board in India, here is a compiled list of Arduin…

Read more

Designing a Low cost GSM/GPS tracker – SMS…

Designing a Low cost GSM/GPS tracker - SMS Tracking Demo -  Part 3
Last week the assembled boards have finally arrived and in no time I was able to get the VALTRACK-V2…

Read more

Calculating the range of a Wireless device

Calculating the range of a Wireless device
I was looking for a RF transceiver with good RF range for using in my project. But, when i looked at…

Read more

Code Refactoring

Code Refactoring
“Process of changing a software system in such a way that it does not alter the external behavior of…

Read more

SIM868 vs SIM808 – Differences and Comparison |…

SIM868 vs SIM808 - Differences and Comparison | Which to choose?
In this post we will learn the differences between the old GSM+GNSS enabled combo modules SIM808 and…

Read more

blog comments powered by DISQUS back to top

Post navigation

Previous: Conveyer belt automatic bifurcation system
Next: Designing a 3G Foaling Alarm and GPS tracker

Recent Posts

  • 5G deployment opportunities for developers
  • Designing optimized embedded systems
  • Microcontroller testing and game tactics
  • Choosing the right gsm module for IoT
  • Evolution of GSM and 5G communication
Copyright © 2022 Valetron Systems