Menu Close

Temperature and Humidity Monitoring with Buzzer Alert – Raspberry Pi Pico

In this experiment, we learn how to read temperature and humidity values from a DHT22 sensor using a Raspberry Pi Pico. The measured data is displayed on a 16×2 I2C LCD, and a buzzer alert is triggered when the temperature or humidity exceeds set thresholds.

If you’re using a DHT11 sensor, make sure to change `DHT22` to `DHT11` in the code.

Connections:

DHT22 → GPIO 22 (Pico)

I2C LCD SDA → GPIO 0 (Pico)

I2C LCD SCL → GPIO 1 (Pico)

Buzzer → GPIO 26 (Pico)(optional)

VCC and GND for all components appropriately

Result:

The Raspberry Pi Pico reads the temperature and humidity values every few seconds from the DHT22 sensor. These values are displayed on the 16×2 LCD. If the temperature exceeds 20°C or humidity exceeds 30%, the buzzer will beep as an alert.

Leave a Reply