Project showcase
Humidity Sensor-Controlled Bathroom Exhaust Fan

Humidity Sensor-Controlled Bathroom Exhaust Fan © GPL3+

Accumulation of moisture in a closed up space like a bathroom can lead to the appearance of mould, which can cause health issues.

  • 3,846 views
  • 11 comments
  • 18 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)

About this project

This project is designed to sense the humidity level in a bathroom and ventilate it until the wet floor dries up to minimise the build-up of humidity in the enclosed space.

Bathrooms are normally fitted with exhaust fans to remove vapour while we shower, for example, and are switched off the moment we are done. The wet floor will dry up by itself but the humidity remains in the bathroom. Over time, the build-up of moisture results in the growth of mould, which can cause severe health issues (ttps://www.betterhealth.vic.gov.au/health/conditionsandtreatments/mould-and-your-health)

Leaving the main exhaust fan ON can be an option, but is rather noisy and adds on to the electricity bill.

In this project, I make use of a DHT-11 humidity sensor, a large computer casing fan (200mm DIA, 12V 300mA), an Arduino Nano, and a MOSFET board to do the job. Eventually, I will be hooking it up to my earlier project on Solar Tracking.

Code

Arduino SketchArduino
#include <SimpleDHT.h>

//Declaring digital pin no 2 as the dht11 data pin

int pinDHT11 = 2;
int DHTpower = 3;
int Fan = 13;
SimpleDHT11 dht11;

void setup() {
  pinMode(Fan, OUTPUT);
  pinMode(DHTpower, OUTPUT);
  digitalWrite(DHTpower, LOW);
  digitalWrite(Fan, LOW);
  Serial.begin(9600);   
}

void loop() {
  delay(1000);
  RHcheck();                        //check Humidity Level
  delay(15000);                     //wait 15sec
  }


void RHcheck() {                    //Check Humidity Level Function
  digitalWrite(DHTpower, HIGH);     //On Humidity Sensor
  delay(5000);
  Serial.println("============ Check Humidity ===============");
  delay(1000);
  Serial.println("DHT11 readings...");
   
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;

  //This bit will tell our Arduino what to do if there is some sort of an error at getting readings from our sensor
  if ((err = dht11.read(pinDHT11, &temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("No reading , err="); Serial.println(err);delay(1000);
    return;
  }
  Serial.print("Readings: ");
  Serial.print((int)temperature); Serial.print(" C, ");
  Serial.print((int)humidity); Serial.println(" %");
  delay(500);
  if((int)humidity < 50){
    digitalWrite(DHTpower, LOW);
    delay(500);
    Serial.println("Fan OFF");
    delay(500);
    digitalWrite(Fan, LOW);
  }else{
    if ((int)humidity > 58){
      Serial.println("Humidity > 58%");
      digitalWrite(DHTpower, LOW);
      delay(500);
      Serial.println("Fan ON @ full speed");
      delay(500);
      digitalWrite(Fan, HIGH);
    }else{
      Serial.println("50% < Humidity < 58%");
      digitalWrite(DHTpower, LOW);
      delay(500);
      Serial.println("Fan ON @ low speed");
      delay(500);
      analogWrite(Fan, 150);
    }
  }
 }

Schematics

Wiring Schematic
Wiring diagram ck4nhbbj4q

Comments

Similar projects you might like

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 10,004 views
  • 2 comments
  • 20 respects

Temperature + Humidity on LCD

Project showcase by interpeo

  • 19,969 views
  • 11 comments
  • 49 respects

Beautifully Finished Humidity and Temperature Sensor

Project tutorial by Wicked Makers

  • 16,866 views
  • 21 comments
  • 135 respects

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Rick_Findus

  • 7,412 views
  • 6 comments
  • 13 respects

Temperature and Humidity Sensor

by Amarantowy

  • 5,168 views
  • 1 comment
  • 15 respects

Sensor-Controlled Guard Lights

Project showcase by LIMPINGLIM

  • 1,293 views
  • 0 comments
  • 6 respects
Add projectSign up / Login