SIM900

How to use GSM module with Arduino

Arduino

What is GSM Module?

GSM module is used for send/receive SMS, USSD, Call and Data service over GPRS. We used SIM900 in this tutorial, which is easy to inteface with Arduino using serial interface. Arduino will operate SIM900 using AT command

.SIM900

Where can we use this?

we can use this for vehicle tracking, home appliance control, connect devices with internet, GSM network monitoring, SMS Alert in Home security system.

How to connect with Arduino?

Connect Digital Pin 7&8 with Arduino. Common the ground.

GSM-Arduino-Connect-1

 

Check the below image

GSM-ArduinoConnect-2

GSM-ArduinoConnect-3

connect 2 jumper shown in the first picture. Software serial pin are connected with pin 7 & 8.

Code

#include <SoftwareSerial.h>

SoftwareSerial GPRS(7, 8); //Digital Pin 7 = TX, Digital Pin 8 = RX
unsigned char simmbuffer[64];
int bindex=0;

void setup(){
GPRS.begin(19200);
Serial.begin(19200);
Serial.print(“Serial ready”);
}

void loop(){
if (GPRS.available()){
while(GPRS.available()){
simmbuffer[bindex++]=GPRS.read();
if(bindex == 64)break;
}
Serial.write(simmbuffer,bindex);
for (int i=0; i<bindex;i++){
simmbuffer[i]=NULL;

}
bindex = 0;
}
if (Serial.available())
GPRS.write(Serial.read());
}

 

Set like below in Serial monitor interface

Serial-monitor

 

For details hands on please check the below video tutorial

 

20 comments

Leave a Reply