#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL6StTbHCD4"
#define BLYNK_TEMPLATE_NAME "Sensor ntc"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
const int NTC_PIN = 15;
const int LED_PIN = 13;
const float BETA = 3950;
char auth[] = "LvnhB9aaW_uQRpwZj31Cl05TeIVTcEf1";
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
BlynkTimer timer;
void setup() {
Serial.begin(9600);
pinMode(NTC_PIN,INPUT);
pinMode(LED_PIN,OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop() {
Blynk.run();
timer.run();
int analogValue = analogRead(15);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.println(" ℃");
if(celsius>=35){
digitalWrite(13, HIGH);
}else{
digitalWrite(13, LOW);
}
Blynk.virtualWrite (V0, celsius);
delay(1000);
}