GSM GPS shield for Arduino

By on September 3, 2012

Download_GSM_library

Shield for Arduino designed and based on the module GSM/GPRS SIM900 or the GSM/GPRS & GPS module SIM908, to make calls, voice and data connections via GPRS.

 

 

HARDWARE INNOVATIONS


This new version (old Arduino GSM shield) has several new hardware features, that allow maximum customization and provide many configurations.

We begin with the supply circuit a simple LM7805. To work, it is necessary to provide an input voltage between 7.5V and 12V. As shown in the circuit diagram, the input voltage, after being stabilized at 5 V, is reduced to 4.3 V by using a diode and provide power to modules that need a voltage between the 3.2 and 4.8 V. During the operations such as the use of GPRS, the module absorbs a current of about 1 A, therefore it is necessary that the power source is able to provide this current intensity.

An important technical feature is the serial adapter for the communication between the GSM module and Arduino. To reduce the tension has been used a simple voltage divider, while for raising the voltage from the GSM module to Arduino we chose a MOSFET BS170.

The news that is immediately evident is the presence of two jacks for audio. With a microphone and a headset with a 3.5 mm jack (just the standard headphones for computers), you can make a voice call !!

To preserve compatibility with the Arduino Mega, we changed the selection method for the serial communication. The two different serial communication modes (hardware or software) are selectable by jumper, leaving the user the choice between the two configurations ( for serial software in this new version we adopted pins 2 and 3) or possibly use the pin to your choice with a simple wire connection. With this solution you can use the Arduino Mega using two of the four serial that it has, or possibly carry out the communication through a serial software via two pins of your choice.

Always to preserve maximum flexibility and customization, there are some pins on the back of PCB, which allow to make the connections from the Arduino digital ports and the control signals data flow (CTS, RTS) or alerts for incoming calls or unread SMS (RI). In this new version, you can then disable these connections to save inputs or outputs pins.

Comparing the new card with the previous one, you can see the presence of two connectors on the top.These additional connections allow the use of the shield also with the new small breakout for SIM900 and SIM908. The new module Simcom SIM908, is characterized by the presence of a GPS with 42 channels.

The scenery offered by this new module SIMCOM, in addition to GSM GPRS shield, it is quite remarkable: the creation of a GPS tracking device that can communicate the location via the Internet (or SMS) is now available to everyone, avoiding all the problems due to assembly and low-level programming.

A further feature of this new version, concerns the presence of a supercap for circuit dedicated to the RTC (Real Time Clock). Inside the SIM900, as well as the SIM908, there is a circuit that is responsible for updating the clock even without power.

 

GSM GPS SHIELD SCHEMATICS


[CODE]
R1: 10 kohm
R2: 10 kohm
R3: 10 kohm
R4: 10 kohm

C1: 100 nF
C2: 470 µF 25 VL
C3: 100 nF
C4: 220 µF 16 VL
C5: 47 pF
C6: 47 pF
C7: 47 pF
C8: 47 pF
C9: 47 pF
C10: 47 pF
C11: 220 µF 16 VL
C12: 100 nF

CRCT:  0,1F

U1: 7805

T1: BS170

D1: 1N4007

P1: Microswitch

MIC: jack 3,5 mm
SPK: jack 3,5 mm

[/CODE]

 

SOFTWARE INNOVATIONS

The software library related to the GSM GPRS shield has been updated.  The library is open-source and uses the hosting service Google Project, located at http://code.google.com/p/gsm-shield-arduino/ . The library is constantly updated and improved with the addition of new features, so please check that you always have the latest release.

The main enhancement is the TPC/IP communication support through GPRS.

With a simple function, you can connect Arduino to internet using the APN (Access Point Name) you choose. After that we will automatically get an IP address by the provider.

To establish communication you must define which device performs the function of the server (still waiting for some connection), such as that client (requires a connection to the server according to the information you want to achieve) and that leads to exchange data .

In the library there are two functions that allow us to set the device to listen on a particular port for connections (server), or to establish a connection based on the server address and port chosen (client) .

Once connected, you can send the data, which can be command strings or just the data you want to monitor, for this action there is a high-level function, which simplifies the management.

 

LIBRARY FUNCTIONS GSM GPRS

First, you must have the folder libraries, in the root directory of the Arduino, the folder GSM_GPRS containing all the functions you can use.

Now if you want to change the serial port, through the jumper, you have to modify the file GSM.cpp.

To save memory, we decided to divide the functions into different classes contained in different files, to allow you to include or not the code parts needed, thus going to save memory RAM, leaving it free for the rest of the program. For the basic operation is always necessary to include files SIM900.h and SoftwareSerial.h, while depending on the needs you may include call.h (for call handling), sms.h (for sending, receiving and saving SMS) and inetGSM.h (containing functions related to HTTP, and GPRS).

SIM900.h

You should always include this file. It contains the basic functions for starting and configuring the GSM module.  Simply call the functions using “GSM.” As a prefix.

int gsm.begin(int baudrate) Turn the power on and sets the baud rate for communication. gsm.TurnOn(9600);
void SimpleRead() Reads a byte from the serial buffer. gsm.SimpleRead();
void SimpleWrite(char* cmd) Writes the string (or an integer) on the serial port. gsm.SimpleRead(“AT+CSQ”);
char SendATCmdWaitResp (char const* AT_cmd_string, uint16_t start_comm_tmout, uint16_t max_interchar_tmout, char const* response_string,byte no_of_attempts) Sends an AT command passed as a parameter, controlling the time of timeout for the receipt of a response and between one character and another. After receiving the response, compares it with that expected, if different resends the command for the set number of times.The possible outputs are shown below, with the relative enumeration. AT_RESP_ERR_NO_RESP or -1: No response received.AT_RESP_ERR_DIF_RESP or 0: Response different from that expected.AT_RESP_OK or 1: The response contains the expected string. If (gsm.SendATCmdWaitResp (“AT”,500,50,”OK”,3)== AT_RESP_OK)
Serial.println(“OK”);

 

