Difference between pages "2.8'' TFT Touch Shield" and "Elecrow SIMduino UNO SIM808 GPRS/GSM Board"

From Elecrow
(Difference between pages)
Jump to navigation Jump to search
 
(Created page with "==Description== The Elecrow Simduino combines Arduino uno and sim808 module. It will save more cost and space for your project and easier to build other modules. It not only b...")
 
Line 1: Line 1:
== Introduction  ==
+
==Description==
 +
The Elecrow Simduino combines Arduino uno and sim808 module. It will save more cost and space for your project and easier to build other modules. It not only by DC power supply, we have designed a battery interface for it, you can also use a 3.7V lithium battery to power it. Whether you want to get a Arduino or a SIM808 module, even start a SIM808 related application that base on Arduino. It will make your satisfaction. Come on and add it to your shopping cart.
  
This TFT Touch Shield is Arduino/Crowduino/Arduino Mega compatible, it integrated a 2.8” TFT Display and a resistive touch panel, to make this shield suitable for handheld devices.<br>
+
Same as the Arduino UNO, the SIMduino also has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, a reset button, and of course a Mini USB cable, simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
This TFT Touch Shield has 240x320 pixels with individual pixel control, it uses the ILI9341 driver and SPI interface to communicate with controllers such as Arduino, saving you much Arduino pins for other usages in your projects. Besides, A SD card socket is also added to help you develop applications that data storage is needed such as digital picture album.<br>
 
  
'''Model: [https://www.elecrow.com/28-tft-touch-shield-v43-p-1056.html AMS320240TFT]'''<br>
+
'''Model: [http://www.elecrow.com/elecrow-simduino-unosim808-gprsgsm-board-p-1607.html ACM12425E]'''<br>
[[File:TFT Touch Shileld2.jpg| 400px]]
 
  
[[Image:Get_one_now.png|300px|link=https://www.elecrow.com/28-tft-touch-shield-v43-p-1056.html?wiki|alt=Alt text|Title text]]
+
[[File:simduinodd fem.JPG |600px]]
  
== Features  ==
+
==Summary==
 +
{| cellspacing="0" cellpadding="5" border="1"
 +
|-
 +
| align="center" width="150" | '''Microcontroller'''
 +
| align="center" width="200" | '''ATmega328'''
 +
 
 +
|- style="font-size: 90%"
 +
| align="center" | Operating Voltage
 +
| align="center" | 5v
 +
|- style="font-size: 90%"
 +
| align="center" | Input Voltage (recommended)
 +
| align="center" | 3.3-5V
 +
|- style="font-size: 90%"
 +
| align="center" | Input Voltage (limits)
 +
| align="center" | < 5V
 +
|- style="font-size: 90%"
 +
| align="center" | Digital I/O Pins
 +
| align="center" | 14 (of which 6PINs provide PWM output)
 +
|- style="font-size: 90%"
 +
| align="center" | Analog Input Pins
 +
| align="center" | 8
 +
|- style="font-size: 90%"
 +
| align="center" | DC Current per I/O Pin
 +
| align="center" | 40mA
 +
|- style="font-size: 90%"
 +
| align="center" |DC Current for 3.3V Pin
 +
| align="center" | 50 mA
 +
|- style="font-size: 90%"
 +
| align="center" | Flash Memory
 +
| align="center" | 32 KB (ATmega328) of which 0.5 KB used by bootloader
 +
|- style="font-size: 90%"
 +
| align="center" |SRAM
 +
| align="center" | 2 KB (ATmega328)
 +
|- style="font-size: 90%"
 +
| align="center" |EEPROM
 +
| align="center" | 1 KB (ATmega328)
 +
|- style="font-size: 90%"
 +
| align="center" |Clock Speed
 +
| align="center" | 16 MHz
 +
|}
 +
 
 +
==Features==
 +
 
 +
*UNO+SIM808,TWO in one board;
 +
*Flat DC Jack.
 +
*Inherits all of Arduino Uno's features.
 +
*Compatible to Uno's pin layout, screw hole and dimensions.
 +
*Evolved with SMD components.
 +
*Quad-band 850/900/1800/1900MHz
 +
*GPRS mobile station class B
 +
*Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands)
 +
*Integrated GPS/CNSS and supports A-GPS
 +
*Low power consumption, 1mA in sleep mode
 +
*Supports GPS NMEA protocol
 +
*Standard Micro SIM Card
 +
*GPRS multi-slot class12 connectivity: max. 85.6kbps(down-load/up-load)
 +
*Indicator LEDs for power and network connectivity
 +
*uFL connection for external passive GPS & external GSM antenna
 +
*Any standard 2G SIM slides into a secure connector
 +
*Standard 4-pole TRRS headphone jack. Use any 'Android' or 'iPhone'-compatible headset with mic
 +
*Dimensions(mm):70.0(L)x55.0(W)x14.0(H)
 +
 
 +
==Interface Function==
 +
[[File:SIMduino intefgfrface1.jpg ||600px]]
 +
 
 +
===Connectors===
 +
JST 2-PIN: This is the battery input connector.(3.3-5V)<BR>
 +
MiniUSB connector:Arduino IDE Programming port.<br>
 +
Headset jack:This is a 'standard' TRRS 3.5mm phone headset jack with stereo earphone and mono microphone.
 +
===Antenna ports===
 +
There is two antenna inferface in the board,"GSM" where you can plug your GSM antennea and "GPS" connect the GPS antenna.
 +
===SIM Connector (on Back)===
 +
A 2G Micro SIM card is required to use the module. Nearly any cell phone shop can sell you a SIM card. It must be a 2G GSM card. AT&T in the US does not sell these anymore!
 +
===LEDs===
 +
PWR:RED<br>
 +
NET:Orange!You can use this for checking the current state without sending an AT command:<br>
 +
--64ms on, 800ms off - the module is running but hasn't made connection to the cellular network yet<br>
 +
--64ms on, 3 seconds off - the module has made contact with the cellular network and can send/receive voice and SMS<br>
 +
--64ms on, 300ms off - the GPRS data connection you requested is active<br>
 +
--By watching the blinks you can get a visual feedback on whats going on<br>
 +
STA:Blue!Lit when the SIM808 module is booted and running.<BR>
 +
 
 +
==The Usage of UNO==
 +
The usage of SIMduino is same as the Arduino UNO:
 +
 
 +
==The Usage of SIM808==
 +
===Attaching Antenna===
 +
GPS antenna and GSM antenna is required!<br>
 +
[[file:SIM808 Antenna.jpg|500 px]]
 +
===SIM Card===
 +
You must insert a SIM card to do anything but the most basic tests. GPS does work without a SIM but of course you cannot send or receive texts, calls, etc!<br>
 +
The SIM card holder is on the back. It holds a very-standard "Micro SIM",Mini SIMs will not work! Make sure you get a "Micro SIM".<br>
 +
[[file:SIM808 SIMddd card.jpg|500 px]]
 +
 
 +
===Connect the USB and DC power===
 +
Due to the SIM808 power up need more than 2.5A current, you need to connect a DC power to it.<br>
 +
[[file:usb connect.jpg|500 px]]
 +
===Power the SIM808===
 +
Press the KEY more than 3S, the STA LED will light up and the NET LED will blink.<br>
 +
[[file:power sim808.jpg|500 px]]
 +
 
 +
==Arduino Test==
 +
==== Making a call: using Software UART ====
 +
1.Copy the demo code as bellow and paste it in the IDE.<br>
 +
[[file:SIM808 Picture12.jpg|500 px]]<br>
 +
 
 +
2.Upload to your Arduino wired up to the moduleOnce uploaded to your Arduino, open up the serial console at 115200 baud speed to begin the tester sketch.<br>
 +
<pre>
 +
#include <SoftwareSerial.h>
 +
SoftwareSerial 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());
  
