Temperature and Humidity Monitoring with DHT Sensor Module
This project demonstrates how to measure temperature and humidity using a DHT (Digital Humidity and Temperature) sensor module with an Arduino Uno.
The DHT sensor provides accurate readings of temperature and humidity, which are then displayed on the serial monitor.
Components Needed
- Arduino Uno
- DHT Sensor Module (DHT11 or DHT22)
- Jumper Wires
Block Diagram
Hardware Wiring Explanation:
Connect the data pin of the DS18B20 sensor module to Arduino digital pin 2.
Connect the VCC pin of the sensor module to Arduino 5V.
Connect the GND pin of the sensor module to Arduino GND.
Software (Arduino IDE):
Power the Arduino Uno via USB from your computer or using an external power supply (recommended 7-12V DC).
Connect the Arduino to your computer via USB. Upload the above Arduino sketch to the Arduino Uno using the Arduino IDE.
operation:
Initialize the System:
Begin serial communication at a baud rate of 9600 in the setup function.
Initialize the DHT sensor with the appropriate pin and type (DHT11 or DHT22).
Read Sensor Values:
Read temperature and humidity values from the sensor using the
The readings are returned as floats representing temperature in Celsius and humidity in percentage.
Display Readings:
Check if the readings are valid using
Print the temperature and humidity readings to the serial monitor with appropriate units.
Repeat Measurement:
Add a delay of 2 second between measurements to avoid rapid readings.
Applications
Notes
Ensure proper wiring and placement of the sensor for accurate readings.
Calibrate the sensor if necessary for accurate measurements in your environment.