call.h

In case you want to make a call, or simply refuse to answer an incoming call, you must use this class. To use these functions simply instantiate the object in the sketch. The functions listed in the table below refers to an object created with the following command at the beginning of the sketch: CallGSM call;

void Call(char* number_string) Makes a call to the number contained in the string call.Call(“+393471234567”)
void PickUp(void) During an incoming call, it responds and activates the audio communication. call.PickUp();
void HangUp(void) During an active call, hang up and disables audio communication. call.HangUp();
byte CallStatus(void); Returns the state about the phone calls.The possible output byte are listed under the following names:CALL_NONE or 0: No call.CALL_INCOM_VOICE or 1: An incoming call.CALL_ACTIVE_VOICE or 2: Active Call. If (call.CallStatus()== CALL_ACTIVE_VOICE)
Serial.println(“CALL ACTIVE”);
byte CallStatusWithAuth (char* phone_number,                             byte first_authorized_pos, byte last_authorized_pos); Unlike the previous distinguish if the active call, or incoming belongs to a number stored on the SIM in a position between the start and end, passed as parameters.  The possible output byte are listed under the following names:CALL_NONE or 0: No call.CALL_INCOM_VOICE_AUTH or 3: Incoming call from a number authenticated. CALL_INCOM_VOICE_NOT_AUTH or 4: Incoming call from a number not authenticated. If (call.CallStatusWithAuth() == CALL_INCOM_VOICE_AUTH)
Serial.println (“INCOMING CALL FROM A AUTH NUMBER”);

 

SMS.h

For managing text messages must use this special class. As before, it is necessary to recall it within the sketch and then instantiate an object. For example, in the following functions refers to an object created at the beginning of the sketch, with the command SMSGSM sms;

char SendSMS(char *number_str, char *message_str) Using the following command is sent an SMS to the number contained in the first string passed as a parameter with the text in the second. sms.SendSMS (“+393471234567” , ”Hello Arduino”);
char SendSMS(byte sim_phonebook_position, char *message_str) Send an SMS as before, where instead of the string is passed to the recipient’s contact position stored on the SIM. sms.SendSMS(1,”Hello Arduino”);
char GetSMS(byte position, char *phone_number, char *SMS_text, byte max_SMS_len) Reads the SMS stored on the SIM in the position passed as a parameter, saving the sender’s number in the first string passed in the second and the content of specified length. char number[13];
char text[200];
sms.GetSMS(1,number,text,200);

 

inetGSM.h

In this class are included functions to connect and manage communications via HTTP protocol. In the following examples was an object created with the command InetGSM inet;

int httpGET(const char* server, int port, const char* path, char* result, int resultlength) Send a GET request to the specified server on the specified port, requiring a certain path and saving the response to a string of the specified length. Returns the number of bytes read. char text[200];
inet.httpGET (“www.open-electronics.org”, 80,”/”,text,200);
int httpPOST(const char* server, int port, const char* path, const char* parameters, char* result, int resultlength) Send a POST request to the specified server on the specified port, requiring a certain path, passing the parameters set and saving the response string of the specified length. Returns the number of bytes read. char text[200];
inet.httpGET (“www.open-electronics.org”, 80,”/”,text,200);
int attachGPRS(char* domain, char* dom1, char* dom2) Initiates the connection using the GPRS APN passed as the first parameter.  The second and third arguments are two strings that contain the username and password. If no authentication is required, just pass the last two strings empty. inet.attachGPRS (“internet.wind”,””,””);
int deattachGPRS(void) Disconnects the module from the GPRS network. inet.deattachGPRS();
int connectTCP(const char* server, int port) Establishes a connection as a client to the server passed as a parameter on the port defined by the second parameter. inet.connectTCP (“www.open-electronics.org”, 80);
int disconnectTCP(void) Closes the communication with the server. inet.disconnectTCP();
int connectTCPServer(int port) Puts the module listens on the specified port waiting for a connection from a client. inet.connectTCPServer(80);
boolean connectedClient(void) Returns true if a client is connected to the module, otherwise false. inet.connectedClient();

 

EXAMPLE FOR CALLS AND SMS WITH THE GSM GPRS SHIELD 

Let us now, step by step, our first sketch to use the shield using the Arduino IDE version 1.00. We will write a program that when it receives a call from a preset number (stored in a specific location on the SIM), rejects the call and sends an SMS in response to the caller with the value read from an input.

First you have to extract the files from the compressed folder within the Library folder libraries contained within the installation folder of Arduino.

To first load the libraries using the following commands

#include “SIM900.h”

#include <SoftwareSerial.h>

Then load, uncomment properly, the files related to classes containing functions that we want to use for the management of phone calls and SMS.

#include “sms.h”

#include “call.h”

We will perform the initialization procedure in the setup. Set the pin to read the value which will then be sent via SMS, configure the serial communication and initialize the module with the function gsm.begin, and set the baud rate (usually for proper communication of data through GPRS is advisable not rise above 4800 baud).

At this point we enter the heart of the program, which will periodically check the status of incoming calls. To do this within the cycle loop will use the function call.CallStatusWithAuth saving the byte returned. In the case of incoming or in progress call, the sender (or recipient) number is stored in the string number.

Compared with the value stored CALL_INCOM_VOICE_AUTH, which describes an incoming call by a number in that set, we reject the call using the GSM.Hangup and after waiting 2 seconds, read the input value and send the message.The value read is an integer and must be first converted into a string using the function itoa.

Let us remember to insert a delay, inside the loop function, to ensure that the module is interrogated at intervals of not less than a second. Commands sent in rapid sequence could corrupt the stability of the module.

If we do not receive the result of proper initialization, you will need to check the power supply. Remember that it is recommended to use an external power source because the only power supplied by the USB port is not enought.

If the power is found to be correct, you should check that the file GSM.cpp, in the library are declared properly pin for the serial. Basically the new version uses pins 2 and 3, while the old version used pins 4 and 5.

#define _GSM_TXPIN_ 2

