#define FAN_PIN D2 // FAN RELAY int inputpin = A0; // LM35 input pin void setup() { Serial.begin(115200); pinMode(FAN_PIN, OUTPUT); digitalWrite(FAN_PIN, LOW); } void loop() { int analogValue = analogRead(inputpin); float millivolts = (analogValue / 1024.0) * 3300; //3300 is the voltage provided by NodeMCU float celsius = millivolts / 10; Serial.print("in DegreeC= "); Serial.println(celsius); // Compare Threshold value from Blynk and DHT Temperature value. if (celsius > 30) { digitalWrite(FAN_PIN, HIGH); } else { digitalWrite(FAN_PIN, LOW); } } //@ApePanthiya ICT