/**
ESP32 + DHT22 Example for Wokwi
https://wokwi.com/arduino/projects/322410731508073042
*/
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("Supply ");
get_temps(34);
delay(1000);
Serial.print("Return ");
get_temps(35);
delay(1000);
Serial.print("Suction Line ");
get_temps(32);
delay(1000);
Serial.print("Liquid Line ");
get_temps(33);
delay(1000);
}
void get_temps(int pin) {
int analogValue = analogRead(pin);
//Serial.println(analogValue);
float celsius = 1 / (log(1 / (4096. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
float farenheit = (celsius*1.8)+32;
//Serial.print(celsius);
// Serial.print(" ℃ / ");
Serial.print(farenheit);
Serial.println(" ℉ ");
}