Using ESP 32 with a program to run Room and coil sensor

```*Hi so I get this weird error reading when i run the serial monitor. does not show any readings correctly, i have attached a picture with this.
![IMG20230112111633|375x500](upload://eWRfanTMrjbunQTXTFLgZjrGvwz.jpeg)
*
//These   values are in the datasheet
#define RT0 10000   // Ω
#define B 3977      //   K
//--------------------------------------

#define VCC 5    //Supply   voltage
#define R 10000  //R=10KΩ

//Variables
float RT, VR, ln, Tx,   TO, VRT;

void setup() {
  Serial.begin(9600);
  TO = 25 + 273.15;                 //Temperature   T0 from datasheet, conversion from Celsius to kelvin
}

void loop() {
   VRT = analogRead(39);              //Acquisition analog value of VRT
  VRT   = (5.00 / 1023.00) * VRT;      //Conversion to voltage
  VR = VCC - VRT;
   RT = VRT / (VR / R);               //Resistance of RT

  ln = log(RT / RT0);
   Tx = (1 / ((ln / B) + (1 / TO))); //Temperature from thermistor

  Tx =   Tx - 273.15;                 //Conversion to Celsius

  Serial.print("Temperature:");
   Serial.print("\  ");
  Serial.print(Tx);
  Serial.print("C\  \ ");
//   Serial.print(Tx + 273.15);        //Conversion to Kelvin
//  Serial.print("K\  \ ");
   Serial.print((Tx * 1.8) + 32);    //Conversion to Fahrenheit
  Serial.println("F");
   delay(1000);
   
}

[/quote]


*
//These values are in the datasheet
#define RT0 10000 // Ω
#define B 3977 // K
//--------------------------------------

#define VCC 5 //Supply voltage
#define R 10000 //R=10KΩ

//Variables
float RT, VR, ln, Tx, TO, VRT;

void setup() {
Serial.begin(9600);
TO = 25 + 273.15; //Temperature T0 from datasheet, conversion from Celsius to kelvin
}

void loop() {
VRT = analogRead(39); //Acquisition analog value of VRT
VRT = (5.00 / 1023.00) * VRT; //Conversion to voltage
VR = VCC - VRT;
RT = VRT / (VR / R); //Resistance of RT

ln = log(RT / RT0);
Tx = (1 / ((ln / B) + (1 / TO))); //Temperature from thermistor

Tx = Tx - 273.15; //Conversion to Celsius

Serial.print("Temperature:");
Serial.print("\ ");
Serial.print(Tx);
Serial.print("C\ \ ");
// Serial.print(Tx + 273.15); //Conversion to Kelvin
// Serial.print("K\ \ ");
Serial.print((Tx * 1.8) + 32); //Conversion to Fahrenheit
Serial.println("F");
delay(1000);

}

have a read of how-to-get-the-best-out-of-this-forum
in particular you post is very difficult to read - use code tags</>
also avoid using images of screen output - copy the text and upload it

in the Arduino IDE select Fil;e>Preferences and enable "Verbose output during Compiling and upload" then compile your program again
if there are problems upload the error messages as text
run the program and upload any serial monitor output which shows the problem as text (not an image)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.