#define _GSM_RXPIN_ 3

The full program is as follows:

#include "SIM900.h"
#include <SoftwareSerial.h>
//carichiamo i file necessari allo sketch
#include "sms.h"
#include "call.h"

CallGSM call;            
SMSGSM sms;              

char number[20];
byte stat=0;
int value=0;
int pin=1;
char value_str[5];

void setup()
{
  pinMode(pin,INPUT);
  Serial.begin(9600);
  Serial.println("GSM GPRS Shield");
  //init the module
  if (gsm.begin(2400))
    Serial.println("\nstatus=READY");
  else Serial.println("\nstatus=IDLE");
};

void loop()
{
  stat=call.CallStatusWithAuth(number,1,3);
  if(stat==CALL_INCOM_VOICE_AUTH){
    call.HangUp();
    delay(2000);
    value=digitalRead(1);
    itoa(value,value_str,10);
    sms.SendSMS(number,value_str);
  }
  delay(1000);
};

 

EXAMPLE FOR INTERNET

We analyze one of the examples contained within the library to connect Arduino to the internet with GPRS connection.

We will make a program capable of receiving HTML content from a web page and save the first 50 characters.

Because we use only the functions relating to the Internet and HTTP, we load in addition to the standard library file, the file inetGSM.h

Instantiate an object management functions

InetGSM inet;

and as before we execute the initialization routine. Then we establish a GPRS connection. In this step you need to run the command “AT+CIFSR” that requires the provider the IP address assigned to the GSM module. This step is important. Some providers garantee the connection only if previously it’s made this request. Through the function gsm.WhileSimpleRead contained in the GSM class, we read the entire contents of the buffer. Once emptied the buffer, the sketch will go to the following functions.

At this point we are connected, we have to establish a TCP connection with the server, send a GET request to a web page and store the contents of the response in a previously declared array. All this is done by the function HttpGet in class inetGSM. In addition to the server and port (80 in the case of HTTP protocol), we have to indicate the path which contains the requested page.For example if you want to download the Wikipedia page on the Arduino to be reached at the following address it.wikipedia.org/wiki/Arduino_(hardware), the path will be /wiki/Arduino_ (hardware) while the server is it.wikipedia.org.

numdata=inet.httpGET(“it.wikipedia.org “, 80, “/wiki/Arduino_(hardware) “, msg, 50);

Obviously if we wish to save a greater number of characters of the answer, it is sufficient to initialize a string of larger dimensions, taking care not to saturate the RAM is made available by Arduino, otherwise we risk getting abnormal behavior, such as stalls or restarts.

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "inetGSM.h"

InetGSM inet;              

char msg[50];
int numdata;
char inSerial[50];
int i=0;
boolean started=false;

void setup()
{
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true; 
  }
  else Serial.println("\nstatus=IDLE");

  if(started){
    if (inet.attachGPRS("internet.wind","", ""))
      Serial.println("status=ATTACHED");
    else Serial.println("status=ERROR");
    delay(1000);

    gsm.SimpleWriteln("AT+CIFSR");
    delay(5000);
    gsm.WhileSimpleRead();
    numdata=inet.httpGET("www.google.com", 80, "/", msg, 50);
    Serial.println("\nNumero di byte ricevuti:");
    Serial.println(numdata); 
    Serial.println("\nData recived:");
    Serial.println(msg);
  }
};
void loop()
{
};

 

The shield has various connectors to accept more GSM/GPRS modules manufactured by SIMCOM and mounted on breakout board. In addition to the popular SIM900, our new shield for Arduino supports the recent SIM908, which is an evolution and aims to capture the market of GSM/GPRS quad-band providing a variety of additional features that make it unique, especially in the field of low-cost products. The SIM908 implements a GPS with 42 channels, characterized by an excellent accuracy and by a very reduced time required to perform the first fix (1 second in mode “hot start” and 30 seconds with the mode “cold start”).
This module can be used powered by a lithium battery, and can charge it, greatly simplifying this process that would require dedicated hardware.

The SIM908 has two serial, used one for the GSM and the other for the GPS. More exactly, the first serial interface is provided with a UART which belongs to the lines TXD, RXD, DTR, which go outside through the contacts, respectively, 12, 14, 10 of connector; for the GPS, instead, the serial is GPSTXD (contact 4) and GPSRXD (pin 5). The first serial port is actually intended for total control of SIM908, then it can also configure the GPS receiver and ask him to provide data on the location, the number of satellites hooked, etc. From the second serial port (GPSTXD / GPSRXD) instead, go out continuously strings in standard NMEA GPS system.

 

 

THE GSM SHIELD LIBRARY

Providing also use the SIM908, the library for the management of this module has been modified to provide a quick access to all the new features made available, the new library is derived from that used for the SIM900 module, and is available on the Internet at http://code.google.com/p/gsm-shield-arduino/ .

Note that you can use the new library for managing mobile SIM900, provided you do not call functions dedicated to SIM908. While it is completely compatible using the sketch for the version without GPS with this new one.

Let’s consider some new features introduced: first of all has been added the function ForceON(); used to check the status of the module and to force the power on. The SIM908 supports the charge of lithium batteries, the module can be started to perform the charger without the management of the GSM network. If we want to avoid this mode and make sure it’s really turned on then you need to call the function mentioned above.

gsm.forceON();

Intended for the use of GPS (and battery), we made a class which you can instantiate an object with GPSGSM gps, after including its # include files “gps.h“, in order to invoke their functions by prefixing “GSM.” to the desired function.

This subdivision into different files is designed to minimize RAM usage: in fact, for example, all the variables used by the class on the GPS will not be allocated in memory will not be included if the relevant files using #include “gps.h”.This allows you to choose which variables to use.

As already mentioned, also for the management of the battery there ara functions which enable the measurement of the voltage and battery temperature; for practical reasons, occupying little memory, these have been included in the class of GPS. For use them, after including the file #include “gps.h” you must instantiate the object related with GPSGSM gps. In the next sections will show the control functions of the GPS and battery.

 