*LCD Driver: ILI9341
 
*Backlight controllable
 
*65535 rich colors
 
*SPI Communication
 
*Voltage:4.8~5.5 V
 
*Max Current: 200 mA
 
*Resolution:320x 240
 
*LCD Panel Size: 2.8”
 
*Touch Mode: Resistance
 
*Dimensions(mm):72.0(L)x14.5(W)x55.0(H)
 
  
== Cautions  ==
+
delay(10000);
 +
delay(10000);
  
*Please Be careful to deposit the fragile scree,pressing too hard on the screen might cause display damage.<br>
+
mySerial.println("ATH"); //End the call.
 +
if(mySerial.available())
  
== Pins usage on Arduino  ==
+
Serial.print((unsigned char)mySerial.read());
{| style="width: 609px; height: 215px" border="1" cellspacing="0"
+
}
| style="width: 40%" scope="col" align="center"| '''Function'''
 
| scope="col" align="center"| '''Pin Name'''
 
| scope="col" align="center"| '''Arduino pin'''
 
| scope="col" align="center"| '''Description'''
 
|-
 
|rowspan=4 align="center"| '''TFT Screen Control'''
 
|align="center"| TF_CS
 
|align="center"| D4
 
|align="center"| SD card select input
 
|-
 
|align="center"| TFT_CS
 
|align="center"| D5
 
|align="center"| TFT chip select input
 
|-
 
|align="center"| TFT_D/C
 
|align="center"| D6
 
|align="center"| TFT Data/Command control
 
|-
 
