Interfacing Humidity Controller Module with Arduino

Humidity Controller Module
A humidity controller module is a device used to monitor and regulate humidity levels by switching humidifiers or dehumidifiers on and off. It operates by sensing the ambient humidity and controlling a relay to maintain the desired humidity range. These modules are widely used in greenhouses, storage rooms, and industrial applications.
Working Principle of Humidity Controller Module
The humidity controller module continuously monitors humidity levels through a built-in or external sensor. When the humidity exceeds or falls below the preset threshold, it activates or deactivates the connected device via a relay. This ensures stable and optimal humidity control for various applications.
Types of Humidity Controllers
Programmable Humidity Controller
- Measures ambient humidity.
- Compares it with the user-defined setpoint.
- Activates or deactivates the relay based on humidity conditions.
Non-Programmable Humidity Controller
- Monitors the humidity in real-time.
- Triggers humidifiers or dehumidifiers when the humidity limit is exceeded.
Requirements
Pin Configuration of Humidity Controller Module
Relay Output Humidity Controller
- VCC: Connect to +5V on Arduino.
- GND: Connect to GND on Arduino.
- OUT: Connect to a digital input pin on Arduino to monitor relay status.
Sensor-based Humidity Controller
- VCC: Connect to +5V on Arduino.
- GND: Connect to GND on Arduino.
- DATA: Connect to an analog or digital input pin for humidity readings.
Wiring the Humidity Controller to Arduino
To connect the humidity controller module to the Arduino, connect the VCC and GND pins to +5V and GND on the Arduino. The output pin (OUT) should be connected to a digital input pin to read the relay state, while the sensor pin (if available) should be connected to an analog or digital pin for humidity readings.
Algorithm
Initialize Components
- Connect the VCC and GND pins of the humidity controller to +5V and GND on the Arduino.
- Connect the output or sensor pin to a digital or analog input pin on the Arduino.
Write the Code
- Set the humidity controller pin as INPUT in the setup() function.
- Read the sensor or relay state in the loop() function.
- Use the readings to control connected devices based on humidity conditions.
Display Values or Control Devices
- Print humidity readings or relay status to the serial monitor.
- Use the data to activate humidifiers, dehumidifiers, or other appliances accordingly.
Test the Project
- Upload the code to the Arduino.
- Test the humidity controller by adjusting the humidity to trigger the relay.
Arduino Code
1// Interfacing Humidity Controller Module with Arduino
2// This code monitors the digital output from a humidity controller module and takes action accordingly
3
4const int humidityPin = 7; // DOUT pin of the humidity module connected to Arduino pin 7
5const int fanPin = 8; // Output device like fan or humidifier
6
7void setup() {
8 pinMode(humidityPin, INPUT);
9 pinMode(fanPin, OUTPUT);
10 digitalWrite(fanPin, LOW);
11 Serial.begin(9600);
12 Serial.println(\"Humidity Controller Ready\");
13}
14
15void loop() {
16 int humidityStatus = digitalRead(humidityPin);
17
18 if (humidityStatus == LOW) {
19 // Humidity is below threshold, turn ON fan/humidifier
20 digitalWrite(fanPin, HIGH);
21 Serial.println(\"Humidity LOW - Turning ON humidifier/fan\");
22 } else {
23 // Humidity is OK or high, turn OFF output
24 digitalWrite(fanPin, LOW);
25 Serial.println(\"Humidity HIGH - Turning OFF humidifier/fan\");
26 }
27
28 delay(1000);
29}
Applications of Humidity Controllers
- Humidity regulation in greenhouses
- Storage room humidity control
- Industrial air quality management
- Smart home climate management
- Mushroom and plant growth optimization
- Server room humidity monitoring
Conclusion
Integrating a humidity controller module with Arduino allows for precise humidity monitoring and control. These modules are crucial for automation in greenhouses, storage areas, and industrial environments. By following simple wiring and coding steps, you can easily implement humidity regulation in your projects.