HOW TO USE THE SIM908 GPS 

Before using GPS, you need to make a small set-up: first let’s make a bridge on jumper J1 on the SIM908 Breakout (cod. FT971).

The bridge on J1 enables power to the GPS antenna.

This serves to bring power to the active GPS antenna. Next, load the sketch example (in the examples directory) called GSM_GPRS_GPS_Library_AT (or even GSM_GPRSLibrary_AT) and once launched and completed initialization send the following commands:

 

AT

AT+CGPSPWR=1

AT+CGSPRST=0

 

We wait a minute, at which point the GPS should be working, to verify

continue sending the command:

 

AT+CGPSINF=0

 

If you can see the coordinates, it means that everything is working and we can proceed with the standard use by the implemented functions.

 

char attachGPS() Follow the steps to activate the GPS: turn on the power and set the mode to “hot start”. gps.attachGPS()
char deattachGPS() power off, disabling the power supply to save energy. gps.deattachGPS()
char getStat() Check the GPS status, the possible outputs are:0: GPS not started.1: Fix not performed (can be caused by a signal of poor quality).2: Fix 2D run.3: Fix 3D executed. char stat;
stat=gps.getStat();
if(stat==3)
Serial.println(“FIXED”);
char getPar(char* str_long, char* str_lat, char* str_alt, char* str_time, char* speed); Save in variables, respectively, longitude, latitude, altitude, time and speed. char lon[10];
char lat[10];
char alt[10];
char time[15];
char vel[10];
gps.getPar(lon,lat,alt,time,vel);

 

Now we proceed with a simple example that allows us to understand how to get the coordinates from the GPS module SIM908 mounted on the shield, the firmware is described here:

 

#include "SIM900.h"

#include <SoftwareSerial.h>

#include "gps.h"              

GPSGSM gps;                   

char lon[10];   
char lat[10];   
char alt[10];   
char time[15];  
char vel[10];   
char stat;      
boolean started=false;

void setup()
{
  //Serial connection.
 Serial.begin(9600);

  Serial.println("GSM GPRS GPS Shield");

  if (gsm.begin(2400)){

    Serial.println("\nstatus=READY");
    gsm.forceON();              
    started=true; 
  }
  else Serial.println("\nstatus=IDLE");

  if(started){
    if (gps.attachGPS())
      Serial.println("status=GPSON");
    else Serial.println("status=ERROR");

    delay(20000);              

    stat=gps.getStat();        

              if(stat==1)
                            Serial.println("NOT FIXED");
              else if(stat==0)
                            Serial.println("GPS OFF");
              else if(stat==2)
                            Serial.println("2D FIXED");
              else if(stat==3)
                            Serial.println("3D FIXED");
              delay(5000);

              gps.getPar(lon,lat,alt,time,vel);
              Serial.println(lon);
              Serial.println(lat);
              Serial.println(alt);
              Serial.println(time);
              Serial.println(vel);
  }
};

void loop()

{

};

 

THE BATTERY

In order to use the lithium battery as the power source for our FT971 module that houses the SIM908 (note: the SIM900 is not able to manage the barrery charge) is sufficient to close the bridge on this shield called with CHRG and set on VEXT the second bridge near the battery connector.

Through the two library functions is possible to obtain the percentage of remaining charge, the battery voltage and the voltage read by the temperature sensor. In the case of applications poorly ventilated, with prolonged periods of work and in climatic conditions not exactly optimal, it is advisable to monitor this value to make sure that the battery works within the limits for a correct operation. The temperature can be calculated according to the relationship voltage/temperature sensor.

It is also possible to set the module so that automatically determine if the battery is working outside the permissible range, with consequent shutdown of the same.

To activate this mode, you need to send the command:

 

AT+CMTE=1

 

To disable it you have to send the command:

 

AT+CMTE=0

 

While to know which mode is configured must issue the command:

 

AT+CMTE?

 

To know the exact syntax of the functions and their return refer to Table:

 

char getBattInf(char* str_perc, char* str_vol); Save the remaining battery in percentage terms, and battery voltage. char str_perc[5];
char str_vol[6];
gps.getBattInf(str_perc,str_vol);
Serial.print(“BATTERY: ”);
Serial.print(str_perc);
Serial.println(“%”);
char getBattTVol(char* str_vol); Saves the voltage value of the temperature sensor. char str_Tvol[6];
gps.getBattTVol(str_Tvol);
Serial.println(str_Tvol);

Also in this case we see how to implement these functions in a sketch, referring to this sketch, which contains the corresponding code.

 

 

#include "SIM900.h"

#include <SoftwareSerial.h>

#include "inetGSM.h"

#include "gps.h"           

GPSGSM gps;                

char perc[5];              
char volt[6];              
char tvolt[6];             

long prevmillis=millis();              
int interval=10000;               

void setup()
{

  Serial.begin(9600);
  Serial.println("GSM GPRS GPS Shield.");
  if (gsm.begin(4800)){
    Serial.println("\nstatus=READY");
    gsm.forceON();  }

  else Serial.println("\nstatus=IDLE");

};

void loop()

{

  if(millis()-prevmillis>interval){     

    gps.getBattInf(perc,volt);          
    gps.getBattTVol(tvolt);             

    Serial.print("Battery charge: ");
    Serial.print(perc);
    Serial.println("%");

    Serial.print("Battery voltage: ");
    Serial.print(volt);
    Serial.println(" mV");

    Serial.print("Temperature sensor voltage: ");
    Serial.print(tvolt);
    Serial.println(" mV");  

    Serial.println("");

    prevmillis=millis();
  }
}

 

DEBUG MODE GSM & GPS SHIELD

During the use of the shield, sometimes you fail to get the desired results without understanding why, for help, libraries can be configured to provide output some debug messages during the execution of functions called. Inside the file GSM.h there is the following line:

 

//#define DEBUG_ON

 

Uncomment it, you are going to enable this mode, commenting, no diagnostic message will be shown on the serial output.

 

