0

members

Easy Basics: Project 070b SIM900 GSM GPRS Quad-Band Development Board Shield, DHT 11 21 22 module

of Acoptex.com in UNO

Basics: Project 070b

Project name: SIM900 GSM GPRS Quad-Band Development Board Shield, DHT 11 21 22 module

Tags: Arduino, Arduino Uno, SIM900 GSM GPRS Quad-Band Development Board, SIM900 GSM GPRS module, 531619133647-3, B01IBGDDVM, UN970HL11PMG0NAFAMZ, SIM900 GSM GPRS Shield, DHT 11 21 22 module, temperature, humidity, temperature and humidity sensor

Attachments:  library4library5, sketch

In this project, you needed these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.SIM900 GSM GPRS Quad-Band Development Board Shield with GSM/GPRS antenna 1 pc

3.Arduino IDE (you can download it from here

4.Jumper cables M-M, F-M

5.Standard SIM card 1 pc (unlocked). If you have micro or nano you may consider getting a SIM card size adapter.

6. DHT11 21 22 Humidity and temperature module 1 pc

7. To power module: 4.8~5VDC 2A power adapter

8. SIM card size adapter 1pc (optional)

9. Resistor 1 pc (10 KOhm)

General

In this project we will learn how to connect SIM900 GSM GPRS Quad-Band Development Board and DHT 11/21/22 module to Arduino board and how to request sensor data via SMS.

Understanding the DHT module

You can read more about them here.

Understanding the SIM900 GSM GPRS Quad-Band Development Board 


 

A7 module is a GSM/GPRS/GPS function module.
It supports GSM/GPRS Quad-Band(850/900/1800/1900) network.
Also, it supports voice calls,SMS messages,GPRS data service and GPS function .
We can use it make a simple phone.
The module is controlled by AT command via UART and supports 3.3V and 4.2V logical level.
Features
Support the GSM / GPRS four bands, including 850,900,1800,1900MHZ
Support China Mobile and China Unicom’s 2G GSM network worldwide
GPRS Class 10
Support voice calls
Support SMS text messaging
Support GPRS data traffic, the maximum data rate, download 85.6Kbps, upload 42.8Kbps
Supports standard GSM07.07,07.05 AT commands and extended commands Ai-Thinker
Support GPS and AGPS
Supports two serial ports, a serial port to download an AT command port
AT command supports the standard AT and TCP / IP command interface
Support digital audio and analog audio support for HR, FR, EFR, AMR speech coding
Support ROHS, FCC, CE, CTA certification
SMT 42PIN
Specifications
Operating temperature -30 ℃ to + 80 ℃
Operating Voltage 3.3V-4.2V
Power voltage> 3.4V
Sensitivity <-105
Standby average current 3ma less
1KG peak suction
Package list
A7 GPRS+GSM+GPS Shield x1
GSM antenna x1
GPS antenna x 1

A7 module is a GSM/GPRS/GPS function module.
It supports GSM/GPRS Quad-Band(850/900/1800/1900) network.
Also, it supports voice calls,SMS messages,GPRS data service and GPS function .
We can use it make a simple phone.
The module is controlled by AT command via UART and supports 3.3V and 4.2V logical level.
Features
Support the GSM / GPRS four bands, including 850,900,1800,1900MHZ
Support China Mobile and China Unicom’s 2G GSM network worldwide
GPRS Class 10
Support voice calls
Support SMS text messaging
Support GPRS data traffic, the maximum data rate, download 85.6Kbps, upload 42.8Kbps
Supports standard GSM07.07,07.05 AT commands and extended commands Ai-Thinker
Support GPS and AGPS
Supports two serial ports, a serial port to download an AT command port
AT command supports the standard AT and TCP / IP command interface
Support digital audio and analog audio support for HR, FR, EFR, AMR speech coding
Support ROHS, FCC, CE, CTA certification
SMT 42PIN
Specifications
Operating temperature -30 ℃ to + 80 ℃
Operating Voltage 3.3V-4.2V
Power voltage> 3.4V
Sensitivity <-105
Standby average current 3ma less
1KG peak suction
Package list
A7 GPRS+GSM+GPS Shield x1
GSM antenna x1
GPS antenna x 1

The GPRS Shield provides you a way to communicate using the GSM cell phone network. The shield allows you to achieve SMS, MMS, GPRS and Audio via UART by sending AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT Commands). The shield also has the 12 GPIOs, 2 PWMs and an ADC of the SIM900 module(They are all 2V8 logic) present onboard.

