Sunday, August 16, 2015

Temperature and Humidity Sensor using DHT11 connected to Raspberry Pi.

Blog used to refer when building this project:

http://www.rpiblog.com/2012/11/interfacing-temperature-and-humidity.html


Items used in this project:

Raspberry Pi  Model B.

DHT11 Temperature sensor

10K Resistor -

Breadboard-  on which the Sensor was connected and 3 pins from it being used for connecting to Power, GND and the data pins.

Setup:

- Connected the first Pin of the DHT 11 to +5V  ( Pin 2 of RPi) ( seeing from the left of the DHT11 )

- Connected the last pin of the DHT11 to  GND ( Pin 39 of the RPi)

- Connected the 2nd pin i.e data ( from the left of the DHT11) to Pin 7, i.e GPIO4 of the RPi.
How to Compile source code:
-gcc -o sensor temp_rh_sensor.c -L/usr/local/lib -lwiringPi

A reference device - an independent device used to check that the DHT11 was reporting approximately same temperature.


^Cpi@raspberrypi ~/wiringPi $ sudo ./sensor
Interfacing Temperature and Humidity Sensor (DHT11) With Raspberry Pi
Invalid Data!!
Humidity = 58.0 % Temperature = 30.0 *C (86.0 *F)
Humidity = 58.0 % Temperature = 30.0 *C (86.0 *F)
Humidity = 58.0 % Temperature = 30.0 *C (86.0 *F)
Humidity = 58.0 % Temperature = 30.0 *C (86.0 *F)
Humidity = 58.0 % Temperature = 30.0 *C (86.0 *F)
Invalid Data!!
Humidity = 59.0 % Temperature = 30.0 *C (86.0 *F)

No comments:

Post a Comment