0

Board: esp32

I know my wiring is correct because I get data from the sensor, but the data is a bit weird.

At 22 celcius I get 140, even though if I do the voltage calculation (* 0.473372) it still doesn't work.

the number 0.473372... comes from taking the voltage 4.7v / 1024 * 1000 / 10

My code:

 Serial.print("temp: ");
 float temp = (analogRead(A13) * 0.473372781065088);
 Serial.println(temp);
 delay(2000);

Any answers?

user216002
  • 11
  • 1
  • 5

2 Answers2

0

ok, the problem is that i used to the wrong voltage conversion, just use:

RawValue = analogRead("your analog input pin");
Voltage = (RawValue / 2048.0) * 3300;
Serial.println(Voltage);

this should print the tempeture in celcious

user216002
  • 11
  • 1
  • 5
-1

enter image description here try this one i have worked with lm35 using this code and circuit. i have done this thing with arduino uno but you can try it with esp32