|align="center"| BACKLIGHT
 
|align="center"| D7
 
|align="center"| TFT backlight control pin
 
|-
 
|rowspan=3 align="center"| '''TFT SPI Interface'''
 
|align="center"| SPI_MOSI
 
|align="center"| D11
 
|align="center"| SPI data pin MOSI
 
|-
 
|align="center"| SPI_MISO
 
|align="center"| D12
 
|align="center"| SPI data pin MISO
 
|-
 
|align="center"| SPI_SCK
 
|align="center"| D13
 
|align="center"| SPI Clock Pin SCK
 
|-
 
|rowspan=4 align="center"| '''Touch Interface'''
 
|align="center"| ADC0
 
|align="center"| A0
 
|align="center"| Touch Screen Y- input
 
|-
 
|align="center"| ADC1
 
|align="center"| A1
 
|align="center"| Touch Screen X- input
 
|-
 
|align="center"| ADC2
 
|align="center"| A2
 
|align="center"| Touch Screen Y+ input
 
|-
 
|align="center"| ADC3
 
|align="center"| A3
 
|align="center"| Touch Screen X+ input
 
  
|}
 
  
== Usage  ==
+
void loop()
=== Hardware connection ===
+
{
Plug 2.8'' TFT Touch Shileld into Arduino or Crowduino.<br>
+
//Do nothing
Connect Arduino to PC via a USB cable.<br>
+
}
[[File:TFT Touch Shileld hardware1.jpg |500px]]
+
</pre>
  
=== Program ===
+
===Sending SMS: using Software UART===
1.We suggest using the Seeedstudio TFT Library for this shield. please download them [https://www.elecrow.com/wiki/index.php?title=File:TFTTouch_Shield_demo_code.zip Demo code]<br>
 
<br>
 
2.Install the library to the Arduino IDE library to ''...\Arduino\libraries'', but please note that if you downloaded the library in .zip file, you should delete the "-master" in the library name when you unzip it, as the "-" can not be recognized in the Arduino Library.<br>
 
  
=== Draw Circle===
 
1.Open the code directly by the path:File -> Examples ->TFT_Touch_Shield_v2->drawCircle.<br>
 
 
<pre>
 
<pre>
#include <stdint.h>
+
 
#include <TFTv2.h>
+
#include <SoftwareSerial.h>
#include <SPI.h>
+
 
 +
SoftwareSerial mySerial(7, 8);
  
 
void setup()
 
void setup()
 
{
 
{
    TFT_BL_ON;                                         //turn on the background light
+
mySerial.begin(19200);  //Default serial port setting for the GPRS modem is 19200bps 8-N-1
   
+
mySerial.print("\r");
    Tft.TFTinit();                                     //init TFT library           
+
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 \"
  
    Tft.drawCircle(100, 100, 30,YELLOW);               //center: (100, 100), r = 30 ,color : YELLOW             
+
mySerial.print("AT+CMGS=\"+9184460xxxx\"\r");   //Start accepting the text for the message
   
+
//to be sent to the number specified.
    Tft.drawCircle(100, 200, 40,CYAN);                 //center: (100, 200), r = 10 ,color : CYAN 
+
//Replace this number with the target mobile number.
   
+
delay(1000);
    Tft.fillCircle(200, 100, 30,RED);                   //center: (200, 100), r = 30 ,color : RED   
+
mySerial.print("Hello,Elecrow!\r");   //The text for the message
   
+
delay(1000);
    Tft.fillCircle(200, 200, 30,BLUE);                 //center: (200, 200), r = 30 ,color : BLUE               
+
mySerial.write(0x1A); //Equivalent to sending Ctrl+Z
 
}
 
}
  
 
void loop()
 
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.
 
}
 
}
 
</pre>
 
</pre>
2.Upload the code,you will see that.<br>
 
[[File:TFT Touch Shileld display1.jpg |500px]]
 
  
=== Touch Screen===
+
=== Using Sms to Control an LED Status ===
1.Open the code directly by the path:File -> Examples ->Touch_Screen_Driver->touchScreen.<br>
+
 
 +
This example is controbuted by MChobby, for more information please visit: https://wiki.mchobby.be/index.php?title=SmsCommand
 +
 
 +
Send a SMS message "on" or "off" from your cellphone to the GPRS Shield to control the Digital Pin 13(LED) Status.
 +
<font color="red">
 +
 
 +
* The default Buffer of Rx in SoftwareSerial.h is 32/64, you may experience some data lose while the returns of SIM808 are many(Receiving SMS/TCPIP), you can try to change the Buffer of Rx in SoftwareSerial.h into
 +
'''#define _SS_MAX_RX_BUFF''' ''128'' // RX buffer size
 +
</font>
 +
 
 
