Designing process

Introduction

  • In modern electronic systems, environmental sensors play a crucial role in measuring physical variables such as temperature and relative humidity. These parameters are essential for applications including environmental monitoring, automation systems, smart agriculture, and Internet of Things (IoT) solutions.
  • In this assignment, the AM2302 (DHT22) sensor was used to measure temperature and humidity through a digital signal interface. This sensor is known for its high accuracy and ease of integration, as it requires only a single data pin for communication. The ESP32 microcontroller was used to read the sensor data and display real-time values through the serial monitor in the Arduino IDE.
  • Materials

    • ESP32 development board
    • AM2302 (DHT22) sensor
    • Breadboard
    • Jumper wires
    • USB cable
    • Computer with Arduino IDE

Note: The AM2302 module includes an internal pull-up resistor, so no external resistor was required.

Connection diagram

AM2302 Pin ESP32 Connection
VCC (+) 3.3V
DATA (OUT) GPIO 4
GND (-) GND
Connection diagram

Figure 2. Sensor to ESP32 wiring diagram

Development Process

  1. The AM2302 sensor pins were identified and connected to the ESP32, ensuring proper voltage supply and correct grounding.
  2. The DHT library (Adafruit) was installed in the Arduino IDE to enable communication between the microcontroller and the sensor.
  3. A program was uploaded to the ESP32 to read temperature and humidity data from the sensor.
  4. The serial monitor was opened to visualize real-time environmental data.
Serial monitor output

Figure 3. Real-time data visualization in serial monitor

During testing, slight variations in temperature and humidity were observed when environmental conditions changed, such as placing a hand near the sensor or blowing air towards it. This confirmed the responsiveness and sensitivity of the sensor.

Testing sensor interaction Sensor response

Figures 4 and 5. Sensor response to environmental changes

Results

The sensor provided stable and reliable readings consistent with the ambient laboratory conditions.

								Temperature: 23.00 °C
								Humidity: 40.50 %

								Temperature: 23.00 °C
								Humidity: 40.60 %
								
Final results

Figure 6. Recorded sensor data

It was observed that temperature increased slightly when a hand approached the sensor, and humidity values also changed accordingly. This demonstrates the sensor’s ability to detect environmental variations accurately.

Final results

Conclusion

A functional temperature and humidity measurement system was successfully implemented using the AM2302 sensor and the ESP32 microcontroller. The system demonstrated reliable digital communication and real-time data acquisition.

This assignment reinforced the importance of correct electrical connections and proper library configuration for system functionality. Additionally, it highlighted the role of sensors as input devices in embedded systems and their relevance in environmental monitoring and automation applications.