Différences entre versions de « GeekOnFire GSM/GPRS Shield »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 57 : Ligne 57 :
 
Bien que le GPRS shield soit pourvu d'une "réserve", l'alimentation via le câble USB (limité à ~500mA) de votre PC sera insuffisant en cas de pic de courant sur le GPRS Shield. Le module SIM900 disposant d'une protection en surtension et en sous-tensions, ce dernier se coupera volontairement si le pic de courant provoque une chute de tension trop importante (la LED bleue s’éteindra).
 
Bien que le GPRS shield soit pourvu d'une "réserve", l'alimentation via le câble USB (limité à ~500mA) de votre PC sera insuffisant en cas de pic de courant sur le GPRS Shield. Le module SIM900 disposant d'une protection en surtension et en sous-tensions, ce dernier se coupera volontairement si le pic de courant provoque une chute de tension trop importante (la LED bleue s’éteindra).
  
== Application Ideas ==
+
== Idées d'applications ==
*M2M (Machine 2 Machine) Applicatoions.
+
* Dialogue Machine to Machine (M2M).
*Remote control of appliances.
+
* Commande d'appareils à distance.
*Remote Weather station or a Wireless Sensor Network.
+
* Réseau de senseurs à distance, station météo distante.
*Vehicle Tracking System with a GPS module.
+
* Système de suivit de véhicule.
  
 
== Cautions ==
 
== Cautions ==

Version du 7 mars 2012 à 12:37

Introduction

The Shield GSM/GPRS est basé sur un module SIM900 de SIMCOM, il est compatible avec Arduino et ses clones. Le shield GPRS permet à votre Arduino de communiquer en utilisant le réseau GSM. Ce shield permet d'envoyer des SMS, MMS, GPRS et de Audio en envoyant des commandes AT à l'UART (voir wikipedia pour plus d'information). Les commandes AT supportées sont GSM 07.07 ,07.05 et SIMCOM enhanced AT Commands. Le shield dispose aussi des 12 GPIOs, 2 sorties PWM et du convertisseur Analogique/Digital ADC du module SIM900 module (accessible sur la carte, logique 2.8volts).

Shield disponible chez MCHobby.be ATTN:Liens vers MCHobby WebShop

GSM-Shield-01.jpg

Caractéristiques

  • Quadri-Bande 850 / 900/ 1800 / 1900 MHz - devrait fonctionner avec tous les réseaux GSM de tous les pays.
  • GPRS multi-slot class 10/8
  • GPRS mobile station class B
  • Conforme à GSM phase 2/2+
    • Class 4 (2 W @ 850 / 900 MHz)
    • Class 1 (1 W @ 1800 / 1900MHz)
  • Contrôle à l'aide de commandes AT - Commandes standard : GSM 07.07 & 07.05 | Commandes étendues: SIMCOM AT Commands.
  • Messages SMS (Short Message Service) - Il est ainsi possible d'envoyer de petites quantités de données via le réseau mobile (ASCII ou données hexadécimales).
  • Embarque une stack TCP/UDP - Permettant d'envoyer des données sur un serveur web.
  • Support RTC.
  • Port série sélectionnable.
  • Prise pour micro et casque.
  • Basse consommation - 1.5mA(en mode veille)
  • Supporte la norme de température industrielle - -40°C a +85 °C

Spécifications

Dimensions 68.7mm X 53.5mm X 19.6mm
Protocole de communication UART
Indicateur LEDs PWR: Alimentation (Vert), Statut (Bleu), Netlight: Réseau(Rouge)
Alimentation 5V provenant de la carte Arduino.
Vbat 4.1V (pour module SIM900)
Consommation en Courant 2A(max)
Baud rate(par défault) 19200bps
RoHS Yes

Note de MC Hobby:

La consommation pouvant atteindre occasionnellement 2 ampères (réseau distant, déplacement), il est vivement conseillé d'utiliser un module d'alimentation séparé pour alimenter votre Arduino. Bien que le GPRS shield soit pourvu d'une "réserve", l'alimentation via le câble USB (limité à ~500mA) de votre PC sera insuffisant en cas de pic de courant sur le GPRS Shield. Le module SIM900 disposant d'une protection en surtension et en sous-tensions, ce dernier se coupera volontairement si le pic de courant provoque une chute de tension trop importante (la LED bleue s’éteindra).

Idées d'applications

  • Dialogue Machine to Machine (M2M).
  • Commande d'appareils à distance.
  • Réseau de senseurs à distance, station météo distante.
  • Système de suivit de véhicule.

Cautions

  • Make sure your SIM card is unlocked.
  • The product is provided as is without an insulating enclosure. Please observe ESD precautions specially in dry (low humidity) weather.
  • The factory default setting for the GPRS Shield UART is 19200 bps 8-N-1. (Can be changed using AT commands).
  • NewSoftLibrary library only support baudrate under 38400bps, it may lose data while communicate over 38400bps.
  • The standard NewSoftSerial library doesn't have support for receive on the Mega. Bhagman has written a new version of NewSoftSerial that has this support:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287382108

http://code.google.com/p/rogue-code/downloads/detail?name=NewSoftSerial10c-withMegaAndStream.zip

He've tried this new library. One limitation is that it only works on pins that support interrupts(Pin11,12), so on the Mega it only works on Hardware UART.

Description matérielle

GSM-Shield-02-fr.jpg

1*) Déclenchement logiciel