<pre>
 
<pre>
#include <stdint.h>
 
#include <SeeedTouchScreen.h>
 
  
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) // mega
+
#include <SoftwareSerial.h>
#define YP A2  // must be an analog pin, use "An" notation!
+
#define XM A1  // must be an analog pin, use "An" notation!
+
SoftwareSerial mySerial(7, 8);
#define YM 54  // can be a digital pin, this is A0
+
#define XP 57  // can be a digital pin, this is A3
+
// EN: String buffer for the GPRS shield message
  
#elif defined(__AVR_ATmega32U4__) // leonardo
+
String msg = String("");
#define YP A2  // must be an analog pin, use "An" notation!
+
// EN: Set to 1 when the next GPRS shield message will contains the SMS message
#define XM A1  // must be an analog pin, use "An" notation!
 
#define YM 18  // can be a digital pin, this is A0
 
#define XP 21  // can be a digital pin, this is A3
 
  
#else //168, 328, something else
+
int SmsContentFlag = 0;
#define YP A2  // must be an analog pin, use "An" notation!
+
#define XM A1  // must be an analog pin, use "An" notation!
+
// EN: Pin of the LED to turn ON and OFF depending on the received message
#define YM 14  // can be a digital pin, this is A0
 
#define XP 17  // can be a digital pin, this is A3
 
  
#endif
+
int ledPin = 13;
 +
 +
// EN: Code PIN of the SIM card (if applied)
  
//Measured ADC values for (0,0) and (210-1,320-1)
+
//String SIM_PIN_CODE = String( "XXXX" );
//TS_MINX corresponds to ADC value when X = 0
+
//TS_MINY corresponds to ADC value when Y = 0
+
void setup()
//TS_MAXX corresponds to ADC value when X = 240 -1
+
{
//TS_MAXY corresponds to ADC value when Y = 320 -1
+
  mySerial.begin(19200);              // the GPRS baud rate 
 +
  Serial.begin(19200);                // the GPRS baud rate
 +
 +
  // Initialize la PIN
 +
  pinMode( ledPin, OUTPUT );
 +
  digitalWrite( ledPin, LOW );
 +
}
 +
 +
void loop()
 +
{
 +
    char SerialInByte;
 +
 +
    if(Serial.available())
 +
    {
 +
      mySerial.print((unsigned char)Serial.read());
 +
    } 
 +
    else  if(mySerial.available())
 +
    {
 +
        char SerialInByte;
 +
        SerialInByte = (unsigned char)mySerial.read();
 +
 +
        // EN: Relay to Arduino IDE Monitor
 +
 
 +
        Serial.print( SerialInByte );
 +
 +
        // -------------------------------------------------------------------
 +
        // EN: Program also listen to the GPRS shield message.
 +
 
 +
        // -------------------------------------------------------------------
 +
 +
        // EN: If the message ends with <CR> then process the message
 +
     
 +
        if( SerialInByte == 13 ){
 +
          // EN: Store the char into the message buffer
 +
       
 +
          ProcessGprsMsg();
 +
        }
 +
        if( SerialInByte == 10 ){
 +
            // EN: Skip Line feed
  
#define TS_MINX 116*2
+
        }
#define TS_MAXX 890*2
+
        else {
#define TS_MINY 83*2
+
          // EN: store the current character in the message string buffer
#define TS_MAXY 913*2
+
 +
          msg += String(SerialInByte);
 +
        }
 +
    } 
 +
}
 +
 +
// EN: Make action based on the content of the SMS.
 +
//    Notice than SMS content is the result of the processing of several GPRS shield messages.
  
 +
void ProcessSms( String sms ){
 +
  Serial.print( "ProcessSms for [" );
 +
  Serial.print( sms );
 +
  Serial.println( "]" );
 +
 +
  if( sms.indexOf("on") >= 0 ){
 +
    digitalWrite( ledPin, HIGH );
 +
    Serial.println( "LED IS ON" );
 +
    return;
 +
  }
 +
  if( sms.indexOf("off") >= 0 ){
 +
    digitalWrite( ledPin, LOW );
 +
    Serial.println( "LED IS OFF" );
 +
    return;
 +
  }
 +
}
 +
 +
// EN: Send the SIM PIN Code to the GPRS shield
  
// For better pressure precision, we need to know the resistance
+
//void GprsSendPinCode(){
// between X+ and X- Use any multimeter to read it
+
//  if( SIM_PIN_CODE.indexOf("XXXX")>=0 ){
// The 2.8" TFT Touch shield has 300 ohms across the X plate
+
//    Serial.println( "*** OUPS! you did not have provided a PIN CODE for your SIM CARD. ***" );
TouchScreen ts = TouchScreen(XP, YP, XM, YM);
+
//    Serial.println( "*** Please, define the SIM_PIN_CODE variable . ***" );
 +
