Menu Close
Spread the love

Arduino-Temperature-Fan

 

lcd-dht11

When the temperature is 30 or more then The fan will work.
Here is checked temperature, and if the temperature of 30 or above will operate the
fan to cool the heat in the place or anything to be cool.
This project is very small but it will help you work on larger projects.

uper

 

#include <DHT11.h>
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int pin2 = 6;
int pin = A0;
DHT11 dht11(pin);

double Fahrenheit(double celsius) {
return ((double)(9 / 5) * celsius) + 32;
}

double Kelvin(double celsius) {
return celsius + 273.15;
}

void setup() {
lcd.begin(16, 2);
lcd.clear();
lcd.print(“Humidity & temp”);
delay(3000);
lcd.clear();
lcd.print(“Starting…..”);
delay(3000);
pinMode(pin2, OUTPUT);
lcd.clear();
}

void loop() {
int err;
float temp, humi;
if ((err = dht11.read(humi, temp)) == 0)
{
delay(500);
lcd.setCursor(0, 0);
lcd.print(“Temp”);
lcd.setCursor(0, 1);
lcd.print(“Humidity”);
lcd.setCursor(9, 0);
lcd.print(temp);
lcd.print(” C”);
lcd.setCursor(9, 1);
lcd.print(humi);
lcd.print(” %”);
delay(600);
if (temp >= 30){
digitalWrite(pin2, HIGH);
}
else
{
digitalWrite(pin2, LOW);
}
}
else
{
lcd.println();
lcd.print(“Error No :”);
lcd.print(err);
lcd.println();
}
}

Down

 

For more Please make sure to subscribe to Officialhrm YouTube channel and like Facebook Page.

Thank you for visiting OfficialhrmPlease don’t forget to share this website with your friends.

Download

File Description Date added File size Downloads
zip Lib August 15, 2018 3:34 pm 34 KB 4306
zip dht11 August 15, 2018 3:37 pm 316 KB 3940
Posted in Arduino

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *