Home > Arduino > Arduino Shields Home > Sensor & Modules > Communication > GSM/GPRS/GPS/NB-IoT

Introduction

NB-IoT(Narrow Band-Internet of Things) technology is a new IoT technical branch and supports cellular data network connection of low power consumption device in WAN (Wide Area Network), which also called as LPWAN. NB-IoT operates in authorized frequency spectrum. It can be directly deployed to GSM, UMTS, LTE without any interference of current networks, while the bandwidth consumption is just about 180KHz.

This SIM7000 Arduino NB-IoT/LTE/GPRS expansion shield is a wireless communication module produced by DFRobot and the design is based on SIMCom SIM7000 chip. This wireless communication module is designed for Arduino controllers, supporting multi-frequency LTE-FDD communication, dual-frequency GPRS/EDGE communication, NB-IoT communication. No matter prototype developments or small-batch productions, SIM7000 Arduino NB-IoT/LTE/GPRS expansion shield is the best solution to applications of low power consumption, low latency and meddle-throughput. Besides onboard GNSS (Global Navigation Satellite System), SIM7000 supports American GPS, Russian GLONASS, European Galileo, Japanese QZSS and Chinese BeiDou Navigation Satellite System. It can be widely applied to IoT applications such as long distance control, moving tracking, long distance data uploading and shared bikes.

The SIM7000 Arduino NB-IoT/LTE/GPRS expansion shield supports both SIM card and NB-IoT card synchronously. You can plug in a common SIM card to achieve traditional GSM applications, such as make a phone call and send message. You can also plug in a NB-IoT card to realize NB-IoT data transmission. Besides, this expansion shield provides a BME280 environmental sensor. So it could be a prototype to develop NB-IoT projects, monitoring temperature, humidity and pressure.

warning_yellow.png NOTE: SIM7000C is common used with Chinese frequency band; SIM7000E is common used with European frequency band, please carefully check your Mobile Operator statement, and select the corresponding products.

Specification

Board Overview

NOTE:
Software/Hardware Serial Port Switch: Arduino UNO/Mega controllers connect USB with the hardware interface D0,D1 in default. So serial port conflicts are common when serial ports are used by the expansion shields. Considering these conflicts, SIM7000 Arduino NB-IoT/LTE/GPRS expansion shield equipped with a software serial port to communicate with Arduino. Learn more about Arduino SoftwareSerial Library.
Boot button connected to D12 in default to control program conveniently. You can pull up D12 for 2s to ON/OFF. SIM7000 ON will initialize to get ready to work in about 2s.

Tutorial*(Based on SIM7000 Library)*

Requirements

Connection Diagram

Plug the SIM7000 Arduino NB-IoT/LTE/GPRS Expansion Shield to DFRduino UNO R3 directly.

SIM7000 Arduino NB-IoT/LTE/GPRS Expansion Shield Connection Diagram

Sample Code

#include <Wire.h>
#include <DFRobot_SIM7000.h>

#define PIN_TX     7
#define PIN_RX     8
SoftwareSerial     mySerial(PIN_RX,PIN_TX);
DFRobot_SIM7000    sim7000;
static char        buff[350];

void setup(){
    int signalStrength,dataNum;
    Serial.begin(115200);
    sim7000.begin(mySerial);
    sim7000.turnOFF();
    delay(5000);
    Serial.println("Turn ON SIM7000......");
    if(sim7000.turnON()){                                                                      //Turn ON SIM7000
        Serial.println("Turn ON !");
    }
    Serial.println("Set baud rate......");
    if(sim7000.setBaudRate(19200)){                                                            //Set baud rate from 115200 to 19200
        Serial.println("Set baud rate:19200");
    }else{
        Serial.println("Faile to set baud rate");
        while(1);
    }
    Serial.println("Check SIM card......");
    if(sim7000.checkSIMStatus()){                                                              //Check SIM card
        Serial.println("SIM card READY");
    }else{
        Serial.println("SIM card ERROR");
        while(1);
    }
    delay(500);
    Serial.println("Set net mod......");
    if(sim7000.setNet(NB)){                                                                    //Set net mod NB-IOT
        Serial.println("Set NB-IOT mode");
    }else{
        Serial.println("Fail to set mode");
    }
    Serial.println("Get signal quality......");
    delay(500);
    signalStrength=sim7000.checkSignalQuality();                                               //Check signal quality from (0-30)
    Serial.print("signalStrength =");
    Serial.println(signalStrength);
    delay(500);
    Serial.println("Attaching service......");
    if(sim7000.attacthService()){                                                              //Open the connection
        Serial.println("Attach service");
    }else{
        Serial.println("Fail to Attach service");
        while(1);
    }
    delay(200);
    Serial.println("Connecting......");
    if(sim7000.connect(TCP,"www.taobao.com",80)){                                              //Start Up TCP or UDP Connection
        Serial.println("Connect OK");
    }else{
        Serial.println("Fail to connect");
        while(1);
    }
    sim7000.send("HEAD/HTTP/1.1\r\nHost:www.taobao.com\r\nConnection:keep-alive\r\n\r\n");     //Send Data Through TCP or UDP Connection
    dataNum=sim7000.recv(buff,350,0);                                                          //Receive data
    Serial.print("dataNum=");
    Serial.println(dataNum);
    Serial.println(buff);
    delay(500);
    if(sim7000.close()){                                                                       //End the connection
        Serial.println("Close connection");
    }else{
        Serial.println("Fail to close connection");
    }
    delay(2000);
    sim7000.turnOFF();                                                                         //Turn OFF SIM7000
}