//    return;
 +
// }
 +
// mySerial.print("AT+CPIN=");
 +
// mySerial.println( SIM_PIN_CODE );
 +
}
 +
 +
// EN: Request Text Mode for SMS messaging
  
void setup(void) {
+
void GprsTextModeSMS(){
   Serial.begin(9600);
+
  mySerial.println( "AT+CMGF=1" );
 +
}
 +
 +
void GprsReadSmsStore( String SmsStorePos ){
 +
   // Serial.print( "GprsReadSmsStore for storePos " );
 +
  // Serial.println( SmsStorePos );
 +
  mySerial.print( "AT+CMGR=" );
 +
  mySerial.println( SmsStorePos );
 
}
 
}
 +
 +
// EN: Clear the GPRS shield message buffer
  
void loop(void) {
+
void ClearGprsMsg(){
   // a point object holds x y and z coordinates
+
   msg = "";
  Point p = ts.getPoint();
+
}
 +
 +
// EN: interpret the GPRS shield message and act appropiately
  
   if (p.z > __PRESURE) {
+
void ProcessGprsMsg() {
    Serial.print("Raw X = "); Serial.print(p.x);
+
   Serial.println("");
     Serial.print("\tRaw Y = "); Serial.print(p.y);
+
  Serial.print( "GPRS Message: [" );
     Serial.print("\tPressure = "); Serial.println(p.z);
+
  Serial.print( msg );
 +
  Serial.println( "]" );
 +
 +
//  if( msg.indexOf( "+CPIN: SIM PIN" ) >= 0 ){
 +
//    Serial.println( "*** NEED FOR SIM PIN CODE ***" );
 +
//    Serial.println( "PIN CODE *** WILL BE SEND NOW" );
 +
//    GprsSendPinCode();
 +
//  }
 +
 +
  if( msg.indexOf( "Call Ready" ) >= 0 ){
 +
    Serial.println( "*** GPRS Shield registered on Mobile Network ***" );
 +
    GprsTextModeSMS();
 +
  }
 +
 +
  // EN: unsolicited message received when getting a SMS message
 +
  // FR: Message non sollicité quand un SMS arrive
 +
  if( msg.indexOf( "+CMTI" ) >= 0 ){
 +
     Serial.println( "*** SMS Received ***" );
 +
    // EN: Look for the coma in the full message (+CMTI: "SM",6)
 +
    //    In the sample, the SMS is stored at position 6
 +
    int iPos = msg.indexOf( "," );
 +
    String SmsStorePos = msg.substring( iPos+1 );
 +
     Serial.print( "SMS stored at " );
 +
    Serial.println( SmsStorePos );
 +
 +
    // EN: Ask to read the SMS store
 +
    GprsReadSmsStore( SmsStorePos );
 
   }
 
   }
 
 
 
   
 
   
   p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
+
   // EN: SMS store readed through UART (result of GprsReadSmsStore request)
   p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
+
   if( msg.indexOf( "+CMGR:" ) >= 0 ){
 
+
    // EN: Next message will contains the BODY of SMS
  // we have some minimum pressure we consider 'valid'
+
    SmsContentFlag = 1;
  // pressure of 0 means no pressing!
+
    // EN: Following lines are essentiel to not clear the flag!
  if (p.z > __PRESURE) {
+
    ClearGprsMsg();
    Serial.print("X = "); Serial.print(p.x);
+
    return;
    Serial.print("\tY = "); Serial.print(p.y);
 
    Serial.print("\tPressure = "); Serial.println(p.z);
 
 
   }
 
   }
 +
 +
  // EN: +CMGR message just before indicate that the following GRPS Shield message
 +
  //    (this message) will contains the SMS body
  
   delay(100);
+
   if( SmsContentFlag == 1 ){
 +
    Serial.println( "*** SMS MESSAGE CONTENT ***" );
 +
    Serial.println( msg );
 +
    Serial.println( "*** END OF SMS MESSAGE ***" );
 +
    ProcessSms( msg );
 +
  }
 +
 +
  ClearGprsMsg();
 +
  // EN: Always clear the flag
 +
 
 +
  SmsContentFlag = 0;
 +
}
 +
</pre>
 +
 
 +
==The usage of GPS Function==
 +
=== Print the GPS(GNSS) data with serial port ===
 +
 
 +
===AT Commands Examples===
 +
[[File:SIM808 GPRS_GSM_GPS Shield v1.1 GNSS AT.jpg|800px]]
 +
 
 +
Demo code of get the GPS information:
 +
<pre>
 +
#include <SoftwareSerial.h>
 +
#include<stdio.h>
 +
#include<string.h>
 +
#define DEBUG true
 +
 
 +
 
 +
SoftwareSerial mySerial(7,8);
 +
       
 +
void setup()
 +
{
 +
  Serial.begin(9600);
 +
mySerial.begin(9600);  
 
}
 
}
</PRE>
+
 
