Friday, 30 September 2016

Temperature updation on thingspeak using sim900

In this post we are going to discuss how to upload temperature on thingspeak channel using sim 900 and arduino uno. As I had already uploaded the data on thingspeak channel using sim 900 and terminal software.


This project is a wireless temperature logger on thingspeak channel using gsm module and arduino.
For temperature sensor, we are using lm35, that gives output in millivolt which can be easily calibrated in  terms of  °C. We have to use adc module, since it's an analog sensor. Once the raw data is converted into temperature, we can upload the data.

Now, we are ready to upload the data on thingspeak channel. Thingspeak provides api for uploading of data. Before this, we have to use activate GPRS on sim900. We also to provide APN for accessing the internet. After activating the GPRS, we have to use GET like this:


Replace this api with yours, and data is the data you want to be upload. You can upload a number of field like temperature, pressure, humidity, etc.

Stuff you need:

  1. SIM900A
  2. Arduino uno
  3. LM35 (it's output is in degree celsius)
  4. 12 volt adapter (for GSM module)
  5. Jumper wires
  6. Account on thingspeak


Arduino                              GSM module
Pin no. 7     ======>         Tx
Pin no. 8     ======>         Rx
Gnd            ======>          Gnd

Output of LM35 is connected to A0 of arduino uno.

Arduino thinkspeak with sim900


Now coming to he working part, I am using sim900a module. It requires serial communication for its interfacing with arduino. It works on "AT" commands . Initially we can check our gsm modem using terminal software for quick testing as I had posted in the previous post. Now apn depends on the network operator e.g. I am using idea network and it's apn is "internet".

I will cover some important AT commands here:

AT  // this is for testing whether our connection is correct or not

AT+CPIN?  // whether sim is inserted or not

AT+CREG?  // whether network is registered or not

AT+CGATT?  // whether it is connected to internet or not

AT+CSTT="internet"  // connect to this apm

AT+CIPSTART="TCP","","80"  // tcp is protocol, next is url that you want to hit and 80 is port for http

AT+CIPSEND  // data can be transferred
GET  // there are two methods in http GET and POST, we are using GET
API should be correct and field1 is the data you want to upload. Field1 can be static data or it can be variable. You can also add more field.  
After this we have to pass char 26 which indicates end of data.


Check out the video:



  1. Replies
    1. May be your apn is wrong or there is some problem with your url

  2. where can I get arduino code ??
    could you please help??

  3. Download source code from the link below:

  4. Replies
    1. If you wanna add more fields in thigspeak, there are options in the thingspeak page (private view)

  5. how i can get continuous data reading?

  6. Hello. Thanks for your device! Thank you, I was able to collect this and I like it. I want to go further and upgrade the device so that the data is taken from several different sensors. But I do not have enough knowledge to change the code, please help. I need to understand how the string will change so that the variables can be sent to different fields.
    Thank you.

    1. GET

  7. Can you provide the code for 2 fields