What sensor for fog in the bathroom?


As many people do, we have a bathroom. We actually use it quite frequently, for instance to take a hot shower. I recently fitted an electric fan to extract the humid air / fog. I made a separate switch for it as there is often enough sunlight not to have to turn on the electric lighting. Unfortunately, it seems quite a task for my family members to turn it on. And if they do, they forget to turn it off afterwards. Or they turn it of when they leave the bathroom, but the fog has not cleared. Problems, problems, but nothing I cannot fix with an Arduino, I think. I want to equip the fan with a sensor; if it is foggy switch on, and if the fog is gone run on for a few minutes and switch off. Should be easy.

But, what sensor should I take? I found the DHT11, but that measures air humidity, not necessarily fog. I am thinking more amongst the lines of a light-trap, IR led and receiver in-line, that is disrupted by the fog. Or maybe an IR led and sensor next to each other, if there is fog is might reflect the light. Or maybe there are even simpler ways to detect the fog. Please let me know your thoughts.



Could you do it with a temperature sensor above the shower, and if you see a sudden increase in temperature from the ambient then turn on the fan? The heat from the shower should rise and if you have a solid shower screen and tile walls it should create a nice chimney to your sensor.

I wonder if you measure humidity and temperature and calculate the dew point you would know if the conditions for fog are right and ventilate based on that?

Use a motion sensor with a 10 minute time delay.

Thanks guys! I think the dew-point calc is a very nice scientific aproach. The motion sensor is probably the easiest, but we do use the bathroom for other purposes than showering, too, and I rarely brush my teeth with water so hot it will fog up the bathroom. I was also advised an HDS10 sensor, I'm looking into that, too.


Pretty much any humidity sensor is better than the DHT11. I use DHT22 and am satisfied with their performance in my weather station.

My outside IP-cams are very sensible to fog, the drops of water in the air seem to reflect the IR-illumination very much,
up to blinding the camera, but only in the night (with IR-illumination).

So maybe an IR-led and a phototransistor could be used to detect fog, but I never tried it.

So you could try the IR-trap not in-line, but mounted side by side.

Past a certain humidity you might want the exhaust fan to run anyway.

Whatever you do, don't use a single trigger level as that can result in frequent ON-OFF's.

Dew point is the parameter you want to measure. This is a way of measuring the "absolute" humidity instead of just the relative humidity. Dew point is the temperature that a cold surface - for example, a mirror - will just form dew.

If the dew point of the air in the bathroom is at or below the temperature of the mirror, then fog will collect on the mirror.

I like the BME280 sensor. It is extremely fast at measuring humidity. It does however suffer from self-heating when continuously powered, so it always reports temperature above the actual air temperature. You can use its readings to calculate dew point very accurately, no matter how hot the senor is.

A cheap way is to use a dew sensor from an old VCR (mounted on/near the head drum).
It is a resistor that sharply increases it's value in the 90-100% RH range.
Has to be driven with 1kHz AC to survive foggy bathroom conditions.
Mine has lasted >2years so far.