2.Upload the code,then open the serial monitor and touch the screen,you will see some information.<br>
+
void loop()
[[File:TFT Touch Shileld display2.jpg |500px]]
+
{
 +
  getgps();
 +
  while(1)
 +
  {
 +
        sendData( "AT+CGNSINF",1000,DEBUG); 
 +
        delay(1000);
 +
       
 +
  }
 +
 +
}
 +
void getgps(void)
 +
{
 +
  sendData( "AT+CGNSPWR=1",1000,DEBUG);
 +
  sendData( "AT+CGNSSEQ=RMC",1000,DEBUG);
 +
}
 +
 
 +
 
 +
String sendData(String command, const int timeout, boolean debug)
 +
{
 +
    String response = "";   
 +
    mySerial.println(command);
 +
    long int time = millis(); 
 +
    while( (time+timeout) > millis())
 +
    {
 +
      while(mySerial.available())
 +
      {     
 +
        char c = mySerial.read();
 +
        response+=c;
 +
      } 
 +
    }   
 +
    if(debug)
 +
    {
 +
      Serial.print(response);
 +
    }   
 +
    return response;
 +
}
 +
 
 +
</pre>
 +
 
 +
The result of get the GPS information.
 +
 
 +
[[File:SIM808 GPRS_GSM_GPS Shield v1.1 GNSS code.jpg|500px]]
  
 
== Resources  ==
 
== Resources  ==
This TFT Shield uses the ILI9341 Driver IC, thanks to the Seeed TFT library, It works OK on this TFT Touch Shiled:
+
https://www.elecrow.com/wiki/index.php?title=File:Elecrow_Simduino_v2.2_eagle_file.zip
*[https://github.com/Seeed-Studio/TFT_Touch_Shield_V2 SeeedTFTV2.0 Library for Arduino 1.0]
+
 
*[https://github.com/Seeed-Studio/Touch_Screen_Driver SeeedTouchScreen Library for Arduino 1.0]<br>
+
==Support==
 +
If you have any problem about how to use it, you can connect to us at [http://www.elecrow.com/ the bottom-right of bazzer] or contact to  '''techsupport@elecrow.com '''to get technology support.

Revision as of 06:32, 1 April 2022

Description

The Elecrow Simduino combines Arduino uno and sim808 module. It will save more cost and space for your project and easier to build other modules. It not only by DC power supply, we have designed a battery interface for it, you can also use a 3.7V lithium battery to power it. Whether you want to get a Arduino or a SIM808 module, even start a SIM808 related application that base on Arduino. It will make your satisfaction. Come on and add it to your shopping cart.

Same as the Arduino UNO, the SIMduino also has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, a reset button, and of course a Mini USB cable, simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.

Model: ACM12425E

Simduinodd fem.JPG

Summary

Microcontroller ATmega328
Operating Voltage 5v
Input Voltage (recommended) 3.3-5V
Input Voltage (limits) < 5V
Digital I/O Pins 14 (of which 6PINs provide PWM output)
Analog Input Pins 8
DC Current per I/O Pin 40mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz

Features

  • UNO+SIM808,TWO in one board;
  • Flat DC Jack.
  • Inherits all of Arduino Uno's features.
  • Compatible to Uno's pin layout, screw hole and dimensions.
  • Evolved with SMD components.
  • Quad-band 850/900/1800/1900MHz
  • GPRS mobile station class B
  • Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands)
  • Integrated GPS/CNSS and supports A-GPS
  • Low power consumption, 1mA in sleep mode
  • Supports GPS NMEA protocol
  • Standard Micro SIM Card
  • GPRS multi-slot class12 connectivity: max. 85.6kbps(down-load/up-load)
  • Indicator LEDs for power and network connectivity
  • uFL connection for external passive GPS & external GSM antenna
  • Any standard 2G SIM slides into a secure connector
  • Standard 4-pole TRRS headphone jack. Use any 'Android' or 'iPhone'-compatible headset with mic
  • Dimensions(mm):70.0(L)x55.0(W)x14.0(H)

Interface Function

600px

Connectors

JST 2-PIN: This is the battery input connector.(3.3-5V)
MiniUSB connector:Arduino IDE Programming port.
Headset jack:This is a 'standard' TRRS 3.5mm phone headset jack with stereo earphone and mono microphone.

Antenna ports

There is two antenna inferface in the board,"GSM" where you can plug your GSM antennea and "GPS" connect the GPS antenna.

SIM Connector (on Back)

A 2G Micro SIM card is required to use the module. Nearly any cell phone shop can sell you a SIM card. It must be a 2G GSM card. AT&T in the US does not sell these anymore!

LEDs

PWR:RED
NET:Orange!You can use this for checking the current state without sending an AT command:
--64ms on, 800ms off - the module is running but hasn't made connection to the cellular network yet
--64ms on, 3 seconds off - the module has made contact with the cellular network and can send/receive voice and SMS
--64ms on, 300ms off - the GPRS data connection you requested is active
--By watching the blinks you can get a visual feedback on whats going on
STA:Blue!Lit when the SIM808 module is booted and running.

The Usage of UNO

The usage of SIMduino is same as the Arduino UNO:

The Usage of SIM808

Attaching Antenna

GPS antenna and GSM antenna is required!
SIM808 Antenna.jpg

SIM Card

You must insert a SIM card to do anything but the most basic tests. GPS does work without a SIM but of course you cannot send or receive texts, calls, etc!
The SIM card holder is on the back. It holds a very-standard "Micro SIM",Mini SIMs will not work! Make sure you get a "Micro SIM".
SIM808 SIMddd card.jpg

Connect the USB and DC power

Due to the SIM808 power up need more than 2.5A current, you need to connect a DC power to it.
Usb connect.jpg

Power the SIM808

Press the KEY more than 3S, the STA LED will light up and the NET LED will blink.
Power sim808.jpg

Arduino Test

Making a call: using Software UART

1.Copy the demo code as bellow and paste it in the IDE.
SIM808 Picture12.jpg

2.Upload to your Arduino wired up to the moduleOnce uploaded to your Arduino, open up the serial console at 115200 baud speed to begin the tester sketch.

#include <SoftwareSerial.h>
SoftwareSerial 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
}

Sending SMS: using Software UART


#include <SoftwareSerial.h>

SoftwareSerial 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("Hello,Elecrow!\r");   //The text for the message
delay(1000);
mySerial.write(0x1A);  //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.
}

