Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Hackster is hosting Impact Spotlights: Smart Home. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Smart Home. Stream on Thursday!
SetNFix
Created July 10, 2019 © Apache-2.0

SIM800L GPRS Module with SMS Activated Devices

This is a project to advance thinking of sim 800l module. You can use the module as remote controller to operate devices.

AdvancedFull instructions provided312
SIM800L GPRS Module with SMS Activated Devices

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Gboard Pro 800 SIM800 GSM / GPRS Module 3.3v ATmega2560 Mainboard For Arduino Starter
Itead Gboard Pro 800 SIM800 GSM / GPRS Module 3.3v ATmega2560 Mainboard For Arduino Starter
×1
Power Relay, SPDT
Power Relay, SPDT
×1
Bipolar - RF Transistor, NPN
Bipolar - RF Transistor, NPN
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter
Servo Motor, Premium Male/Male Jumper Wires
Servo Motor, Premium Male/Male Jumper Wires

Story

Read more

Schematics

Wiring With Sim 800l

Connecting Arduino with sim 800L module

Code

Code

Arduino
Upload this code to arduino. do not forget to download the library file
#include <SoftwareSerial.h>
#include <Sim800l_EM.h>
Sim800l Sim800l;
unsigned long bauds = 9600;



String SMScontain; // SMS contain only
String SMSsender; // SMS sender's Name
String text; // Detail SMS 
String ReadTXT ="Test" ;
int NUMSMS; //SMS storage
long MSGlen;
uint8_t SMS_QTY;
String dt;
uint8_t index=1;
bool error;
String ReadMsg;
int LEDPIN = 12;






void setup(){
  Serial.begin(bauds);  
  pinMode(LEDPIN,OUTPUT);
  Sim800l.begin(); 
  delay(5000);
  Serial.print("Ready to Work");
}


void loop(){
//-------------------------------------------------------------
// Get SMS storage amount -------------------------------------
//-------------------------------------------------------------
Sim800l.AT();
delay(500);

int NUMSMS = Sim800l.getCountsms();

if (NUMSMS !=0 ){

//-------------------------------------------------------------
  
  SMScontain = Sim800l.readMSG(index); // Filter SMS contain
  SMScontain.trim();
  text = SMScontain;
  delay(1000);
  ReadTXT = text;
//-----------------------------------------------
 //===============================================
   if (text.length() > 0){ // GET SENDER NUMBER 
 //===============================================

    SMSsender = Sim800l.getNumberSms(index);
    SMSsender =SMSsender.substring(0,12);
    SMSsender.trim();
    //Serial.println(SMSsender.length() );
    Serial.println(text);
    Sim800l.delAllSms();
 //  SMSsender = "+12345678910" // If you want to get fead back to a perticular number
//-----------------------------------------------
// FILTER MSG CONTAIN----------------------------
//-----------------------------------------------  

if (SMScontain.length() > 0){
//Serial.print("SMSsender: ");
//Serial.println(SMSsender);
Serial.print("SMS : ");
Serial.println(SMScontain);
}
//----------------------------------------------

}  //===============================================

} // END ------------------------------------>


//*************************************************
//ON OFF by SMS ----------------------------------
//*************************************************

if (SMScontain == "ON"){
digitalWrite(LEDPIN,HIGH);
error=Sim800l.sendSms(SMSsender,"Switch ON"); // Active if you want a feadback
delay(500);}
else if (SMScontain == "OFF"){
digitalWrite(LEDPIN,LOW);
error=Sim800l.sendSms(SMSsender,"Switch OFF"); // Active if you want a feadback
delay(500);}
//*************************************************


//Clear Data
SMSsender ="";
SMScontain=""; 
text="";


} //END Void Loop

Credits

SetNFix
17 projects • 35 followers
I am an accountant in profession but, I would more prefer to work with electronics based innovations.
Contact

Comments

Please log in or sign up to comment.