Le déclenchement logiciel n'est possible que si JP est soudé.

2*) LEDs de status

Le statut de la carte est affiché à l'aide de 3 LEDs de couleurs différentes.

La LED VERTE indique si la carte est alimentée (doit être allumée et fixe).

La LED BLEUE indique le statut de la carte GPRS (doit être allumée et fixe).

La LED ROUGE indique le statut de la connexion du réseau. Lorsque vous êtes connecté sur un réseau GSM, cette LED clignote brièvement toutes les 0.8 sec.

Getting Started

GSM-Shield-03-fr.jpg
Les quelques étapes pour démarrer avec votre Shield GPRS

Note:

Si vous utilisez votre Monitor Arduino pour tester votre shield (avec le sketch proposé plus loin), n'oubliez pas de configurer votre connexion en 19200 bauds et Carriage Return.

AT Command syntax

AT Command is simple textual commands communicated with GPRS Shield over its serial interface (UART). The "AT" or "at" prefix must be set at the beginning of each Command line. To terminate a Command line enter <CR>. Commands are usually followed by a response that includes. "<CR><LF><response><CR><LF>" Throughout this document, only the responses are presented, <CR><LF> are omitted intentionally.

Note: A HEX string such as "00 49 49 49 49 FF FF FF FF" will be sent out through serial port at the baud rate of 115200 immediately after SIM900 is powered on. The string shall be ignored since it is used for synchronization with PC tool. Only enter AT Command through serial port after SIM900 is powered on and Unsolicited Result Code "RDY" is received from serial port. If auto-bauding is enabled, the Unsolicited Result Codes "RDY" and so on are not indicated when you start up the shield, and the "AT" prefix, not "at" prefix must be set at the beginning of each command line.

For more information please refer to AT Commands Manual v1.03.

Power Up and Power Dowm the GPRS Shield

Power Up the GPRS Shield

The GPRS Shield can be turned on by two ways:

  • 1, Hardware Triger; Press the ON/OFF Button about two seconds.The power up scenarios illustrates as following figure:
GSM-Shield-04-On-Off.jpg
Figure of Timing of turning on GPRS Shield using Hardware Triger
  • 2, Software Triger; If use this way to power up the GPRS Shield, JP need to be soldered, then Digital Pin 9 of the Arduino will act as Software Triger port and Digital Pin 9 can not be use as other purpose. Then give Digital Pin 9 a Turn on Impulse can power up the GPRS Shield. The power up scenarios illustrates as following figure:
