esp32 internal temperature sensor

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
nebenzahl
Posts: 26
Joined: Mon Jul 01, 2019 5:38 pm
Location: Uruguaiana, Brazil
Contact:

esp32 internal temperature sensor

Post by nebenzahl » Mon Jul 22, 2019 2:53 pm

I can not read the internal sensor temperature of esp32.
For I do not know which unit of measure is the integer value that I am receiving.
The [esp32.raw_temperature ()] command returns a value that I convert to Kelvin, Celsius or Fahrenheit, but no value of the result makes sense.
How do I convert the value I get?
Eng. Luiz Nebenzahl

rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

Re: esp32 internal temperature sensor

Post by rpr » Tue Jul 23, 2019 12:58 am

The value is in deg Fahrenheit.

Code: Select all

import esp32
tf = esp32.raw_temperature()
tc = (tf-32.0)/1.8
print("T = {0:4d} deg F or {1:5.1f}  deg C".format(tf,tc))
That said, I saw this thread on github: https://github.com/espressif/arduino-esp32/issues/2422, which mentions that this function is deprecated on newer versions of the chip.

User avatar
nebenzahl
Posts: 26
Joined: Mon Jul 01, 2019 5:38 pm
Location: Uruguaiana, Brazil
Contact:

Re: esp32 internal temperature sensor

Post by nebenzahl » Tue Jul 23, 2019 1:00 pm

Thanks for the answer.
I got the same result I was getting.
I was confused, because the result was 140 ° F or 60 ° C, so I wondered, what will this temperature be like? it is very hot, and the ambient temperature I am at is 19 ° C or 66.2 ° F.
I want to control the temperature of the device, so be warned if it's too hot to melt the device.
Thanks again for the reply.
Eng. Luiz Nebenzahl

rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

Re: esp32 internal temperature sensor

Post by rpr » Tue Jul 23, 2019 3:16 pm

I am getting about 52 deg C. This is on a cold start with no processing except a repl. Not sure what the limits are. I think devices can do 60 deg C OK.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: esp32 internal temperature sensor

Post by Roberthh » Tue Jul 23, 2019 8:26 pm

According to the data sheet, 125*C is the limit for the operating temperature. So 52°C is pretty comfy,

User avatar
nebenzahl
Posts: 26
Joined: Mon Jul 01, 2019 5:38 pm
Location: Uruguaiana, Brazil
Contact:

Re: esp32 internal temperature sensor

Post by nebenzahl » Wed Jul 24, 2019 3:01 pm

Yes, I saw it in the datasheet. But I had doubts, because at a temperature much lower than 125 ° C some plastic materials melt.
But this temperature of 125 ° C is the internal temperature, and this is what I will be monitoring.
I have this concern, because my device will operate on vehicles, and vehicles usually remain in the scorching sun for a long time, especially in the summer of my region, that the ambient temperature reaches easy 40 ° C in the shade.
Then I will use this temperature as a parameter.
Thank you so much for your attention.
Eng. Luiz Nebenzahl

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: esp32 internal temperature sensor

Post by Roberthh » Wed Jul 24, 2019 3:18 pm

No. The plastic used for these cases do not melt easily, not even with a soldering iron. For you estimation, you can take the difference of the core temp to the environmental temp for the estimation. Cars can get up to 80°C inside, when standing in the sun. Add the difference you have seen to 80°C.

P.S.: Actually we have >40°C here now, outside in the shade, and 34°C at my desk. In a similar weather situation, we had once seen in a corner office with nice large windows >50°C. But no one was inside. We had just set up a test how far it can get.

User avatar
nebenzahl
Posts: 26
Joined: Mon Jul 01, 2019 5:38 pm
Location: Uruguaiana, Brazil
Contact:

Re: esp32 internal temperature sensor

Post by nebenzahl » Wed Jul 24, 2019 8:08 pm

Thank you for sharing your experience, I am very grateful.
I will do what you indicated, I will be estimating the temperature by comparison, then in practice I will reach more accurate values.

Thanks for the help, hug!
Eng. Luiz Nebenzahl

Post Reply