Features:

  • Quad-Band 850 / 900/ 1800 / 1900 MHz – would work on GSM networks in all countries across the world.
  • GPRS multi-slot class 10/8
  • GPRS mobile station class B
  • Compliant to GSM phase 2/2+
  • Class 4 (2 W @ 850 / 900 MHz)
  • Class 1 (1 W @ 1800 / 1900MHz)
  • Control via AT commands – Standard Commands: GSM 07.07 & 07.05 | Enhanced Commands: SIMCOM AT Commands.
  • Short Message Service – so that you can send small amounts of data over the network (ASCII or raw hexadecimal).
  • Embedded TCP/UDP stack – allows you to upload data to a web server.
  • RTC supported.
  • Selectable serial port.
  • Speaker and Headphone jacks
  • Low power consumption – 1.5mA(sleep mode)
  • Industrial Temperature Range – -40°C to +85 °C
  • Size:8.5×5.7x2cm(approx)

Specifications for Fax

•Group 3, class 1

Specifications for GPRS Data

•GPRS class 10: max. 85.6 kbps (downlink)

•PBCCH support

•Coding schemes CS 1, 2, 3, 4

•PPP-stack

Specifications for CSD Data

•USSD

•Non transparent mode

Specifications for SMS via GSM/GPRS

•Point to point MO and MT

•SMS cell broadcast

•Text and PDU mode

Software features

•0710 MUX protocol

•Embedded TCP/UDP protocol

•FTP/HTTP

Special firmware

•Embedded AT

•Java (cooperate with Iasolution)

•FOTA

•MMS

Specifications for Voice

•Tricodec

– Half rate (HR)

– Full rate (FR)

– Enhanced Full rate (EFR)

•AMR

– Half rate (HR)

– Full rate (FR)

•Hands-free operation

(Echo suppression)

Interfaces

•Interface to external SIM 3V/ 1.8V

•Analog audio interface

•RTC backup

•SPI interface (option)

•Serial interface

•Antenna pad

•I2C

•GPIO

•PWM

•ADC

Compatibility

•AT cellular command interface

Certifications:

•CE

•FCC

•ROHS

•PTCRB

•GCF

•IC

•ICASA

•REACH

Carrier Approvals:

•NCC

•Anatel

•Rogers

•Orange

•AT&T

•Vodafone

The product is provided as is without an insulating enclosure. Please observe ESD precautions specially in dry (low humidity) weather.

Application:

  • M2M (Machine 2 Machine) Applicatoions.
  • Remote control of appliances.
  • Remote Weather station or a Wireless Sensor Network.
  • Vehicle Tracking System with a GPS module.

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:

SIM900 IC module

Designed for global market, SIM900 is a quad-band GSM/GPRS module that works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM900 features GPRS multi-slot class 10/ class 8 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. With a tiny configuration of 24*24*3mm, SIM900 can meet almost all the space requirements in user applications, such as M2M, smart phone, PDA and other mobile devices. SIM900 has 68 SMT pads, and provides all hardware interfaces between the module and customers’ boards.

  • Serial port and debug port can help user easily develop user’s applications.
  • Audio channel which includes a microphone input and a receiver output.
  • Programmable general purpose input and output.
  • The keypad and SPI display interfaces will give users the flexibility to develop customized applications. 

SIM900 is designed with power saving technique so that the current consumption is as low as 1.0mA in sleep mode. SIM900 integrates TCP/IP protocol and extended TCP/IP AT commands which are very useful for data transfer applications.

Operating Modes:

 1.Normal operation

GSM/GPRS SLEEP. Module will automatically go into sleep mode if the conditions of sleep mode are enabling and there is no on air and no hardware interrupt (such as GPIO interrupt or data on serial port). In this case, the current consumption of module will reduce to the minimal level. In sleep mode, the module can still receive paging message and SMS.

GSM IDLE. Software is active. Module registered to the GSM network, and the module is ready to communicate.

GSM TALK. Connection between two subscribers is in progress. In this case, the power consumption depends on network settings such as DTX off/on, FR/EFR/HR, hopping sequences, antenna.

GPRS STANDBY. Module is ready for GPRS data transfer, but no data is currently sent or received. In this case, power consumption depends on network settings and GPRS configuration.

GPRS DATA. There is GPRS data transfer (PPP or TCP or UDP) in progress. In this case, power consumption is related with network settings (e.g. power control level); uplink/downlink data rates and GPRS configuration (e.g. used multi-slot settings).

2.Power down

Normal power down by sending the AT command “AT+CPOWD=1” or using the PWRKEY. The power management unit shuts down the power supply for the baseband part of the module, and only the power supply for the RTC is remained. Software is not active. The serial port is not accessible. Power supply (connected to VBAT) remains applied.

3. Minimum functionality mode

