Reading values of Onboard Temperature sensor

AmulKetR
Posts: 3
Joined: Mon May 28, 2018 4:16 pm

Reading values of Onboard Temperature sensor

Postby AmulKetR » Mon May 28, 2018 4:31 pm

Hello all,

I have been testing on board Temperature sensor. I followed the reference from an arduino example. I have used the predefined function "temprature_sens_read()" and got constant temperature as the result irrespective of how warm or cold the module is. It is not the issue of the module, as I have tested the code with more than one dev kit. I am using a basic ESP32 dev kit to test the temperature sensor.

I have integrated my code into Hello_world and the result is as follows:
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 10 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 9 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 8 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 7 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 6 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 5 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 4 seconds...
Temp: 53.333332 Celsius...
Temp: 128 F...
Restarting in 3 s
It would be great if if some one can give any API reference to read the temperature values correctly.
To my knowledge, there is no Hardware or API reference for on board temperature sensor mentioned in ESP-IDF documentation.

Thanks in advance :)

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Reading values of Onboard Temperature sensor

Postby fly135 » Wed May 30, 2018 4:55 pm

Where do you find the temperature_sens_read function? Doesn't appear to be in my SDK.

John A

AmulKetR
Posts: 3
Joined: Mon May 28, 2018 4:16 pm

Re: Reading values of Onboard Temperature sensor

Postby AmulKetR » Mon Jun 04, 2018 9:19 am

Hello John,
I followed the below tutorial
https://github.com/pcbreflux/espressif/ ... sensor.ino

Thank you for the reply. I was able to flash the code. All I did is intergrate into hello_world program.
The Temperature values displayed were too high(around 128 F).

Amulya K

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

Re: Reading values of Onboard Temperature sensor

Postby loboris » Mon Jun 04, 2018 12:47 pm

The exaple code in test_tsens.c can also used for reading the internal temperature sensor.
It looks like temprature_sens_read() function from librtc.a always returns 128 with the latest master esp-idf.

Who is online

Users browsing this forum: ulaoulao and 85 guests