This experiment shows how easy it is to have our own temperature and Humidity monitoring device using DHT11 Sensor and Pi. Here in this experiment I used the google spreadsheet to have live data of temperature and Humidity.
Things Required:
- Raspberry Pi Kit
- DHT11 Sensor
- 10 K ohms Resistor
- Bread Board
- Jumper Wires
DHT11 Sensor:
The DHT11 is a basic, ultralow-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed).
DHT11 Sensor
DHT11 Pin Description:
Pin Name Description
1 VDD Power supply 3-5.5 V DC
2 DATA Serial data output
3 NC Not connected
4 GND Ground
Wiring Connections:
Connect the Sensor to the Pi as shown below:
- Connect pin1 of DHT11 to VCC (3.3V), pin1 of Pi.
- Connect pin2, the Digital output pin of sensor to GPIO4, input pin of Pi (Pin7).
- Connect pin 4 of DHT to GND (pin39 of Pi).
- Connect resistor across DHT11 output(pin2 of DHT11) and VCC(pin1 of Pi).
Code:
Programs for the experiment are available at:
Experiment 1:
To read the temperature and humidity using DHT11.
Simply run the program AdafruitDHT.py program
Inorder to run this from the command prompt we need to give inputs from the command line arguments. First argument is sensor model number(11) and second GPIO pin number(4), this is not the actual pin number.
1. In the terminal, navigate to the program location.
2. Run sudo ./AdafruitDHT.py 11 4
Simply run the program AdafruitDHT.py program
Inorder to run this from the command prompt we need to give inputs from the command line arguments. First argument is sensor model number(11) and second GPIO pin number(4), this is not the actual pin number.
1. In the terminal, navigate to the program location.
2. Run sudo ./AdafruitDHT.py 11 4
Output:
Experiment 2:
To update a google spreedsheet live with the temperature and humidity data.
This experiment requires groundwork such as setting up google developer account, giving google drive access, getting service account for the google drive.
The process is well explained at https://learn.adafruit.com/downloads/pdf/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging.pdf
After all the setup run the google_spreadsheet.py
sudo ./google_spreedsheet.py
you can visualize the output on the terminal and also you can view in the spreedsheet.
Below are the demos of the results of the reading updated in terminal and spreedsheet.
This experiment requires groundwork such as setting up google developer account, giving google drive access, getting service account for the google drive.
The process is well explained at https://learn.adafruit.com/downloads/pdf/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging.pdf
After all the setup run the google_spreadsheet.py
sudo ./google_spreedsheet.py
you can visualize the output on the terminal and also you can view in the spreedsheet.
Below are the demos of the results of the reading updated in terminal and spreedsheet.
No comments:
Post a Comment