GSM-Shield-05-On-Off.jpg
Figure of Timing of turning on GPRS Shield using Software Triger

The following code is power up subroutine for Arduino if using software triger:

void powerUp()
{
  pinMode(9, OUTPUT); 
  digitalWrite(9,LOW);
  delay(1000);
  digitalWrite(9,HIGH);
  delay(2000);
  digitalWrite(9,LOW);
  delay(3000);
}

When power on procedure completes, the SIM900 will send out following result code to indicate the GPRS shield is ready to operate; When set as fixed baud rate, the SIM900 will send out result code: RDY This result code does not appear when auto baud rate is active.

Power Down the GPRS Shield

The GPRS Shield can be turned off by following ways:

  • 1, Normal power down procedure: Turn off the GPRS shield by using Hardware Triger; Press the ON/OFF Button about two seconds.

The power down scenarios illustrates as following figure:

GSM-Shield-06-On-Off.jpg
Figure of Timing of turning off GPRS Shield using Hardware Triger
  • 2, Normal power down procedure: If JP is soldered, then give Digital Pin 9 of the Arduino(act as Software Triger) a Turn off Impulse can turn off the GPRS Shield. The power down scenarios illustrates as following figure:
GSM-Shield-07-On-Off.jpg
Figure of Timing of turning off GPRS Shield using Software Triger

The following code is power down subroutine for Arduino if using software triger:

void powerDown()
{
  pinMode(9, OUTPUT); 
  digitalWrite(9,LOW);
  delay(1000);
  digitalWrite(9,HIGH);
  delay(2000);
  digitalWrite(9,LOW);
  delay(3000);
}


  • 3, Normal power down procedure: Turn off the GPRS shield by sending AT command “AT+CPOWD=1” to SIM900 module.

When GPRS Shield power dowm in Normal power down procedure, the procedure lets the SIM900 log off from the network and allows the software to enter into a secure state and save data before completely disconnecting the power supply. Before the completion of the power down procedure the SIM900 will send out result code:

NORMAL POWER DOWN

  • 4, Over-voltage or Under-voltage Automatic Power Down: SIM900 will constantly monitor the voltage applied on the VBAT.

①If the voltage ≤ 3.3V, the following URC will be presented:

UNDER-VOLTAGE WARNNING

②If the voltage ≥ 4.7V, the following URC will be presented:

OVER-VOLTAGE WARNNING

③The uncritical voltage range is 3.2V to 4.8V. If the voltage > 4.8V or < 3.2V, SIM900 will be automatic power down soon. If the voltage < 3.2V, the following URC will be presented:

UNDER-VOLTAGE POWER DOWN

④If the voltage > 4.8V, the following URC will be presented:

OVER-VOLTAGE POWER DOWN

  • 5, Over-temperature or Under-temperature Automatic Power Down: SIM900 will constantly monitor the temperature of the module.

①If the temperature > 80℃, the following URC will be presented:

+CMTE:1

②If the temperature < -30℃, the following URC will be presented:

+CMTE:-1

③The uncritical temperature range is -40℃ to +85℃. If the temperature > +85℃ or < -40℃, the module will be automatic power down soon. If the temperature > +85℃, the following URC will be presented:

+CMTE:2

④If the temperature < -40℃, the following URC will be presented:

+CMTE:-2

When the GPRS Shield encounters POWER DOWN scenario, the AT commands can not be executed. The SIM900 logs off from network and enters the POWER DOWN mode, only the RTC is still active. POWER DOWN can also be indicated by STATUS LED(Blue), which is off in this mode.

Note:

  • To monitor the temperature, users can use the “AT+CMTE” command to read the temperature when GPRS Shield is powered on.
  • To monitor the supply voltage, users can use the “AT+CBC” command which includes a parameter: voltage value(in mV) when GPRS Shield is powered on.

Serial Port(UART) Communication

