Sending weather data via Twitter using Rasbperry Pi and DHT22

UPDATE: adding a light sensor to the device.

The idea behind this project is connect some sensors to the Raspberry Pi and put the information available on demand via Twitter requests and put sensor history data online on the web

To do that, I used a DHT22 temperature and humidity sensor connected to the Rasberry Pi.

raspberry_pi_dht22wiring

raspberry_pi_dht22wiring

You can get all the detailed steps from Adafruit website

When you have setup all the hardware, you must get into software stuff, to do that you must download the Adafruit DHT Python library (instructions here)

To publish the weather data on the web you must follow my old DHT11 post and this one, but you must change the original DHT11 C program to the new DHT11/22 python script:

Following this steps, you will get a very basic webservice on your webserver that will look like this:

DHT11 sensor realtime information

DHT11 sensor realtime information

Now, its time to the Twitter stuff. The goal is send weather information on demand to any twitter user that sends the correct request string. We will use Twython and Adafruit modules as main elements of the code:

You must remember that you must create a new Twitter application with read/write permisions and you must also get all the tokens data, allowing to bind your python script to Twitter.

Posted in Concept, Electronics, Programming, Python, Raspberry Pi Tagged with: , , , ,
0 comments on “Sending weather data via Twitter using Rasbperry Pi and DHT22
5 Pings/Trackbacks for "Sending weather data via Twitter using Rasbperry Pi and DHT22"
  1. […] on my online weather station, I made an upgrade, adding a light sensor using a photoresistor based on this Adafruit […]

  2. […] take a look at this post (and 2)to see the new improved version of the device, using a DHT22, a light sensor, and sending […]

  3. […] , http://projectlog.ferranfabregas.info/sending-weather-data-via-twitter-using-rasbperry-pi-and-dht22/ and thanks to Jordi Binefa and their boards I have the very first version of the analog weather […]

  4. […] If you want to send the weather data online, take a look at this post. […]

  5. […] The idea behind this project is connect some sensors to the Raspberry Pi and put the information available on demand via Twitter requests and put sensor history data online on the web  […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*