HOW TO USE THE GSM & GPS SHIELD WITH ARDUINO MEGA

For problems with the RAM, or simply for projects that require a larger number of input/output, we can use with the GSM/GPRS & GPS shield the Arduino Mega.  Thanks to four serial port, we can use one of these instead of the serial software to communicate with the shield.

With the latest release, the library can be used completely with Arduino Mega. You must open the file GSM.h and select the tab used appropriately commenting lines of code.

Using the shield with Arduino Mega we comment as follows:

 

//#define UNO

#define MEGA

If we want to use Arduino UNO:

#define UNO

//#define MEGA

 

Similarly, also the file HWSerial.h, must be configured. As before, we see the first example for Arduino Mega:

 

#define MEGA

 

Using the file HWSerial.h is not necessary to define the possible use with Arduino Uno, as implemented in the class it is only used by the hardware serial.

The library uses the serial Serial0 (TX 1 RX 0) for external communication and the serial Serial1 (RX 18 TX 19) to communicate with SIM900 and SIM908. Nothing prevents you replace every occurrence of Serial1 with Serial2 or one that you prefer.

Please note that to use the serial hardware you need to create the connection between the shield and Arduino Mega using a bridge: the TX pin of the shield must be connected to TX1 18 and the RX pin with the RX1 19.

 

 

