Humidity-Controlled Fan | ESP32, SHT31 & Hysteresis
An ESP32 can use relative humidity from an SHT31 to decide when to run a fan. A higher start threshold and lower stop threshold prevent repeated toggling near the setpoint.
The key idea
Between the thresholds the controller retains the previous fan state. The measured response also depends on sensor placement and whether replacement air can remove moisture.
What to remember
- Separate the start and stop values by a meaningful humidity band.
- Position the sensor where it represents the air being controlled.
Check your understanding
If humidity lies between both thresholds, what determines whether the fan runs?
Show the explanation
Its previous state determines whether it continues running or stays off.