Project 02

ESP32 Humidity Alert Prototype

A small embedded system that monitors humidity and triggers an audible warning when humidity becomes unusually high.

Why I built this

WHY?

After finishing my first project, I wanted to build another engineering project to continue developing my electronics and embedded systems skills, which were the areas I was most interested in at the time.

Around then, a friend told me about a distant relative who had fainted in a bathroom after hot water steam built up and later died. I felt that this was a problem that could be addressed with a simple sensor and a microcontroller.

I looked into the problem further. The World Health Organization reports that high temperature and high humidity can make it harder for the body to release heat. Studies cited by WHO estimate around 489000 heat related deaths each year between 2000 and 2019. I decided to build a simple prototype that could detect high humidity and give an audible warning.

Source: WHO, Heat and health

Technology

Hardware

Prototype hardware
ESP32 DevKit V1 wired to a DHT22 sensor and an active buzzer module

The system uses

  • ESP32 DevKit V1
  • DHT22 temperature and humidity sensor
  • Active buzzer module

The ESP32 reads temperature and relative humidity from the DHT22 and controls the buzzer when the humidity alert state is active.

Control logic

System flow
Component roles and project flow for the ESP32 humidity alert
  1. Read DHT22
  2. Validate reading
  3. Apply humidity logic
  4. Update alarm state
  5. Control buzzer
  6. Repeat

The ESP32 samples temperature and humidity every two seconds.

WHY?

Invalid sensor readings are rejected. If the DHT22 returns invalid data the buzzer is kept off so a sensor error does not create a false alarm.

Why hysteresis?

The alarm uses hysteresis instead of one threshold.

Alarm on
70 percent RH
Alarm off
65 percent RH

The five percent gap prevents the buzzer from rapidly switching on and off when humidity fluctuates around the threshold.

The buzzer module is active low. LOW turns the buzzer on. HIGH turns the buzzer off.

Functional validation

Normal state

Approximately 44 to 47 percent RH at about 25 degrees Celsius. The system reports Humidity Normal and the buzzer remains off.

Arduino Serial Monitor showing humidity between 44 and 47 percent at about 25 degrees Celsius with Humidity Normal
Trigger test

69.4 percent RH remains normal. The next reading reaches 80.7 percent RH, crosses the 70 percent threshold, and the system enters WARNING HIGH HUMIDITY while the buzzer activates.

Arduino Serial Monitor showing humidity rising from 69.4 to 80.7 percent and a high humidity warning
WHY?

The Serial Monitor was used to verify the transition from the normal state to the warning state.

Self Critique and Improvements

Fixed humidity threshold
The 70 percent RH trigger was chosen for prototype testing. A better version would use real bathroom baseline data to set a more reliable threshold.
Sensor accuracy
The DHT22 is suitable for a prototype, but a faster and more accurate sensor such as the SHT31 or SHT40 would improve measurement quality.
Temporary power solution
The DHT22 was powered from a GPIO pin during prototyping. A final design should use a dedicated regulated 3.3 V power rail.
False trigger risk
A short humidity spike can activate the alarm. Adding a short time delay or moving average would reduce false alarms.
No environmental protection
The electronics are exposed. A final version would need a moisture resistant enclosure while keeping the sensor open to airflow.
Local alarm only
The current system only gives an audible warning. A future version could add remote notifications or logging if needed.
Limited testing
The current validation proves that the logic works, but longer tests in a real bathroom environment would be needed to evaluate reliability over time.