top of page
Search
Writer's pictureGenius BRO!!

GSM MODULE



GSM MODULE


SIM800L is a nice and inexpensive GSM breakout board. We will set it up with Arduino and send simple text messages. The library can of course be used to do more things like calls etc., We will focus on setting the module the right way because you'll have to take care of a few things like power and reset.




WIRING


l hook up the SIM800l module with Arduino using the Soft Serial library. We will connect the Hardware serial port to the computer to debug and print messages.


Power

Note that the module requires voltage in the range of 3.17 to 4.4v . If proper voltage is not provided the module will give under and over voltage warnings. Hence we used a 3.7v LiPo battery. You may also use a regulator like LM317.


Test Code


Let us start with the simple text code that will verify if everything is setup properly. Remember to insert a SIM card before proceeding further. The code below takes commands from the Arduino terminal and sends it to the GSM Module. It also sends the commands other way around, from the GSM module to the Arduino. The code will also verify if the Software Serial library is also working fine.


#include <SoftwareSerial.h>

String Arsp, Grsp;
SoftwareSerial gsm(10, 11); // RX, TX

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);
  Serial.println("Testing GSM SIM800L");
  gsm.begin(4800);

}

void loop() {
  // put your main code here, to run repeatedly:

  if(gsm.available())
  {
    Grsp = gsm.readString();
    Serial.println(Grsp);
  }

  if(Serial.available())
  {
    Arsp = Serial.readString();
    gsm.println(Arsp);
  }

}

SIM800 Libraries



Find several SIM800 Arduino libraries. After going through source codes of several libraries my selection was “Seeeduino_GPRS” library which provides basic SIM800 features as well as additional set of GPRS related features.


16 views0 comments

Comments


bottom of page