How to use GSM module with 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
.
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.
Check the below image
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
For details hands on please check the below video tutorial
20 comments
Hey, would you be able to post more detail on the code used in the video?
hI,
tHANKS FOR THIS ARTICLE AND CODE
helo sir, can i have your full source code for this project? or gprs/gps/gsm car tracking system project? email at mybestfart123@gmail.com or can you give me your contact no. because this is urgent. tq in advance.
iatltdbd@gmail.com
I think the issues are related – flat characterization and flat dramatic effect. I used Hugo to highlight the issue by means of ex&mtres.Clarke#8217;s Childhood’s End being the extreme of emotional deadness on one end, and Hugo being at the other extreme. And, on average, science fiction is closer to Clark than Hugo. I would like to see it a little more in Hugo’s direction. Was no one else appalled at the technical dryness at which Clark disposed of humanity?
hello i need your help can u give me your mail id
iatltdbd@gmail.com
whoah this weblog is magnificent i really like studying your posts. Keep up the good paintings! You realize, many individuals are hunting around for this inmrtfaoion, you could help them greatly.
When I try to upload the code to my arduino I just get a bunch of errors.
hello sir. can you help me for the error of my gsm module and my arduino. because still the error says that the sim900 doesn’t response. check power and serial pin in gsm.cpp.. but my power supply is good. and my connection is same as yours.. how can I fix this? please help me.. florieranara04@gmail.com
Good day Mr rkichu, I sent you a mail concerning issues I am having with a similar board to yours, please check and reply me. my mail is getarduinogh@gmail.com. thanks
helo sir, can i have your full source code for this project? or gprs/gps/gsm car tracking system project? email at ehsan9689@gmail.com or can you give me your contact no. because this is urgent. tq in advance.
thanks a lot! your article was very useful!
My question is that i connected the gsm module directly to the arduino and the power light comes on but the netlight and status only stays on for a few seconds before going off. I thought the issue was with the network strength but now i’m thinking the arduino cant provide up to the 2A that the gsm module requires …… is this the case? and if so can i provide the 2A current via adding another component to the circuit because my project is powered with the arduino but i don’t want there to be two power adapters required to power the project.
Hi Damola, i have the same and exactly problem that you describe. Could you find a way to solve the netlght and status gone off after a few seconds?
thnks!!
Hello Sir, can I get the full code please..thanks in advance..my email is ronnie.rocky@yahoo.com
Thanks for the explanation!
Your code should be changed such that ‘*’ can be used in place of ctrl-z for sending sms through the serial monitor:
if (Serial.available())
{
byte b = Serial.read();
if (b == ‘*’)
GPRS.write(0x1a);
else
GPRS.write(b);
}
Also, it’s not explicitly stated in your video, but the GSM module will not respond if the serial monitor is set to ‘No line endings’. It works with ‘Both NL & CR’.
thanks for shearing , can you give us example mega
thanks
Comments are closed.