Using Sms to Control an LED Status

This example is controbuted by MChobby, for more information please visit: https://wiki.mchobby.be/index.php?title=SmsCommand

Send a SMS message "on" or "off" from your cellphone to the GPRS Shield to control the Digital Pin 13(LED) Status.

  • The default Buffer of Rx in SoftwareSerial.h is 32/64, you may experience some data lose while the returns of SIM808 are many(Receiving SMS/TCPIP), you can try to change the Buffer of Rx in SoftwareSerial.h into

#define _SS_MAX_RX_BUFF 128 // RX buffer size


#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(7, 8);
 
// EN: String buffer for the GPRS shield message

String msg = String("");
// EN: Set to 1 when the next GPRS shield message will contains the SMS message

int SmsContentFlag = 0;
 
// EN: Pin of the LED to turn ON and OFF depending on the received message

int ledPin = 13;
 
// EN: Code PIN of the SIM card (if applied)

//String SIM_PIN_CODE = String( "XXXX" );
 
void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);                 // the GPRS baud rate
 
  // Initialize la PIN
  pinMode( ledPin, OUTPUT ); 
  digitalWrite( ledPin, LOW ); 
}
 
void loop()
{
    char SerialInByte;
 
    if(Serial.available())
    {
       mySerial.print((unsigned char)Serial.read());
     }  
    else  if(mySerial.available())
    {
        char SerialInByte;
        SerialInByte = (unsigned char)mySerial.read();
 
        // EN: Relay to Arduino IDE Monitor
   
        Serial.print( SerialInByte );
 
        // -------------------------------------------------------------------
        // EN: Program also listen to the GPRS shield message.
   
        // -------------------------------------------------------------------
 
        // EN: If the message ends with <CR> then process the message
       
        if( SerialInByte == 13 ){
          // EN: Store the char into the message buffer
        
          ProcessGprsMsg();
         }
         if( SerialInByte == 10 ){
            // EN: Skip Line feed

         }
         else {
           // EN: store the current character in the message string buffer
 
           msg += String(SerialInByte);
         }
     }   
}
 
// EN: Make action based on the content of the SMS. 
//     Notice than SMS content is the result of the processing of several GPRS shield messages.

void ProcessSms( String sms ){
  Serial.print( "ProcessSms for [" );
  Serial.print( sms );
  Serial.println( "]" );
 
  if( sms.indexOf("on") >= 0 ){
    digitalWrite( ledPin, HIGH );
    Serial.println( "LED IS ON" );
    return;
  }
  if( sms.indexOf("off") >= 0 ){
    digitalWrite( ledPin, LOW );
    Serial.println( "LED IS OFF" );
    return;
  }
}
 
