#define BLYNK_PRINT Serial #define BLYNK_USE_DIRECT_CONNECT #include #include #include // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "Your Auth Token"; #include int analog = 0; //analog pin raw value int V_0 = 3276; //cirquit voltage [mV] double V_R0 = 1; //initial value of voltage devider[mV] int circuit_R0 = 9800; //resistance of voltage divider[ohm] int thermo_B = 3380; //B parameter of thermistor int thermo_R0 = 10000; //reference resistance of thermistor [ohm] int thermo_T0 = 298; //reference tempereture of thermistor[K] double thermo_R = 1; //initial resistance of thermistor[ohm] double temp = 25.00; //initial value of measured temperature[degC] void setup () { Serial.println("Waiting for connections..."); Blynk.setDeviceName("Blynk"); Blynk.begin(auth); pinMode(34, INPUT); // thermistor Serial.begin(9600); /* 9600 bps connect serial */ Serial.println("READ_START"); } void loop () { Blynk.run(); analog = analogRead(34); V_R0 = analog * 3.28 / 4096 * 1000; //voltage divider calculation thermo_R = V_0 / V_R0 * circuit_R0 - circuit_R0; //thermistor resistance calculation Serial.println( analog); Serial.println( V_R0); Serial.println( thermo_R); //printing thermistor resistance temp = (1000 / (1 / (0.001 * thermo_T0) + log(thermo_R / thermo_R0) * 1000 / thermo_B) - 273); //temparature calculation Blynk.virtualWrite(V0, temp); Serial.println(temp, 1); //printing temparature delay(100); // waiting for 0.1s }