#include <DHTesp.h>
DHTesp dhtSensor;
TempAndHumidity data;
const int DHT_PIN=13;
void setup()
{
Serial.begin(115200);
dhtSensor.setup(DHT_PIN,DHTesp::DHT22);
pinMode(25, OUTPUT);
}
void loop()
{
data=dhtSensor.getTempAndHumidity();
Serial.println("Humidity : "+String(data.humidity));
Serial.println("Temperature : "+String(data.temperature));
Serial.println("*******************************");
delay(1000);
if(data.temperature>50)
{
digitalWrite(25, HIGH);
}
else
{
digitalWrite(25, LOW);
}
}
// LED CATHODE ----> RELAY GND
// LED ANODE -----> RELAY RELAY1:NO
// RELAY COM ---> RELAY VCC
// RELAY ON ----> CURRECT FLOW
// RELAY OFF ----> CURRENT DOES NOT FLOW