void loop() {
    delay(1000);
}
begin(Stream &s_)
 turnON();
 turnOFF();
setBaudRate(int rate);
 checkSIMStatus();
setNet(Net net);
checkSignalQuality();
attacthService();
connect(Protocol ptl,const char *host, int port);
send(const char *str);
send(void* buf,size_t len);
recv(char* buf,int maxlen,int timeout);
close();

NBIOT-Project Display

Tutorial*(Based on AT Commands)*

Requirements

Same as SIM7000 library, please refers to the tutorial mentioned before.

Connection Diagram

Same as SIM7000 library, please refers to the tutorial mentioned before.

Sample Code

/*
  * File  : DFRobot_SIM7000_ATtest.ino
  * Power : SIM7000 needs 7-12V DC power supply
  * Brief : This example use the serial port to send AT command to control the SIM7000
  * With initialization completed, we can enter AT command to SIM7000 directly
  * Note  : If you use Mega please connect PIN8 PIN10 and set PIN_RX = 10
  * The AT command must end with CR&LF
  */
#include <DFRobot_SIM7000.h>

#define PIN_TX     7
#define PIN_RX     8
SoftwareSerial     mySerial(PIN_RX,PIN_TX);
DFRobot_SIM7000    sim7000;

void setup() {
    Serial.begin(115200);
    sim7000.begin(mySerial);
    sim7000.turnOFF();
    delay(5000);

    Serial.println("Turn ON SIM7000......");
    if(sim7000.turnON()){                             //Turn ON SIM7000
        Serial.println("Turn ON !");
    }

    Serial.println("Set baud rate......");
    if(sim7000.setBaudRate(19200)){                   //Set baud rate from 115200 to 19200
        Serial.println("Set baud rate:19200");
    }else{
        Serial.println("Faile to set baud rate");
        while(1);
    }

    mySerial.begin(19200);
    Serial.println("For example, if you type AT\\r\\n, OK\\r\\n will be responsed!");
    Serial.println("Enter your AT command :");
}

void loop() {
    mySerial.listen();
    while(mySerial.available()){
        Serial.write(mySerial.read());
    }

    mySerial.flush();
    while(Serial.available()){
        mySerial.write(Serial.read());
    }

    delay(20);
}

Input AT command to Uno serial port when the program runs and you can directly control SIM7000 with AT command. Click to download Series_AT Command Manual_V1.01.pdf AT command sheet. Common AT command Introduction:

Common AT command Introduction
command
AT+CNMP=?
AT+CMNB=?
AT+CSQ
AT+CGATT?
AT+CSTT
AT+CIFSR
AT+CIPSTART="ptl","host","port"
AT+CIPSEND="len"
AT+CIPCLOSE
AT+CIPSHUT

NBIOT-Project Display

Tutorial*(Get Position)*

Requirements

Same as SIM7000 library, please refers to the tutorial mentioned before.

Connection Diagram

Connect to an active antenna and use it outdoors.

Sample Code

#include <Wire.h>
#include <DFRobot_SIM7000.h>

DFRobot_SIM7000 sim7000;
SoftwareSerial  mySerial(8,7);                                     //Set serial