AT command “AT+CFUN” can be used to set the module to a minimum functionality mode without removing the power supply. In this mode, the RF part of the module will not work or the SIM card will not be accessible, or both RF part and SIM card will be closed, and the serial port is still accessible. The power consumption in this mode is lower than normal mode.

You can find more information about SIM900 here, SIM900D here, SIM900R here. Check for SIM900 Schematics here, SIM900 datasheet here.

The factory default setting for the SIM900 GSM GPRS Quad-Band Development Board  UART is 19200 bps 8-N-1. (Can be changed using AT commands).

You can find the AT commands list here.

Signals and connections of the DHT module

There are two different versions of the DHT11 you might come across. One type has four pins, and the other type has three pins and is mounted to a small PCB. The PCB mounted version is nice because it includes a surface mounted 10K Ohm pull up resistor for the signal line. Here are the pin outs for both versions:

Signals and connections of the SIM900 GSM GPRS Quad-Band Development Board 


D9 of Arduino - Used for software control the power up or down of the SIM900

A4 and A5 of Arduino - connected to the I2C pins on the SIM900. The SIM900 however cannot be accessed via the I2C

Power jack - connected to external 4.8~5VDC power supply

Power select switch - select the power supply for GPRS shield (external power or 5VDC of Arduino board)

Serial port select - select either software serial port or hardware serial port to be connected to GPRS Shield

Hardware Serial - D0/D1 of Arduino

Software serial - D7/D8 of Arduino

EN - module power control enable pin (can control power switch, default high level enable)

4.1V - external power supply pin (4.2VDC). 

GND - ground pin.

RXD - serial port for AT commands (receive pin)

TXD - serial port for AT commands (transmit pin)

Microphone - to answer the phone call

Speaker - to answer the phone call

Wiring

The following picture shows the needed connections with the Arduino Uno 

Step by Step instruction

Preparations:

  • You must have coverage on a GSM 850 MHz, GSM 900 MHz, DCS 1800 MHz or PCS 1900 MHz network. GSM means 2G.
  • Use a prepaid plan or a plan with unlimited SMS for testing purposes. Otherwise, if something goes wrong, you may need to pay a lot for SMS text messages sent by mistake.
  • SIM900 GSM GPRS Quad-Band Development Board uses the original SIM card size. If you have micro or nano you will need to get a SIM card size adapter.
  • Make sure your SIM card is unlocked. To use the SIM card with the SIM900 GSM GPRS Quad-Band Development Board, you need to turn off the pin lock. The easiest way to do this - insert the SIM card in your smartphone and turn off the pin lock in the phone security settings.
  • You can automatically turn on the SIM900 GSM GPRS Quad-Band Development Board via software too.
  1. Do wiring.
  2. Attach GSM/GPRS antenna to SIM900 GSM GPRS Quad-Band Development Board. Make sure the antenna is well connected. A miniature coaxial RF connector is present on the SIM900 GSM GPRS Quad-Band Development Board to connect with a GSM/GPRS Antenna.The connector present on the GPRS Shield is called a U.FL connector. The GSM Antenna supplied with the SIM900 GSM GPRS Quad-Band Development Board has an SMA connector (and not an RP-SMA connector) on it. A patch cord is also supplied with the SIM900 GSM GPRS Quad-Band Development Board  to interface the antenna to the board.
  3. Insert a valid unlocked SIM card to SIM Card Holder (slot) - 6 Pin Holder for SIM Cards. Both 1.8 volts and 3.0 volts SIM Cards are supported by SIM900 - the SIM card voltage type is automatically detected.. 
  4. On the Serial port select, make sure the jumper cap is connected as shown in figure below to use software serial.
  5. You can power up SIM900 GSM GPRS Quad-Band Development Board with power supply adapter (5VDC 2A) POWER JACK interface. 
  6. We used the 5V DC 2A power adapter. Next to the power jack there is a toggle switch to select the power source. Next to the toggle switch on the board, there is an arrow indicating the toggle position to use an external power supply – move the toggle switch to use the external power supply as shown above.When the module powered on, the green LED power on indication (PWR) will be ON. 
  7. To power up/down the shield press the  POWER KEY for about 2 seconds.
  8. Then, the Status LED (blue) will light up and the NetLight LED (red) will blink every 800 ms until it finds the network. When it finds the network, the NetLight LED will start blinking every three seconds.
  9. Open Arduino IDE.
  10. Plug your Adruino Uno board into your PC and select the correct board and com port
  11. Modify the sketch with the phone number your Arduino board should reply the readings to.
  12. Verify and upload this sketch to your Adruino Uno
  13. When you send an SMS to the Arduino with the message “STATUS”, it replies with the latest temperature and humidity readings.

 

