Raspberry Pi climate data logger using adafruit and a DHT22


1.) Connect DHT22 Sensor  to Raspberry Pi

Raspberry Pi DHT22 AM2302 data logger

Raspberry Pi DHT22 AM2302 data logger parts

On howto connect your raspberry to your sensors please read one of those helpfull articles

 

http://www.test-wetterstation.de/temperaturmessung-mit-dem-raspberry-pi
http://www.instructables.com/id/Raspberry-PI-and-DHT22-temperature-and-humidity-lo/
http://www.rototron.info/dht22-tutorial-for-raspberry-pi/

2.) Setup Raspberry Pi, boot and connect to via ssh

3.) Do some post setup stuff and install some essentials


pi@rapi:$ sudo apt-get update
pi@rapi:$ sudo apt-get upgrade
pi@rapi:$ sudo apt-get install build-essential python-dev
pi@rapi:$ cd /opt

4,) Install adafruit


pi@rapi:$ sudo mkdir adafruit
pi@rapi:$ cd adafruit/
pi@rapi:$ sudo wget https://github.com/adafruit/Adafruit_Python_DHT/archive/master.zip
pi@rapi:$ sudo unzip master.zip
pi@rapi:$ cd Adafruit_Python_DHT-master/
pi@rapi:$ sudo python setup.py install
pi@rapi:$ cd /opt/adafruit/Adafruit_Python_DHT-master/examples

5.) Test your DHT22 sensor device


pi@rapi:$ python AdafruitDHT.py 22 4
Temp=23.9* Humidity=44.3%

6 .) Create a small python script and test it


pi@rapi:$ python readSensorData.py 22 4

7.) Add your script to rc.local and reboot


pi@rapi:$ sudo mcedit rc.local (use any editor your are used to)

(sleep 10; python /opt/dataLogger/readSensorData.py 22 4)&
exit 0

Working sample: https://datalogger.html5live.at/public/

Using SensorLogger for ownCloud to store data and visualize

SensorLogger for owncloud Dashboard SensorLogger for owncloud device list SensorLogger for owncloud chart

Share

Alexander Stocker | alex@stocker.info

2 thoughts on “Raspberry Pi climate data logger using adafruit and a DHT22

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*