Poor air circulation can make a room uncomfortable, particularly when the temperature or humidity rises. A simple way to automate ventilation is to monitor these conditions with a sensor and use an Arduino to control a fan through a relay.
This project uses an Arduino Uno and a DHT11 temperature and humidity sensor. The Arduino reads the sensor values, compares them with predefined limits, and controls the ventilation fan accordingly.
Components Required
- Arduino Uno
- DHT11 temperature and humidity sensor module
- 5V single-channel relay module
- AC ventilation fan
- Breadboard and jumper wires
- External power supply, if required by the fan
Hardware Connections
The sensor connects to the Arduino's low-voltage supply and digital interface. The relay module receives its control signal from another digital pin.
DHT11 temperature and humidity sensor
- VCC → Arduino 5V
- GND → Arduino GND
- DATA → Arduino digital pin 2
The project uses a DHT11 module with an onboard pull-up resistor, so no additional pull-up resistor is required for that module.
5V single-channel relay module
- VCC → Arduino 5V
- GND → Arduino GND
- IN → Arduino digital pin 8
The fan's live wire is routed through the relay's Normally Open (NO) terminal, so the fan is intended to remain off at system startup. The original project uses an AC fan as the controlled load.
Safety note: AC mains wiring must be properly insulated and enclosed. Use a relay with suitable voltage and current ratings for the fan, and do not handle exposed mains connections while powered.
How the System Works?
The control process has four main stages:
- The DHT11 measures the surrounding temperature and humidity.
- The Arduino reads the sensor data.
- The readings are compared against preset thresholds.
- The relay switches the fan on or off according to the control conditions.
The fan turns on when the configured limits are exceeded and turns off when the readings return to the defined normal range.
The project uses rule-based control rather than a complex control algorithm. This keeps the system relatively straightforward to understand and implement.
An Important Control Consideration
If sensor readings fluctuate close to a threshold, the relay may switch repeatedly. One possible improvement is hysteresis, which uses separate turn-on and turn-off thresholds. This can reduce unnecessary switching, although it is an enhancement to explore rather than a feature specified in the original project.
The original project description does not provide exact threshold values, so these would need to be selected for the intended room and ventilation requirements.
Further Reading
The complete project reference, including the original hardware connections and implementation details, is available here:
https://pcbcool.com/technical-guides/diy-automatic-room-ventilation-system-with-arduino/
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.