Code

The following code reads the temperature and humidity from the DHT sensor and sends them via SMS when you send an SMS to the Arduino with the message “STATUS”. You need to modify the code provided with the phone number your Arduino should reply the readings to.

We include the libraries needed for this project: the DHT libary to read from the DHT sensor and the SoftwareSerial library to communicate with the SIM900 GSM GPRS Quad-Band Development Board Shield. Then, you tell the Arduino that the DHT data pin is connected to pin 2, select the DHT sensor type and create a dht instance. The code is compatible with other DHT sensors as long as you define the one you’re using in the code. You also create float variables to store the temperature and humidity values. The following line configures the software serial on pins 7 and 8. Pin 7 is being configure as RX and pin 8 as TX: SoftwareSerial SIM900(7, 8); You also create a char variable to store the incoming SMS characters : char incomingChar;

In the setup(), you begin the DHT and the SIM900 GSM GPRS Quad-Band Development Board Shield. The SIM900 GSM GPRS Quad-Band Development Board Shield is set to text mode and you also set it to send the SMS data to the serial monitor when it receives it.

We create a function to read the temperature and humidity called readData(). This function stores the values on the t and h variables. The code uses temperature in Celsius, but it is prepared if you want Fahrenheit instead – the code is commented on where you should make the changes.

We also create a function that checks if the incoming message is equal to STATUS – the SMSRequest() function. This functions returns true if the Arduino receives a message with the text STATUS and false if not.  You read the SMS incoming characters using: incomingChar = SIM900.read();

In the loop(), you check if there was an SMS request with the SMSRequest() function – you check if the Arduino received a STATUS message. If true, it will read the temperature and humidity and send it via SMS to you.

The number the Arduino answers to is set at the following line: SIM900.println("AT + CMGS = "XXXXXXXXXXXX"");

Replace the XXXXXXXXXXXX with the recipient’s phone number. You must add the number according to the international phone number format. For example, in Lithuania the number is preceded by +370XXXXXXXXX.

Then, you store the message you want to send in the dataMessage variable. Finally you send the SMS text message using: SIM900.print(dataMessage);

Summary

We have learnt how to connect SIM900 GSM GPRS Quad-Band Development Board and DHT 11/21/22 module to Arduino board and how to request sensor data via SMS.

Notes:

  • It happens in some case that it is unable to detect the data that might be the issue with antenna, so unplug the antenna( if it is detachable) and attach it again.
  • If, code says “Check Connection”, then you should definitely check it twice, before giving up. Also, sometimes interchanging the TX and RX pins is preferable and surprisingly works.
  • If SIM900 GSM GPRS Quad-Band Development Board  doesn’t respond with OK. Check your TX and RX connections to the Arduino. Try repeating the process by changing the TX with the RX pins. Also check if you have selected the software serial by placing the jumper cap on the appropriate place on the serial selector.
  • If you cannot see messages in the serial monitor. To see the messages in the serial monitor, the SIM900 GSM GPRS Quad-Band Development Board and the Arduino’s serial port baud rate should be the same. The SIM900 GSM GPRS Quad-Band Development Board default baud rate is 19200. So, select the Arduino’s baud rate to 19200. However, if you need to change the shield baud rate, you can send the following AT command to change it to 19200 or other appropriate baud rate. AT+IPR=19200

Libraries:

  • SoftwareSerial library included in Arduino IDE.  The library has the following known limitations:If using multiple software serial ports, only one can receive data at a time.Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).On Arduino or Genuino 101 the current maximum RX speed is 57600bpsOn Arduino or Genuino 101 RX doesn't work on Pin 13 The library has the following known limitations: If using multiple software serial ports, only one can receive data at a time;Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69);Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI);On Arduino or Genuino 101 the current maximum RX speed is 57600bps; On Arduino or Genuino 101 RX doesn't work on Pin 13. You can read about it here.
  • Adafruit_Sensor library included.Download, unzip  and add to libraries in our PC, for example C:UserstoshibaDocumentsArduinolibraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. 
  • DHT-sensor library included. You will need to unzip and add the DHT-sensor-library-master library to libraries in your PC, for example C:UserstoshibaDocumentsArduinolibraries OR You can install it in Arduino IDE too: select Sketch-> Include library->Manage your libraries->type DHT in Filter your search line and you will see DHT sensor library by Adafruit->More info->select version->install. If it will be problem with compilation - remove 2 files from the library - DHT_U.cpp and DHT_U.h.

Sketch:

  • See attachment on the begining of this project description.


Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy of Acoptex.com in Sipeed Maixduino 04-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

Published at 15-05-2018
Viewed: 3546 times