Introduction: Arduino and SIM900 GSM GPRS 3G Temperature and Humidity Logging, Mobile Stats

About: Growing Flowers, Building Weather Stations, Logging, with all popular boards

With Arduino UNO R3, SIM900 Shield AND DHT22 you can log temperature
and humidity data outside, in room, greenhouse, lab, cooling room or any other places completely free. This example we will use to log room temperature and humidity.

Device will be connected to internet via GPRS 2G, so can be used even without existing Router or wired internet connection. Best for fields, vineyard or similar places without fixed internet connection.

You will be able to check latest readings on your mobile phone, desktop or any other device with browser.

Supplies

Step 1: Add Your Device to LoggingPlatform

Here you can add your device to get api keys needed later: https://loggingforest.com/index.php/page/pricing

Step 2: Hardware Connection

Insert SIM into GSM module Shield
Connect Shield to Arduino

Connect Power adapter and USB to PC

Connect DHT22 Out to GSM shield PIN 10

Connect DHT22 + to GSM shield 3V

Connect DHT22 – to GSM shield GND

Connect LED if you want status indication, not required

Diagram example on picture

Step 3: Upload Software Needed to Device (Windows Guide)

Download and install Arduino IDE: https://www.arduino.cc/en/main/software
Connect device to USB on your Windows PC, and install drivers if needed

Run Arduino IDE

Select COM port (this is usually larger number if you don’t have other devices connected), image 1

Select Board type, image 2

Download and open source code:
You need to have libraries:

SoftwareSerial.h – this is usually included in Arduino IDE

and

DHT.h – you can download here and copy to your arduino library folder like: C:\arduino-1.6.8\libraries

SIM900 code for logging is available here

Open this SIM900 code with Arduino IDE:

Change this parameters as on image 3

APN you can get from your SIM card provider

And other from loggingforest platform: https://loggingforest.com/index.php/page/pricing , image 3

Some code notices:
Standard libraries for SIM900 doesn’t work properly for repeatable tasks like logging, so we communicate directly with serial SIM900 AT Commands

If you using different shield maybe you need to define different RX, TX pins in code

When using (not debugging or testing) you should disable DEBUG_EN, change from true to false

For manually network selection with SIM900, if you living on country border, you can uncomment this lines and define network code provided in serial, so like image 4

network code like 21910 for A1 can be found in COPS line, image 5

If your code stuck on TEST AT, means that you power adapter doesn’t give enough power for SIM900, best to use 5V 2A or 9V 1A.
Some sim providers may require USER and PWD for apn connection, you can also define in code.

After that your device will start sending data to loggingforest and you can see it there

Step 4: Check Data on Mobile or Desktop

After that your device will start sending data to loggingforest and you can see it there
In loggingforest device edit just define parameters name and values as image 1

Click on preview, image 2

And you will see nice data, image 3

Feel free to comment and share your logger

Sensors Contest

Participated in the
Sensors Contest