THE STORE

 

 

 

 

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.
  • Nash Brown

    I’m sorry, this may be a stupid question. Do you need a specific network to use this? Does it work automatically?

    • BorisLandoni

      This is a GSM/GPRS shield with also GPS (usign SIM908).
      You need the same network of you mobile phone :-)

    • http://www.facebook.com/ashwani.sihag Ashwani Sihag

      It works on all network.

  • Pingback: Dan (freelancerace) | Pearltrees

  • http://www.emcelettronica.com/ Emanuele

    Great Boris!
    The presence of two jacks for audio (microphone and a headset) to make voice call is an intelligent idea!

    • Bash2

      agree

  • Pingback: Jak zbudować telefon komórkowy ?

  • Ahmed Ismail

    i want to know while the arduino regulator should output exactly 5V, no more no less why we should connect it with the arduino with voltage source between 7.5V and 12V.what will happen if we connect it with 6v power source 1A

    • BorisLandoni

      Hi, because the 7805 in the shield is used also to charge the battery (with SIM908). The power regulator on Arduino is too small.

  • nick

    is the sim900 or sim908 module included in the shield? thanks!

  • Johan Henselmans

    Simple question: now that Arduino Due is out, will this work with the Arduino Due?

    • BorisLandoni

      Good question, will test ASAP Arduino team send as a sample of the DUE.

  • Pingback: How To Stop Rental Equipment Theft | SpyGearCo: Spy and Surveillance

  • Steve

    Trying to use this with an AT&T sim card and send an SMS to a USA phone number. Im use the sms.SendSMS command as in the library example and it comes back that it has been sent but I never receive it on my phone. Im using +1 then the 10 digit US number.

    • BorisLandoni

      You could sniff the serial comunication to understand where is the problem.

    • Sujith Nadeera

      my pal. try without mentioning the country code. It works well for me.

  • http://www.dostmuhammad.com/ Dost Muhammad Shah

    are gerbers for this shield available?? I need help if you can provide me with the eagle schematic

    • BorisLandoni

      I’m sorry, we haven’t the eagle field, I could provide you the gerber. We could provide you the PCB

      • http://www.dostmuhammad.com/ Dost Muhammad Shah

        I just need to know if there is some special way to route the MIC lines, can u feed output of a sound module like wtv020-sd directly to MIC pins ? I am getting humming noise . and tried to remove it using a low pass filter but couldnt get it done to the level needed

        • BorisLandoni

          Yes you can connect directly the PWM output of wtv020 to the module. You should use shielded cable

          • http://www.dostmuhammad.com/ Dost Muhammad Shah

            have you tried it?? shielded cable?? shielded cable to connect the wtv020 ‘s output? what if i am connecting it with a PCB track?

            I have no idea of shielded cables!

          • http://www.dostmuhammad.com/ Dost Muhammad Shah

            this is the part of board.

  • smith

    Someone should redo the board layout so it would fit in the arduino box or even at the bottom correctly. Still nice to experiment with this one.

  • plo

    Hi, i got that borad last week and i can’t get it running. I’ve the SIM908 Module. I closed the J1 Jumper. The LED on the Sim Module is flashing about every 4 sec. .I have a powersupply with 3.3A connected to my Arduino Leonardo. But when i started up that module loaded with any of the example sketches in the libary i got the message :
    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp
    status=IDLE

    It makes no changes when i change the Pins in the GSM.cpp.

    Any ideas?

    Regards

    Thomas

    • Quasae

      I too am having the same problem

      • BorisLandoni

        With Leonardo?

        • Rowell

          with arduino uno… I think the problem on this is the “8170-CAVOUFLSMA (Adapter antenna cable UFL-SMA).”…. It should not be like this the design when it attached to the ” SIM908″….

    • Rowell

      the same problem also…

  • smith

    Hi again,

    Got some parts of this working but with a bit of trial and errors. Firstly I did redo the httpget to send data out. It works.
    But I’m unable to catch the http session receive from the httpget.
    Is it somewhere in the GSM::WaitResp function, the first occurrence but I cannot locate the at command to catch the reply.. or maybe being blind..

    Please advice?

  • Oso

    hi. how to open the gsm shield programmatically without pressing the power button.

    • BorisLandoni

      I don’t understand the problem?

  • http://twitter.com/bougakov Alexander Bougakov

    Is it compatible with Arduino Leonardo?

    • BorisLandoni

      I didn’t test is with Leonardo

  • Pingback: اصنع هاتفك الجوال بنفسك باستخدام اردوينو | آردوينو ببساطة Simply Arduino

  • Rowell

    The “Adapter antenna cable U.FL-SMA” has a lose connection when it is interfacing to the connection of it in “7100-FT971M (Breakout with SIM908)”… The cable that I ordered has a big error because it cannot be attached formally or make a connection properly to the “7100-FT971M (Breakout with SIM908)”….

    The error in Arduino is:

    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

    Please make some response on this matter..

    • BorisLandoni

      This cable http://store.open-electronics.org/Accessories/Antennas/Adapter%20antenna%20cable%20UFL-SMA is for FT971. So I don’t understand the problem. Is it a damaged cable?

      • Rowell

        my problem sir,

        the cable that I received is damaged… yes, it is FT971… the link it is…

        • BorisLandoni

          And have you solved?

          • Rowell

            Until now I did’nt use my new device… I ordered 4 on this but my “FT971″ connector is damaged already… I used my frnd connector…

            This is the error…

            ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

            can u give me another connector on it???? it is totally damaged….

          • Rowell

            Dear Boris Landoni,

            I hope you can response me immediately regarding of my problem of this module that I ordered here…. and until now, it is not working… I think there is something wrong with this module that you released in the market… Can you make an action immediately…. Please Sir Boris Landoni, I’m begging you…

            I ordered this all…

            GSM/GPRS & GPS shield for Arduino…
            7100-FT971M (Breakout with SIM908)….
            8170-ANTGSMSTL-S01 (GSM antenna SMA)…

            8160-ANTGPS-SMA (GPS antenna SMA)…

            8170-CAVOUFLSMA (Adapter antenna cable UFL-SMA)….

            Please response me so that I can start immediately in my project…

            The error is this….
            ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

            Please make an action on this… The time is running on it… I really appreciate if you can give me an advice or nice comment to be aware or take away the ERROR… I checked everything, but it’s okay… All in all is connected into the proper location or corresponding position…

            this is my email address… rowell_regis19@lsu.edu.ph

  • Sergio

    You wrote GSPRST instead of GPSRST

    • BorisLandoni

      ops :-D

  • Jef

    will this work with arduino duemilanove????

    • BorisLandoni

      Yes of course

  • Rowell

    Hello Sir Boris,

    can you teach me on how to understand better this result the GPS coordinates output??? I try to locate this in google map but it can’t.. I saw some sample GPS coordinates but there are degrees, time, etc.. Please help me…

    this is the result of (latitude: 808.886162 and longitude: 12350.796197)

    actually i try run some of the sample code and that is the result…. please help me to understand it better… any convertion to make this understandable???

    • BorisLandoni

      You have to convert the coordinates, you can use this one http://www.earthpoint.us/Convert.aspx

      • Rowell

        thanks for this… it works… sir Boris, how about the defect item that I received… i hope there is replacement for that??? I swear, I did’nt damage the device…

  • Rowell

    I hope you can response me immediately regarding of my problem of this module that I ordered here…. and until now, it is not working… I think there is something wrong with this module that you released in the market… Can you make an action immediately…. Please Sir Boris Landoni, I’m begging you…

    I ordered this all…

    GSM/GPRS & GPS shield for Arduino…
    7100-FT971M (Breakout with SIM908)….
    8170-ANTGSMSTL-S01 (GSM antenna SMA)…

    8160-ANTGPS-SMA (GPS antenna SMA)…

    8170-CAVOUFLSMA (Adapter antenna cable UFL-SMA)….

    Please response me so that I can start immediately in my project…

    The error is this….
    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

    Please make an action on this… The time is running on it… I really appreciate if you can give me an advice or nice comment to be aware or take away the ERROR… I checked everything, but it’s okay… All in all is connected into the proper location or corresponding position…

    this is my email address… rowell_regis19@lsu.edu.ph

  • rowell

    can anyone help me regarding my problem on GPS coordinate data…

    address also to sir boris landoni…

  • m2msupport.net

    Check out online AT command tester tool,
    http://m2msupport.net/m2msupport/module-tester/

    - Send one or batch of AT commands
    - Perform modem diagnostics
    - Data call setup

  • Vinu

    Hi Mr. Boris,

    Can you provide the PCB details of both the breakout and shield? May be gerber files?

    Thank you..

    • fun

      Will be great to have the PCB and Gerber files.

  • Rowell

    hello sir boris,

    why is it that so hard to get GPS data??? I made more trials to get it directly the information of GPS… but it is really hard to me….

    • BorisLandoni

      The GPS need to see the sky.
      Please don’t post the same question in ALL our articles…

      • Rowell

        I’m sorry for being spamming Sir Boris… I will not do that again….
        Thank you very much for the response….

      • Rowell

        Hello Sir Boris,

        I already make it… The GPS see the sky but nothing is changed… zero coordinates given… I made many trials but no coordinates….

  • Rowell

    is it the response of this function

    AT+CGPSPWR=1
    AT+CGSPRST=0

    is OK????

    • BorisLandoni

      Please see the datasheet.

  • james

    hello,
    this could Be a stupid question but i would
    be gratefull for an answer.

    Can i send data from this shield/arduino trought get method to a specific sql table?

    Thanks

    • BorisLandoni

      Hi, you can send data with GET method.

  • Sarie

    Dear Boris,
    I bought the shield with the SIM908 module. I am using arduino mega, so i conected the tx and rx pins as you said above. When i want to run the basic SMS code from you library i get an error back on the serial monitor and it says the module STATUS=IDLE. Am i supposed to conect the RX on the shiel to the RX119 on the arduino and the TX on the shield to the TX118, or maybe to conect the RXs with the TXs? As i can see, the modul doesnt respond, could give me some ideas what can cause it?
    Thank you in advanced!

    • BorisLandoni

      You can test the module with the serial2 hardware or with software pins. What are you using?

      • Sarie

        I tested it with hardware serial, and when i saw the modem is not responding i just wired the TX and the RX pins on the shield together to see i i’ll recieve if i send something on serial port, so i was sending OK, and i was recieving on the serial monitor OK, so the communication to the shield works, but when i connect the sim908 the example for sms the modul doesnt respond

      • Sarie

        It says:
        “Please note that to use the serial hardware you need to create the connection between the shield and Arduino Mega using a bridge: the TX pin of the shield must be connected to TX1 18 and the RX pin with the RX1 19.”

        So, im not sure where should i physically find the TX and RX pin on the shield?

        • BorisLandoni

          In the post there is a section
          “HOW TO USE THE GSM & GPS SHIELD WITH ARDUINO MEGA”
          The library uses the serial Serial0 (TX 1 RX 0) for external communication and the serial Serial1 (RX 18 TX 19) to communicate with SIM900 and SIM908. Nothing prevents you replace every occurrence of Serial1 with Serial2 or one that you prefer.

          Please note that to use the serial hardware you need to create the connection between the shield and Arduino Mega using a bridge: the TX pin of the shield must be connected to TX1 18 and the RX pin with the RX1 19.

  • Alfonso

    I bought the shield with the SIM908 module but I can not get it work.
    I always get the message (with DEBUG mode ON and the LED on the SIM908 module flushing):
    GSM Shield testing.
    DB:NO RESP
    DB:NO RESP
    DB:NO RESP
    Trying to force the baud-rate to 9600
    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp
    status=IDLE
    I’m working with:
    - Arduino UNO REV3
    - External power supply 7.5V 1500mA
    - I have followed the steps in the Instruction.txt file
    Please, can you help me with these questions?:
    1.- Do I have to do anything to work with HW Serial besides jumper configuration?
    2.- Is the GSM GPS SHIELD SCHEMATICS the last version? I have seen some differences in my shield while testing my soldering.
    Please help.
    Thanks

    • BorisLandoni

      I suggest you to use the SFW serial comunication.
      The library by default works with this configuration.

      • Alfonso

        Great! It works now! Thanks!!
        How can I use the HW Serial instead of SW Serial? And is the schematic the last version? I think it doesn’t fit 100% with my shield.

        • BorisLandoni

          The schematics is right.
          To use the HW serial you have to change all “myserial” with serial.

  • Alfonso

    Please, could you tell me the battery connector type? I think it’s JST SH type but I’m not sure.

    Thanks

  • Johan Henselmans

    I have been trying to get this shield to work with the SIM908 breakout, the SIM908 breakout is flashing, but I m gettting the error message

    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp.

    I have an Arduino Leonardo, powered via a 12V 1,7A power supply, have defined UNO as the arduino. I have also

    I tried downloading the latest source code, but that does not seem to be possible due to a mishap in the svn directory. Checking out svn checkout http://gsm-shield-arduino.googlecode.com/svn/trunk/ gsm-shield-arduino-read-only results in a few files and an email address. I had to checkout http://gsm-shield-arduino.googlecode.com/svn/branches/GSMSHIELD to get the latest.

    What else can I do to get the SIM908 breakout to work with the shield?

    Regards,

    Johan Henselmans

    • Johan Henselmans

      OK, found the culprit. Arduino Leonardo and this shield is a no-go. Arduino Uno Rev3 (Not Rev2 or 1) will work.

      The GPS antenna also really needs a free view.

      • BorisLandoni

        Ok, I’ll check it

    • BorisLandoni

      Hi,
      are you using the right pins?
      Software or hardware serial?

  • Pingback: Using the GSM/GPRS & GPS Shield: call examples | Open Electronics

  • Pingback: Arduino GSM shield | Open Electronics

  • pzzp

    Hi everybody, i have a leonardo board and this shield with SIM908.
    I got the following message by serial:
    DB:NO RESP
    ERROR: SIM900 doesn’t answer. Check power and serial pins in GSM.cpp

    status=IDLE

    Please help me, i really don’t get what the problem is.

  • Dave

    Hi Boris,

    I am considering this shield for use in an application in which I need it to send and receive Data SMS to and from an Android phone. For the Android phone part, I already know how to send and receive Data SMS. I am wondering if it will be possible for this shield to send/receive Data SMS since I don’t see any related function in the library.

    Can you please kindly advise?
    Thanks.

  • Pingback: m2m | Pearltrees

  • Pingback: GSM GPS shield for Arduino | How 2.0, Hobbies &...

  • Martin

    Hi, I can’t get this to work.

    SMS sketch;

    GSM Shield testing.

    status=READY

    SMS sent OK

    No sms received.

    ————————

    GSMClient sketch;

    GSM Shield testing.

    status=READY
    status=ATTACHED

    Number of data received:
    0

    Data received:

    ———————————

    I get errors at random times.

    LED on mini gsm board flashed, using sw serial on UNO R3.
    Using a long time to test shield. 25 – 60 sec

    • BorisLandoni

      More info

      • Martin

        Got it working if I press down on simcard and chip.

        Then i can restart and it will connect, but when I turn of power I need to press down again.

        If I don’t do it, the led will flash a couple of times before turning of.

        Tried to connect a gps with Tinygps on softwareserial, but I cant get any info from the GPS if I try to connect gsm in setup.

        Got 250 bytes of free memory, so that should not be the problem.

        • BorisLandoni

          So probably there are some wrong solder.
          Please check it.

          • Martin

            Yes, its a bad solder on the mini gsm board.

            Does any of the beta lib offer less ram usage?

          • Martin

            What about the softSerial problem, Is it not possible to use your gsm lib with another connection to softserial?

          • BorisLandoni

            You can change the pin and use an hardware serial but with the mega

          • BorisLandoni

            You can import only the necessary functions

  • Matias Frith

    Dear, I received this shield, with SIM908 breakout. Everything works fine, but when you start the GPS, the errors are very common. When querying the status of the GPS module with CGPSSTATUS just get: “Location Unknown” and takes a long time to fix the GPS to 2D / 3D FIX.

    The shield also came with an active antenna, with U.FL connector, which I understand is 3~5v, however, in the wiring diagram provided in the manuals of the shield and breakout SIM908, I see no connection at pins 56 GPS_VCC_RF (2.8v), or 58 GPS_VANT to provide power to the antenna. In fact, in the wiring diagram, the pinout differs from the pin numbers of the SIM908. Can you send me the wiring diagram of SIM908 breakout? I’ve looked at the site, but I have not been able to find. Thank you!

  • Sujith Nadeera

    THIS IS A GOOD SHIELD. GREAT ONE. WORKS WELL

  • javier torres

    I have been trying to use this library recommended here http://www.gsmlib.org/download.html and I download BETA_GSM_GPRS_GPS_IDE100_v305.zip but when I am testing on IDE of arduino it show me this mistake

    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In constructor ‘HWSerial::HWSerial()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:4: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘void HWSerial::end()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:12: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘virtual void HWSerial::begin(long int)’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:24: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘int HWSerial::peek()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:28: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘virtual size_t HWSerial::write(uint8_t)’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:32: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘virtual int HWSerial::read()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:36: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘virtual int HWSerial::available()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:40: error: ‘Serial1′ was not declared in this scope
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp: In member function ‘virtual void HWSerial::flush()’:
    E:INSTALADORES ARDUINOarduino-1.0.4librariesGSMSHIELD_TDGHWSerial.cpp:44: error: ‘Serial1′ was not declared in this scope

    what I have to do¿

  • javier torres

    there are any way to have the time on the sim900 module (hour,mim,seg-day,month,year) and I can read from my arduino uno board through the serial port?

    • BorisLandoni

      You have to study the AT Command manual. :-)

  • javier torres

    –>hello , if you use

    #define _GSM_TXPIN_ 2

    #define _GSM_RXPIN_ 3

    –>why you need to read

    int value=0;

    int pin=1;

    value=digitalRead(1);

    itoa(value,value_str,10);

    –>the pin 1 on the arduino uno board is Rx but in this skecth is digital,Why?
    –>from pin 1 of arduino uno where pin I need to connect in the GSM board?

    • BorisLandoni

      You have to use the soft serial or the hardware serial. You can chose

  • javier torres

    Could you tell me where I should change the time duration of the call ( void Call(int sim_position) ?

    • BorisLandoni

      You have to start a call and then hang up

  • Marci

    How many and which pins I will need to connect it to the Arduino Uno ?

  • Azca_

    Hello,

    I can’t see how many digital pins the shield requiere,
    and if it needs the analog inputs, is it a bigger schematic of the
    circuit ? Is is possible to use the analog pin even if this shield is
    plugged ?
    Thank you !

    • BorisLandoni

      The shield uses only 4 pins, the other pin are optional.
      Yes you can use analog pin without problem

  • Meningsfelle

    What does this really mean:
    Please note that to use the serial hardware you need to create the connection between the shield and Arduino Mega using a bridge: the TX pin of the shield must be connected to TX1 18 and the RX pin with the RX1 19.

    I used the shield with UNO, but can’t make it work with MEGA. Pls. help!

    Espen

    • BorisLandoni

      If you want use the Shield with mega, you need to wiring the Serial1 to the shield pin. For UNO no problem because there are the jumpers.

  • James

    Hey Boris,

    I got the whole kit soldered together, and I tested it a

    week ago and it worked perfectly fine. The only problem

    I had is that I only got it to work with one SIM card, not

    other SIM cards I also have.

    Now when I try to use it again, I get the following message:

    GSM Shield testing.

    status=READY

    SMS sent OK

    But I don’t receive any text messages.

    I have the two jumpers connected, and I’m using an external
    power supply.

    Any suggestions are helpful!

    • BorisLandoni

      Be sure that the SIM haven’t the PIN enabled

  • Meningsfelle

    I am unable to get GPS signals. At gps.getStat(); I get stat=0. (GPS off). Please help.

    Espen

    • BorisLandoni

      On the SIM908 breakout there is a little jumper. Be sure that this jumper is close

      • Meningsfelle

        The jumper is closed ok.
        The breakout has been working for quite some time, but suddenly stopped. What can cause this? For such an expensive breakout it must work perfectly.
        GSM is working as expected.

        • BorisLandoni

          We sell a lot of products with this breakout board.
          Do you use it with the shield?

          • Meningsfelle

            Yes, it is used with your shield.

  • Pingback: GPS Tracking | Pearltrees

  • javier torres

    can you use the gps functions with sim900?

  • javier torres

    if I want to buy 100 sim908 modules you can sell me ?

  • Pingback: GSM GPS shield for Arduino | Arduino, Android, ...

  • Vijenthan Vino

    nise

  • dinesh

    Will this library works with Arduino UNO..

    • BorisLandoni

      Yes of course

  • Jonas

    Hi. How do i power BOTH the arduino and this shield using only ONE single battery?

    If someone could point me in the right direction i would appreciate it.

    Thank you very much.

    • BorisLandoni

      You can add a battery to power Arduino. Or use SIM908 breakout to manage the battery charge

  • vijay

    whether a camera can be interfaced with it????

    • BorisLandoni

      Not yet.
      We are developing a new breakout to manage a camera module ;-)

  • logger

    Hi,I am trying to get GPS data using SIM 908 with Arduino mega,but i failed to get the data,do i need to apply voltage in GPS_VANT, what should i do with GPS TX and RX pin, i connected TXD and RXD of SIM 908 to pin 2,3 of arduino mega with DTR pulled down and applied 4 volts in V_BAT, using the library fuctions provided here,i got “NO RESP” in the serial monitor,can u help me out??

  • Neumi

    Hi,
    when i tried to set up the GPS and typed the command in the serial monitor the monitor responded an error when i typed in: “AT+CGSPRST=0″ The GPS is not working. What can i do? Jumper is connected… sms is working.

    • Neumi

      Ok someone helped me solving the problem… the website says:
      AT
      AT+CGPSPWR=1
      AT+CGSPRST=0

      But there is a turn in the order of letters … it has to be:
      AT
      AT+CGPSPWR=1
      AT+CGPSRST=1

      then you check if the GPS got signal:
      AT+CGPSSTATUS?

      If the answer turns from “Location Unknown” to “Location 3D Fix” (or 2d…) you can read the locationdata:
      AT+CGPSINF=0

      Have fun.