DIY Automatic Room Ventilation System Using Arduino

by steven_89 in Circuits > Arduino

18 Views, 0 Favorites, 0 Comments

DIY Automatic Room Ventilation System Using Arduino

7a9c2daf-c689-4c8b-bac4-e96d2fa1d7ed.png
DIY-Automatic-Room-Ventilation-System-with-Arduino.jpg

Have you ever forgotten to switch on the ventilation fan when a room becomes too hot or humid? An automatic ventilation system can help solve this problem by monitoring the surrounding conditions and switching the fan on whenever ventilation is needed.

In this project, we will control a ventilation fan using Arduino Uno and DHT11 temperature and humidity sensor and a relay module. Instead of manually operating the fan, the system compares the sensor readings with predefined limits and automatically controls the output.

The project is suitable for beginners who want to explore sensor-based automation, relay switching, and basic environmental monitoring.

Supplies

Gather the following components before starting:

  1. Arduino Uno
  2. DHT11 temperature and humidity sensor module
  3. 5V single-channel relay module
  4. AC ventilation fan
  5. Breadboard
  6. Jumper wires
  7. Appropriate power supply for the fan

The exact power requirements depend on the fan being used. Make sure the relay is rated for the fan's voltage and current.

Wiring Connections

FXX3ESSMV8F2AHT.jpg

Connect the DHT11 Sensor

The DHT11 provides the temperature and humidity readings required for automatic control.

Connect the sensor module as follows:

  1. VCC to Arduino 5V
  2. GND to Arduino GND
  3. DATA to Arduino digital pin 2

Many DHT11 modules already include a pull-up resistor, so an additional resistor may not be necessary. Check your particular module before wiring it.

Connect the Relay Module

The relay acts as the switching interface between the Arduino control circuit and the fan's power circuit.

Connect the relay module's control pins as follows:

  1. VCC to Arduino 5V
  2. GND to Arduino GND
  3. IN to Arduino digital pin 8

The example project uses an active-low relay module. For this type of module, a LOW signal activates the relay, while a HIGH signal deactivates it.

Confirm the behavior of your specific relay module before connecting the fan.

Connect the Ventilation Fan

The fan is switched through the relay contacts. Using the Normally Open (NO) contact allows the fan to remain off when the relay is not energized, provided the circuit is wired and configured correctly.

Because this project involves AC mains voltage, take extra care with the load-side wiring.

Safety precautions:

  1. Disconnect the power supply before making or changing connections.
  2. Use a relay rated for the fan's voltage and current.
  3. Keep exposed mains connections insulated and enclosed.
  4. Do not connect AC mains wiring to the Arduino's low-voltage breadboard.
  5. If you are unfamiliar with mains wiring, have a qualified person complete and verify the AC-side connections.

Complete and check the low-voltage wiring before testing the control system. Never handle exposed mains connections while the circuit is powered.

How Does It Work?

The system follows a straightforward process:

  1. The DHT11 sensor measures the room temperature and relative humidity.
  2. The Arduino reads the sensor values.
  3. The readings are compared with preset temperature and humidity thresholds.
  4. If either threshold is exceeded, the Arduino activates the relay to switch on the fan.
  5. When both readings return below their thresholds, the relay switches the fan off.
  6. The process repeats after a short delay.

In the example configuration, the temperature threshold is 30°C and the humidity threshold is 70%.

The fan is controlled through a relay module, which allows a low-voltage Arduino signal to control the fan's power circuit.

Configure the Automatic Control Logic

The control strategy is based on two threshold values:

  1. Temperature threshold: 30°C
  2. Relative humidity threshold: 70%

The Arduino checks the sensor readings and activates the fan if the temperature exceeds 30°C or the relative humidity exceeds 70%.

The fan switches off when both readings are at or below their respective thresholds.

The example system checks the sensor approximately every three seconds. However, the DHT11 has limitations in response speed and measurement precision, so frequent readings do not necessarily provide new or more accurate data.

The original implementation also checks for failed sensor readings before making a switching decision.

Testing the System


Once the hardware is assembled and the wiring has been checked, test the system carefully.

  1. Verify the DHT11 connections and relay control wiring.
  2. Check that the relay remains in the intended off state during startup.
  3. Monitor the temperature and humidity readings through the Arduino serial monitor.
  4. Observe whether the relay activates when either threshold is exceeded.
  5. Confirm that the fan switches off when both readings return below the configured limits.
  6. Check that sensor errors do not trigger unintended switching.

Use controlled and safe testing conditions. Do not expose the electronics to water, excessive heat, or other conditions that could damage the components.

Further Improvements

After the basic system works reliably, you can consider several upgrades:

  1. Replace the DHT11 with a DHT22 for applications that need improved measurement capability.
  2. Add an LCD or OLED display to show the current temperature and humidity.
  3. Use an ESP32 to add network connectivity and remote monitoring.
  4. Implement hysteresis to reduce unnecessary relay switching.
  5. Add operating-status indicators to make troubleshooting easier.

Choose upgrades based on the actual requirements of the room and the intended application.

Conclusion

This Arduino-based ventilation project demonstrates how a temperature and humidity sensor can be combined with simple control logic to automate a fan. It introduces several useful electronics concepts, including sensor interfacing, digital outputs, relay operation, and threshold-based decision-making.

The design can serve as a starting point for more advanced environmental monitoring and automation projects. PCBCool is a relevant reference for those exploring the transition from electronics prototypes to PCB manufacturing and assembly.

For the Arduino code and implementation details, visit PCBCool: DIY Automatic Room Ventilation System with Arduino