Soldered, wired, and coded

The Smart Bathroom Fan

Our bathroom has a shower, no window, and a fan wired straight to the light switch. Now a humidity sensor decides when it actually needs to run.

Our bathroom has a shower but no daylight window, just an extractor fan, and that fan was wired directly to the light switch. So the only way to vent the moisture after a shower was to leave the light burning, with no real idea of how long that actually needed to take.

I still wanted to avoid mold, so I decoupled the fan from the light and gave it its own logic instead. A DHT20 humidity sensor continuously monitors the air in the bathroom. Once humidity crosses a defined threshold, a 230V relay switches the fan on.

Once the humidity drops back below a second, lower threshold, the relay switches the fan off again automatically. No more guessing, no more running the fan or the light longer than necessary. Problem solved.

What it does

Decouples the fan from the light switch entirely

DHT20 sensor continuously monitors bathroom humidity

230V relay switches the fan on above a defined humidity threshold

Automatic shutoff once humidity drops below a lower threshold

Prevents mold without wasting energy on the light or fan

Under the hood

  • DHT20 humidity sensor
  • 230V relay module
  • Microcontroller
  • Threshold-based automation