The GPRS Shield is used UART protocol to communicate with an Arduino/Arduino clone; Users can use jumpers to connect (RX,TX) of the shield to either Software Serial(D8,D7) or Hardware Serial(D1,D0) of the Arduino.Detailed information is showed as the following picture:

GSM-Shield-08-UART-fr.jpg
Selectalbe GPRS Shield Communication Port

Note:

  • Users can use “AT+IPR=?” command to see supported baudrate, it will response a list of supported baudrate.
  • Users can use “AT+IPR=x”(x is value of supported baudrate) to set a fixed baud rate and save the configuration to non-volatile flash memory.
  • When users select Software Serial to communicate, NewSoftLibrary library should be install in arduino‘s libraries.
  • NewSoftLibrary library only support baudrate under 38400bps.

Indicator LEDs

There are three indicator LEDs(PWR(Green), Staus(Blue), Netlight(Red)) on the GPRS Shield, users can know about the working state of the shield based on the three indicator LEDs. Detailed information please refer to the following table:

LEDs(color) Status Description
PWR(Green) ON Power of the GPRS Shield is on
OFF Power of the GPRS Shield is off
Staus(Blue) ON SIM900 is on
OFF SIM900 is off
Netlight(Red) 64ms On/800ms Off SIM900 has not registered to a network
64ms On/3000ms Off SIM900 has registered to a network
64ms On/300ms Off GPRS communication
OFF SIM900 is not running


SIM Card Installation

An unlocked SIM card should be inserted in SIM Card Holder on the bottom side of the shield. Both 1.8 volts and 3.0 volts SIM Cards are supported by SIM900 and the SIM card voltage type is automatically detected by SIM900.

Note: Make sure your SIM Card is unlocked; If you not sure, you can check with your provider.

Antenna Interface

The shield comes with a GSM qurd-band antenna; Make sure the antenna is assembled and antenna pad is buckled properly.

Audio Interface

The GPRS Shield has 3.5mm Microphone interface and Speaker Interface, If you want to make voice calls, you would also require a headset with microphone.

Upload Sketch to Arduino

GSM-Shield-09-SerialRelay-fr.jpg
Flux de données entre l'ordinateur, Arduino et le shield GPRS

The following sketch configures Arduino/Arduino clone as serial link between PC and the GPRS Shield(Jumpers on SWserial side). PC would need a serial terminal software to communicate with it - Window's built-in HyperTerminal, Arduino IDE's Serial Monitor, Serial Terminals(sscom32) or Bray++ Terminal.

Vous pouvez utiliser le moniteur série d'Arduino pour communiquer directement avec l'UART du SIM900 à l'aide de ce sketch. Dans ce cas, il faut configurer le débit de la connexion du moniteur série sur "19.200 Bauds" et "Carriage Return". En effet, l'UART du SIM900 réagit au retour clavier.

Note: Le retour clavier, souvent symbolisé par CR correspond à touche "enter"/"Entrée". Cette touche correspond au caractère ASCII 13 aussi codé en C à l'aide de "/r".

After uploading the sketch to the Arduino board, press the ON/OFF button on the GPRS Shield to turn it on; Now you can see what you get on the serial terminal and the status of the three indicator LEDs, then communicate with your Shield.

//Serial Relay - Arduino will patch a 
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART 

#include <NewSoftSerial.h>
 
NewSoftSerial mySerial(7, 8);
 
void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);                 // the GPRS baud rate   
}
 
void loop()
{
    if(Serial.available())
    {
       mySerial.print((unsigned char)Serial.read());
     }  
    else  if(mySerial.available())
    {
       Serial.print((unsigned char)mySerial.read());
     }   
 
}

Note:

  • Make sure you install NewSoftLibrary library properly.
  • The "AT" or "at" prefix must be set at the beginning of each Command line. To terminate a Command line enter <CR>.

Examples

Sending SMS: using Software UART

#include <NewSoftSerial.h>
 
NewSoftSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(19200);  //Default serial port setting for the GPRS modem is 19200bps 8-N-1
  mySerial.print("\r");
  delay(1000);                    //Wait for a second while the modem sends an "OK"
  mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(1000);
 
  //mySerial.print("AT+CSCA=\"+919032055002\"\r");  //Setting for the SMS Message center number,  
  //delay(1000);                                  //uncomment only if required and replace with
                                                  //the message center number obtained from
                                                  //your GSM service provider.
                                                  //Note that when specifying a tring of characters
                                                  // " is entered as \"
 
  mySerial.print("AT+CMGS=\"+9184460xxxx\"\r");    //Start accepting the text for the message
                                                  //to be sent to the number specified.
                                                  //Replace this number with the target mobile number.
  delay(1000);
  mySerial.print("Hi from Geekonfire!\r");   //The text for the message
  delay(1000);
  mySerial.print(26,BYTE);  //Equivalent to sending Ctrl+Z 
}
 
void loop()
{
      //We just want to send the SMS only once, so there is nothing in this loop.
      //If we put the code for SMS here, it will be sent again and again and cost us a lot.
}

Making a call: using Software UART

#include <NewSoftSerial.h>
 
NewSoftSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);               // the GPRS baud rate   
  delay(2000);
  mySerial.println("ATDxxxxxxxxx;"); // xxxxxxxxx is the number you want to dial.  
         
  if(mySerial.available())
  {
    Serial.print((unsigned char)mySerial.read());
  }  
  
  delay(10000); 
  delay(10000); 

  mySerial.println("ATH"); //End the call.
  if(mySerial.available())
  {
    Serial.print((unsigned char)mySerial.read());
  }    
}
 
void loop()
{
  //Do nothing
}

Using AT Commands to Control GPIO and PWM pins

Note: GPIOs,PWMs and ADC of the SIM900 module are all 2V8 logic.

#include <NewSoftSerial.h>
 
NewSoftSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);               // the GPRS baud rate   
  delay(2000);
}
 
void loop()
{
  mySerial.println("AT+SPWM=1,63,100");// set PWM 1 PIN
  mySerial.println("AT+SPWM=2,63,50");// set PWM 2 PIN
  
  mySerial.println("AT+SGPIO=0,1,1,1");// set GPIO 1 PIN to 1
  mySerial.println("AT+SGPIO=0,12,1,1");
  delay(1000);  

  mySerial.println("AT+SGPIO=0,1,1,0");// set GPIO 1 PIN to 0
  mySerial.println("AT+SGPIO=0,12,1,0");
  delay(1000);    
}

Schematics

GPRSshield_sch.pdf

Resources

SIM900 AT Commands Manual v1.03.pdf

SIM900_hd_v1.06.pdf

SIM900_TCP/IP Application Note

Si5902BDC - Dual N-Channel 30 V (D-S) MOSFETs (used for 2.8V <> 5.0V translation for Serial Interface)

NewSoftLibrary

Serial Terminals(sscom32)

How to buy

GPRS Shield can be ordered through the GOF store. Its product page is located here

Licensing

This documentation is licensed under the Creative Commons Attribution-ShareAlike License 3.0 Source code and libraries are licensed under GPL/LGPL, see source code files for details.

Note de traduction

Le contenu de cette page est une traduction "At the best" des informations mise à disposition par Geek On Fire (page originale).

En aucun cas, MC Hobby ne peut être tenu responsable de l'exactitude des informations fournie par Geek On Fire ainsi que des conséquences qui pourraient en découler.

Cette traduction est proposée gratuitement comme aide ponctuelle visant à accélérer la prise en main. Une erreur de traduction n'engage, en aucun cas, la responsabilité de MC Hobby.

En cas de doute, l'utilisateur peut se référer au document d'origine mis à disposition par Geek On Fire.


Traduit avec l'autorisation de Geek On Fire - Translated with the permission from Geek On Fire - [1]

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.