void setup(){
    int signalStrength,dataNum;
    Serial.begin(115200);
    sim7000.begin(mySerial);
    sim7000.turnOFF();
    delay(5000);
    if(sim7000.turnON()){                                          //Turn ON SIM7000
        Serial.println("Turn NO SIM7000");
    }
    if(sim7000.setBaudRate(19200)){                                //Set baud rate from 115200 to 19200
        Serial.println("Set baud rate:19200");
    }else{
        Serial.println("faile to set baud rate");
    }
    while(1){
        if(sim7000.init()){                                        //Init SIM7000
            Serial.println("AT command READY");
            break;
        }else{
            Serial.println("AT command ERROR");
            delay(500);
        }
    }
    while(1){
        if(sim7000.initPos()){
            Serial.println("Positioning function initialized");
            break;
        }else{
            Serial.println("Fail to init positioning function");
            delay(500);
        }
    }
}

void loop(){
    Serial.println("Enter anything to get positioning ");
    char loge[10];
    readSerial(loge);
    Serial.println("Getting position......");
    if(sim7000.getPosition()){                                     //Get the current position
        Serial.print("Longtude :");
        Serial.println(sim7000.getLongitude());                    //Get longitude
        Serial.print("Latitude :");
        Serial.println(sim7000.getLatitude());                     //Get latitude
    }else{
        Serial.println("Wrong data try again");
    }
}

int readSerial(char result[]){
    int i = 0;
    while(1){
        while(Serial.available() > 0){
            char inChar = Serial.read();
            if(inChar == '\n'){
                result[i] = '\0';
                Serial.flush();
                return 0;
            }
            if(inChar != '\r'){
                result[i] = inChar;
                i++;
            }
        }
    }
}
 initPos();
getPosition();
 getLongitude();
 getlatitude();

BME280 Environmental Data Monitoring

SIM7000 equipped with a BME280 environmental sensor, which recognize IIC connection in default. Please click to download the Arduino library file first before using.

Sample Code

/*!
 * @file basicTestI2C.ino
 * @brief DFRobot's Temperature、Pressure、Humidity and Approx altitude
 * @n [Get the module here]
 * @n This example read the Temperature、Pressure、Humidity and Altitude from BME280, and then print them
 * @n [Connection and Diagram]
 *
 * @copyright  [DFRobot](http://www.dfrobot.com), 2016
 * @copyright GNU Lesser General Public License
 *
 * @author [yangyang]
 * @version  V1.0
 * @date  2017-7-5
 */

#include <DFRobot_BME280.h>

#define SEA_LEVEL_PRESSURE  1013.25f
#define BME_CS 10

DFRobot_BME280 bme; //I2C

float temp, pa, hum, alt;

void setup() {
    Serial.begin(115200);

    // I2c default address is 0x76, if the need to change please modify bme.begin(Addr)
    if (!bme.begin()) {
        Serial.println("No sensor device found, check line or address!");
        while (1);
    }

    Serial.println("-- BME280 DEMO --");
}

void loop() {
  temp = bme.temperatureValue();
  pa = bme.pressureValue();
  hum = bme.humidityValue();
  alt = bme.altitudeValue(SEA_LEVEL_PRESSURE);

  Serial.print("Temp:");
  Serial.print(temp);
  Serial.println(" C");

  Serial.print("Pa:");
  Serial.print(pa);
  Serial.println(" Pa");

  Serial.print("Hum:");
  Serial.print(hum);
  Serial.println(" %");

  Serial.print("Alt:");
  Serial.print(alt);
  Serial.println(" m");

  Serial.println("------END------");

  delay(1000);
}
warning_yellow.png NOTE: DFRobot_BME280 bme // IIC sentence mentioned in the sample code is to initialize IIC drive.

SIM7000 Arduino NB-IoT/LTE/GPRS Expansion Shield IIC Adjustment

Compatibility Test

MCU Pass Failed Not Tested Remark
Arduino Uno
Arduino Leonardo
Arduino Mega1280 Connect D8 to D10
Arduino Mega2560 Connect D8 to D10

FAQ

Q1.Some general Arduino Problems/FAQ/Tips
A. Click the topic link on DFRobot Forum.
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get SIM7000C Arduino NB-IoT/LTE/GPRS Expansion Shield SKU: DFR0505 from DFRobot Store or DFRobot Distributor.

DFshopping_car1.png Get SIM7000E Arduino NB-IoT/LTE/GPRS Expansion Shield SKU: DFR0572 from DFRobot Store or DFRobot Distributor.