Arduino and SIM900 GSM GPRS 3G Temperature and Humidity Logging, Mobile Stats
by loggingforest in Circuits > Sensors
7623 Views, 7 Favorites, 0 Comments
Arduino and SIM900 GSM GPRS 3G Temperature and Humidity Logging, Mobile Stats
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
You can purchase needed devices here (minimal required):
USB charger to Power your device – now this is required for GSM module usb don’t have enough power
SIM Card with PIN disabled and some data plan
Also nice to have:
Experimental Platform for Arduino
This also tested/works with industrial AM2305 sensor
Add Your Device to LoggingPlatform
Here you can add your device to get api keys needed later: https://loggingforest.com/index.php/page/pricing
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
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
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
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