The Temperature and Humidity Monitoring System is a Python program that reads data from a DHT22 sensor (temperature and humidity sensor) and sends this data to the ThingSpeak cloud platform for visualization. This system is designed as an example of an IoT (Internet of Things) application.
- Reads temperature and humidity data from a DHT22 sensor.
- Sends data to the ThingSpeak cloud platform for visualization.
- Provides error handling for sensor data retrieval and data sending.
- Raspberry Pi or similar hardware with GPIO pins.
- DHT22 temperature and humidity sensor.
- Python 3.x installed on the Raspberry Pi.
Adafruit_DHT
library for DHT22 sensor communication.requests
library for sending data to ThingSpeak.
- Clone or download this repository to your Raspberry Pi.
git clone https://github.com/alihadimoghadam/Temperature-and-Humidity-Monitoring-System.git
- Install the required Python libraries using pip.
pip install Adafruit_DHT requests
-
Connect the DHT22 sensor to the appropriate GPIO pin on your Raspberry Pi.
-
Obtain a ThingSpeak account and API key.
-
Configure the program by editing the config.py file (see Configuration).
- Navigate to the program directory.
cd temperature-humidity-monitoring
- Run the program.
python T_H_Monitori.py
- The program will continuously read data from the DHT22 sensor and send it to ThingSpeak for visualization.
Edit the config.py file to set your configuration options:
DHT_SENSOR_TYPE: Set to Adafruit_DHT.DHT11 or Adafruit_DHT.DHT22 based on your sensor type. DHT_PIN: The GPIO pin connected to the DHT22 sensor. THINGSPEAK_API_KEY: Your ThingSpeak API key.
DHT_SENSOR_TYPE = Adafruit_DHT.DHT22
DHT_PIN = 4
THINGSPEAK_API_KEY = "YOUR_THINGSPEAK_API_KEY"
Contributions are welcome! If you find any issues or have suggestions, feel free to create an issue or a pull request in this repository.
This project is licensed under the MIT License.