Plotting DHT11 sensor data graph at Thingspeak.com using raspberry pi

Introduction:

In this tutorial, we are going to show you how can send your DHT11 sensor data online at particular URL and monitor your Room temperature and humidity.  You can also access graph plot of your data from anywhere and anytime. These data are stored at Thingspeak.com using API key, which is used to collect data from your pi to their database.

Components required:

  • Raspberry pi 2
  • DHT11 sensor
  • Connecting wires
  • Breadboard
  • 4.7K ohm resistor

Steps:

We are using ThingSpeak which is open data platform for INTERNET OF THINGS. ThingSpeak will gather data from your raspberry pi using HTTP and plot graph respectively against number of fields .

STEP 1: make connection with raspberry pi as shown in fig.

dht sensor data

Step 2: download DHT11 library for Raspberry pi. I have used Adafruit DHT library to communicate Pi with DHT11 sensor.

Step 3: Copy and paste below code in a text editor of Pi and save it as ” Dht11data.py ” (without quotes) .

Step4: Now run the  above code using following command.

Wohooo! Now you raspberry pi is a part of IoT.

Add Comment