Arduino interfacing with DHT11 and 4Relay module

Arduino interfacing with DHT11 and 4Relay module

In this article we will learn how to interface Arduino with DHT11 and 4Relay module.
In the last post we learn about how to interface Arduino with LDR and servo motor. you can visit our website ,
Now a day’s I’m busy in giving interviews that’s why there was a little delay of making the projects ,I hope you appreciate my work ,lets discuss about today’s project.

The actual image of our project.

Arduino interfacing with DHT11 and 4Relay module, DHT11 arduino. DHT11 with LCD
Arduino interfacing with DHT11 and 4Relay module

Components which we use in this project list below:

  1. Humidity sensor (DHT11)
  2. Bread Board
  3. LED’s
  4. 9V Battery
  5. Push button
  6. 4 Relay module
  7. Fan (4 Pcs)
  8. Wires (As req.)

Construction diagram of arduino interfacing with DHT11 and 4relay module project.

Arduino interfacing with DHT11 and 4Relay module
Arduino interfacing with DHT11 and 4Relay module

Construction of  arduino interfacing with DHT11 and 4Relay module:

Connect the GND point of arduino with –ve terminal of battery.

Connect the VIN point of arduino with +ve terminal of battery through toggle button.

Connect DHT11’s –ve point to GND of arduino.

Connect DHT11’s +ve point to 5V of arduino nano.

Connect signal points of sensor (DHT11) to D2 pin of arduino nano.

Connect VCC point of four relay module to 5V point of arduino.

Connect GND point of four relay to GND point of arduino.

Connect in1 point of four relay module to D3 point of arduino.

Connect in2 point of four relay module to D4 point of arduino.

Connect in3 point of four relay module to D5 point of arduino.

Connect in4 point of four relay module to D6 point of arduino.

Connect 5V of arduino to common point of relays.

Connect GND points of arduino to GND points of fans.

Connect NO point of relay1 to fan1.

Connect NO point of relay2 to fan2.

Connect NO point of relay3 to fan3.

Connect NO point of relay4 to fan4.

Dress up all the wires clean and tidy.

Working of  arduino interfacing with DHT11 and 4Relay module:

After connecting all the components, press the toggle switch then arduino is power on.

When temperature lies between 90 to 95F then fan1 is on.

When temperature lies between 95 to 100F then fan2 is on.

When temperature lies between 100 to 105F then fan3 is on.

When temperature increase to 105F then fan4 is on.

Application of the arduino interfacing with DHT11 and 4relay module:

  1. This project is use for (Home automation system).
  2. This project is use for (Green house monitoring and control).
  3. This project is use for (Terrarium control).
  4. This project is use for (wine cellar management).
  5. This project is also use for (Data logging for environmental analysis).
  6. This project is use for (Automated plant watering system).
  7. This project is use for (Home Brewery system).
  8. This project is also use for (server room monitoring).
  9. This project is also use for (Pet habitat control).
  10. This project is use for (Weather station).

 

Advantages of arduino interfacing with DHT11 and 4relay module project are listed below:

  1. Customizability
  2. Energy efficiency.
  3. Data monitoring.
  4. Remote control.
  5. Learning opportunity.
  6. Low-cost solution.
  7. Diy flexibility.
  8. Fun creativity.

Program coding of this project:

 

#include <DHT.h>

#define DHTPIN 2 // DHT11 data pin
#define RELAY1 3 // Relay 1 control pin
#define RELAY2 4 // Relay 2 control pin
#define RELAY3 5 // Relay 3 control pin
#define RELAY4 6 // Relay 4 control pin

#define DHTTYPE DHT11 // DHT11 sensor type

DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
dht.begin();

pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);

// Turn off all relays initially
digitalWrite(RELAY1, HIGH);
digitalWrite(RELAY2, HIGH);
digitalWrite(RELAY3, HIGH);
digitalWrite(RELAY4, HIGH);
}

void loop() {
// Read temperature in Fahrenheit
float tempF = dht.readTemperature(true);

if (!isnan(tempF)) {
Serial.print(“Temperature: “);
Serial.print(tempF);
Serial.println(” °F”);

// Control relays based on temperature
if (tempF >= 60.0 && tempF < 70.0) {
digitalWrite(RELAY1, LOW); // Turn on Relay 1
} else {
digitalWrite(RELAY1, HIGH); // Turn off Relay 1
}

if (tempF >= 70.0 && tempF < 85.0) {
digitalWrite(RELAY2, LOW); // Turn on Relay 2
} else {
digitalWrite(RELAY2, HIGH); // Turn off Relay 2
}

if (tempF >= 85.0 && tempF < 95.0) {
digitalWrite(RELAY3, LOW); // Turn on Relay 3
} else {
digitalWrite(RELAY3, HIGH); // Turn off Relay 3
}

if (tempF >= 95.0) {
digitalWrite(RELAY4, LOW); // Turn on Relay 4
} else {
digitalWrite(RELAY4, HIGH); // Turn off Relay 4
}
} else {
Serial.println(“Failed to read temperature from DHT sensor!”);
}

delay(5000); // Wait for 5 seconds before taking another reading
}