// EN: Send the SIM PIN Code to the GPRS shield

//void GprsSendPinCode(){
//  if( SIM_PIN_CODE.indexOf("XXXX")>=0 ){
//    Serial.println( "*** OUPS! you did not have provided a PIN CODE for your SIM CARD. ***" );
//    Serial.println( "*** Please, define the SIM_PIN_CODE variable . ***" );
//    return;
// }
//  mySerial.print("AT+CPIN=");
// mySerial.println( SIM_PIN_CODE );
}
 
// EN: Request Text Mode for SMS messaging

void GprsTextModeSMS(){
  mySerial.println( "AT+CMGF=1" );
}
 
void GprsReadSmsStore( String SmsStorePos ){
  // Serial.print( "GprsReadSmsStore for storePos " );
  // Serial.println( SmsStorePos ); 
  mySerial.print( "AT+CMGR=" );
  mySerial.println( SmsStorePos );
}
 
// EN: Clear the GPRS shield message buffer

void ClearGprsMsg(){
  msg = "";
}
 
// EN: interpret the GPRS shield message and act appropiately

void ProcessGprsMsg() {
  Serial.println("");
  Serial.print( "GPRS Message: [" );
  Serial.print( msg );
  Serial.println( "]" );
 
//  if( msg.indexOf( "+CPIN: SIM PIN" ) >= 0 ){
//     Serial.println( "*** NEED FOR SIM PIN CODE ***" );
 //    Serial.println( "PIN CODE *** WILL BE SEND NOW" );
 //    GprsSendPinCode();
//  }
 
  if( msg.indexOf( "Call Ready" ) >= 0 ){
     Serial.println( "*** GPRS Shield registered on Mobile Network ***" );
     GprsTextModeSMS();
  }
 
  // EN: unsolicited message received when getting a SMS message
  // FR: Message non sollicité quand un SMS arrive
  if( msg.indexOf( "+CMTI" ) >= 0 ){
     Serial.println( "*** SMS Received ***" );
     // EN: Look for the coma in the full message (+CMTI: "SM",6)
     //     In the sample, the SMS is stored at position 6
     int iPos = msg.indexOf( "," );
     String SmsStorePos = msg.substring( iPos+1 );
     Serial.print( "SMS stored at " );
     Serial.println( SmsStorePos );
 
     // EN: Ask to read the SMS store
     GprsReadSmsStore( SmsStorePos );
  }
 
  // EN: SMS store readed through UART (result of GprsReadSmsStore request)  
  if( msg.indexOf( "+CMGR:" ) >= 0 ){
    // EN: Next message will contains the BODY of SMS
    SmsContentFlag = 1;
    // EN: Following lines are essentiel to not clear the flag!
    ClearGprsMsg();
    return;
  }
 
  // EN: +CMGR message just before indicate that the following GRPS Shield message 
  //     (this message) will contains the SMS body

  if( SmsContentFlag == 1 ){
    Serial.println( "*** SMS MESSAGE CONTENT ***" );
    Serial.println( msg );
    Serial.println( "*** END OF SMS MESSAGE ***" );
    ProcessSms( msg );
  }
 
  ClearGprsMsg();
  // EN: Always clear the flag

  SmsContentFlag = 0; 
}

The usage of GPS Function

Print the GPS(GNSS) data with serial port

AT Commands Examples

800px

Demo code of get the GPS information:

#include <SoftwareSerial.h>
#include<stdio.h>
#include<string.h>
#define DEBUG true


SoftwareSerial mySerial(7,8); 
        
void setup()
{
  Serial.begin(9600);
 mySerial.begin(9600); 
}

void loop()
{
   getgps();
   while(1)
   {
        sendData( "AT+CGNSINF",1000,DEBUG);   
        delay(1000);
        
   }
 
}
void getgps(void)
{
   sendData( "AT+CGNSPWR=1",1000,DEBUG); 
   sendData( "AT+CGNSSEQ=RMC",1000,DEBUG); 
}


String sendData(String command, const int timeout, boolean debug)
{
    String response = "";    
    mySerial.println(command); 
    long int time = millis();   
    while( (time+timeout) > millis())
    {
      while(mySerial.available())
      {       
        char c = mySerial.read(); 
        response+=c;
      }  
    }    
    if(debug)
    {
      Serial.print(response);
    }    
    return response;
}

The result of get the GPS information.

SIM808 GPRS GSM GPS Shield v1.1 GNSS code.jpg

Resources

https://www.elecrow.com/wiki/index.php?title=File:Elecrow_Simduino_v2.2_eagle_file.zip

Support

If you have any problem about how to use it, you can connect to us at the bottom-right of bazzer or contact to techsupport@elecrow.com to get technology support.