Leonardo + GPRS GSM IOT Board

The Leonardo GPRS/GSM IOT Board to provide your project a way of convenient remote control, It’s widely used in remote control, telemetry, communication, automatic control and so on. It can receive phone calls and text message to control the relay ON or OFF. What more, this boards have four relay so that it can control several appliances at the same time.

Meanwhile, this board serves as the main control system applied to smart homes. Not only that, it uses the SIM808. It can also be used by Arduino/Crowduino to realize the operation of other modules.

Quick Spec

  • GPRS/GSM function
  • Standard Micro SIM Card (SIM CARD NOT INCLUDED)
  • Power Interface:USB,DC
  • Working Frequency: 16MHz
  • Compliant to GSM phase 2/2+
  • Supports 3.0V to 5.0V logic level
  • Microcontroller: ATmega32u4,8-bit AVR MCU
  • Low power consumption, 1mA in sleep mode
  • Supports load: DC/AC maximum current:2A AC:100~240V
  • Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands).
  • Quad-Band 850 / 900/ 1800 / 1900 MHz - would work on GSM networks in all countries across the world.
  • Class 4 (2 W @ 850 / 900 MHz)
  • Class 1 (1 W @ 1800 / 1900MHz)
  • Current Supply: 2A
  • USB: 5V
  • Power Supply:
    • Min.: 7VDC
    • Max: 12VDC
  • Temperature: -30~+85oC
  • Board site: 9.5cm X 6.5cm

Silk Screen

900px_Leonardo_GPRSGSM_IOT_Board_cam350

Demo Code


/*
 * Author: Elecrow Keen
 * Date:6/30/2017
 * IDE V1.8.2 
 * Email:keen@elecrow.com    
 * Function: SMS control relay
 * Please note:
    When the the board receive "R1O" by SMS, the relay 1 will be open and the "R1C" that it will be close. 
    
    "R1O"/""R1C" means:
      R ->  Relay
      1 ->  Relay 1 
      O ->  Open
      C ->  Close
      
    It also used Relay2,Relay3 and Relay4.
 */

#define DEBUG true    //Open the debug information 

 // the number of the Relay pin
const int Relay1 = 2;
const int Relay2 = 3;
const int Relay3 = 4;
const int Relay4 = 5;
/*
R1O means open  relay 1
R1C means close relay 1
The same as others 
*/
String R1O = "R1O";
String R1C = "R1C";
String R2O = "R2O";
String R2C = "R2C";
String R3O = "R3O";
String R3C = "R3C";
String R4O = "R4O";
String R4C = "R4C";

char target[] ="CMTI";  
int sms_no;
String get_message = "";   

void setup() {  
      Serial.begin(19200); 
      Serial1.begin(19200); 
      for(int i=2;i<6;i++){ // initialize the Relay pins status:
        pinMode(i,OUTPUT);
        digitalWrite(i,LOW);
      }
      //Power on the SIM800C
      
      pinMode(9,OUTPUT);
      digitalWrite(9,HIGH);
      delay(3000);
      digitalWrite(9,LOW);
      delay(1000);
      
      sendData("AT",2000,DEBUG);
      sendData("AT+CMGF=1",1000,DEBUG);        //Set the SMS in text mode
} 

void loop() { 
       if(Serial1.available()>0){
        Serial.write(Serial1.read());
            
          if(Serial1.find(target)){                  //If receive a new SMS
             sms_no = Serial1.parseInt();            //Get the SMS ID        
             get_message = "AT+CMGR="+(String)sms_no; //The command of the content of the SMS
             Serial.println("******************** Print the relay status *********************" );
             Data_handling(get_message,500,DEBUG);    //Get the content of the SMS 
             Serial.println("*****************************END*********************************" );
         } 
         
     }
     while(Serial1.read() >= 0){}                     // Clear serial buffer   
}

void Data_handling(String command, const int timeout, boolean debug)  //data handling function
{
    String response = "";    
    Serial1.println(command); 
    long int time = millis();
    while( (time+timeout) > millis()){
      while(Serial1.available()){       
        response += (char)Serial1.read(); 
      }  
    }    
   if (response.indexOf(R1O)>=0) {
    digitalWrite(Relay1,HIGH);
    if(debug){
    Serial.println("Open Relay 1");
    }
    }
   else if (response.indexOf(R1C)>=0) {
    digitalWrite(Relay1,LOW);
    if(debug){
    Serial.println("Close Relay 1");
    }
   }
   else if(response.indexOf(R2O)>=0) {
    digitalWrite(Relay2,HIGH);
    if(debug){
    Serial.println("Open Relay 2");
    }
   }
   else if(response.indexOf(R2C)>=0) {
    digitalWrite(Relay2,LOW);
    if(debug){
    Serial.println("Close Relay 2");
    }
   }
   else if (response.indexOf(R3O)>=0) {
    digitalWrite(Relay3,HIGH);
    if(debug){
    Serial.println("Open Relay 3");
    }
   }
   else if(response.indexOf(R3C)>=0) {
    digitalWrite(Relay3,LOW);
    if(debug){
    Serial.println("Close Relay 3");
    }
   }
   else if(response.indexOf(R4O)>=0) {
    digitalWrite(Relay4,HIGH);
    if(debug){
    Serial.println("Open Relay 4");
    }
   }
   else if(response.indexOf(R4C)>=0) {
    digitalWrite(Relay4,LOW);
    if(debug){
    Serial.println("Close Relay 4");
    }
   }else
   Serial.println("....Error message....");
}

void sendData(String command, const int timeout, boolean debug)  //Send command function
{
    String response = "";    
    Serial1.println(command); 
    long int time = millis();
    while( (time+timeout) > millis()){
      while(Serial1.available()){       
        response += (char)Serial1.read(); 
      }  
    }    
    if(debug){
      Serial.print(response);
    }    
}

Recommendation

10uF and 100uF over VCC and GND

Resources

Shipping List

  • 1 x Leonardo + GPRS GSM IOT Board
  • 1 x GSM Antenna


Leonardo + GPRS GSM IOT Board

  • Brand: Generic
  • Product Code: WCW07517B
  • Product Status : Active
  • Stock

    Warehouse Stock Status Location
    Centurion No Stock A SHELF
    Stellenbosch No Stock

    We ship free of charge between branches to complete your order.

  • R369.00 (Inc Tax: R424.35)


Related Products

Leonardo ETH W5500 POE - Active

Leonardo ETH W5500 POE - Active

Leonardo ETH W5500 POE - Active The Leonardo ETH is a fully featured Ethernet-connected device. Depending on your use case, it can act as a server or a net member. In a server role, it will receive r..

Centurion (No Stock)
Stellenbosch (No Stock)
Part No: 7D3C576A
Product Status : Active

R615.00 (Inc Tax: R707.25)

GSM Global IOT Sim - Data for Life

GSM Global IOT Sim - Data for Life

GSM Global Sim - Data for Life Data4Life is the first and only true lifetime Cellular data-plan that gives you access to over 230 Cellular networks in 105 countries for a single low once-off purcha..

Centurion (In Stock)
Stellenbosch (In Stock)
Bulk Location (No Stock)
Part No: IOT-SIM
Product Status : Active

R320.00 (Inc Tax: R368.00)

Tags: leonardo, gprs, gsm, iot, board, sim80