About temprature_sens_read();

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

About temprature_sens_read();

Postby Nespressif » Thu Feb 08, 2018 4:54 pm

Hi guys, I'd like to know why this function (temprature_sens_read ();) it gives me back a value of 175 approx. with this https://es.aliexpress.com/item/ESP32-De ... 10563.html and a value of approx. 75. with a board bought earlier, both revision 1 and the software is the same.

It's just a curiosity, Greetings.

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: About temprature_sens_read();

Postby ESP_Sprite » Fri Feb 09, 2018 3:37 am

The internal temperature sensor unfortunately has a pretty big random offset that differs from chip to chip. It can be useful to keep track of temperature deltas, but you can't really infer an absolute temperature from then value. We may have some more accurate ways to get the temperature, but at this moment they're not implemented in esp-idf yet.

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: About temprature_sens_read();

Postby Nespressif » Fri Feb 09, 2018 7:51 am

Thanks for the answer, ESP_Sprite. No problem, I only use this value to check the chip stability, I get the temperature and humidity with I2C sensors.

Greetings,

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: About temprature_sens_read();

Postby davdav » Fri Feb 23, 2018 5:05 pm

Hi,

what is the include file to use the "temprature_sens_read" function?

I have searched all the esp-idf folder components but I don't find it..
How to read the internal temperature sensor

Note: I'm not using ArduinoESP32.. I use ESP32 with esp-idf (latest available version)

Thanks.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: About temprature_sens_read();

Postby loboris » Fri Feb 23, 2018 7:00 pm

Just add to your source

Code: Select all

extern uint8_t temprature_sens_read();

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: About temprature_sens_read();

Postby davdav » Mon Feb 26, 2018 7:56 am

Thanks Loboris, that works.

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: About temprature_sens_read();

Postby davdav » Thu Mar 01, 2018 2:04 pm

I have checked that temperature differs a lot from chip-to-chip (20 celsius degree).

I have also checked that when WiFi is turned on the temperature increases but measuring with a termometer the behaviour seems to be quite linear so I can take care of it. In practice this is not a big problem..


Regarding the spread of temperature read from chip-chip, I would like to know if the internal sensor is affected by the ADC problem with Vref and non-linearity. If this is the case, the new version of ESP-IDF which includes Vref and 2-point calibration stored on EFUSE, the problem should be automatically solved.

Or, the temperature sensor itself differ from chip-to-chip (I guess they use a PTAT circuit or something like that)?

Thanks

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: About temprature_sens_read();

Postby ESP_Sprite » Fri Mar 02, 2018 1:56 am

No, the temperature sensor is an entirely different subsystem; ADC calibration will not improve its precision.

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: About temprature_sens_read();

Postby davdav » Fri Mar 02, 2018 9:28 am

OK ESP_Sprite, Thank you.

We use internal sensor as monitor for LiPo battery included on the product in order to stop charging outside a temperature range. So we are not looking for a high accuracy..just to have a measure to avoid damages to battery.

Do you think there could be a chance to improve the temperature sensor system at least to have less spread from chip-to-chip?
As I wrote, if the temperature rise when WiFi is turned on it is not a big deal. But having different value for different chip will require a compensation during production of the product.

Thanks

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: About temprature_sens_read();

Postby ESP_Sprite » Sat Mar 03, 2018 4:06 am

Not as of now. We have some ideas in relation to using the internal oscillator as a crude temperature sensor: its frequency deviates from the set frequency in a somewhat linear way over the temperature range, and we think that may have less variation than the 'real' temperature sensor. We haven't looked into that further yet, however.

Who is online

Users browsing this forum: TobyG99 and 64 guests