sensor uint8 temperature_sensor_read()

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

sensor uint8 temperature_sensor_read()

Postby rudi ;-) » Wed Dec 23, 2015 4:46 am

Hi
we have onSoC Sensor as temperature.
we have uint8 as F ( Fahrenheit ) ?
this are ~ -17 °C to 123 °C
so we can use simply code for conversion in Celsius, too?

Code: Select all


// simply code
uint8 temper;
float celsius;

temper= temperature_sensor_read();
celsius = ( temper - 32 ) / 1.8;
printf("Sensor onBoard is F: %i    C: %.2f\n", temper, clesius);



can we calibrate the sensor or can we use simply calibrate
by add or subtract comparative measurement and the difference to the reference?

best wishes
rudi ;-)

ps:
the sensor shows actually in a loop stable value.
the value itself must be calibrate if use for ambient temperature.
factor for self-heating to be considered by measurements?

Test TempSensor.JPG
Test TempSensor.JPG (22.24 KiB) Viewed 4810 times

( you can click for follow to a < 1MB video of the output and enlarge the pic )


btw:
i tested utf8 code in minicom for degree char with 0x00B0 but this shows not the right
in minicom. if you have the right conversion in this, reply/add yours please.

Code: Select all

printf(" %cF: %i\n ", 0x00B0, temper);
printf(" %cC: %.2f\n ", 0x00B0, celsius);
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: sensor uint8 temperature_sensor_read()

Postby rudi ;-) » Sat Dec 26, 2015 3:03 pm

Hi

think this is the finnish version:
be sure you subtract 32 from what is read result by

for me this works with a second little calibrate then ( 1 F ) comparatively with a DS18B20. for measurements ambient temperature in which is exposed to the ESP
completely adequate, txs espressif!

simple code:

Code: Select all

// simple code for the measurement of OnBoard sensor
// rudi 26 Dez 2015
// base is RTOS SDK 1.1.0
// ESP31B (1. Revision "false silkscreen")
 
uint8 temper;  // result in fahrenheit
float celsius;    // conversion in Celsius later
uint8 bugCorrection = 32 ; // bug correction value

// which can differ locally, fine tuning is always made
// by each itself, for me it was 0.6 degrees Celsius,
// that are 1,08 Fahrenheit ,  i round down to 1 here:
uint8 calibrateCorrection = 1 ; // calibrate with an mercury thermometer
 
// read now from SoC
temper= temperature_sensor_read();

// bugCorrecture - 32
temper= temper - bugCorrection;

// calibrate with an mercury thermometer - 1 Fahrenheit
temper= temper - calibrateCorrection;

// conversion fahrenheit in celsius
celsius = ( temper - 32 ) / 1.8;

// output fahrenheit and celsius result
printf("Sensor onBoard is F: %i    C: %.2f\n", temper, clesius);



picture ( done in windows XP with simple terminal ):
shows a calibrate with 1.4 °C


tempSensOk.JPG
tempSensOk.JPG (78.47 KiB) Viewed 4739 times


best wishes
rudi ;-)

ps:
the sensor shows actually in a loop stable value.
if you use this for ambient room measure fast and long time, there is a litle-little self-heating. test it by yourself and you can see a little little by max 0. 1 - 0.6 °C more as you calibrated .

If you use later Wifi and other we must do this again, the reference is
the first measuring with a calibrating like here.

if you use this for self-monitoring esp then you do not need calibrate again.
the value is the end value, for testing , you can use a Infrared Thermometer
https://en.wikipedia.org/wiki/Infrared_thermometer
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

WiFive
Posts: 1089
Joined: Tue Dec 01, 2015 7:35 am

Re: sensor uint8 temperature_sensor_read()

Postby WiFive » Sat Dec 26, 2015 9:54 pm

You have a graph of ambient temp accuracy (self-heating effect) over wider range of temperatures?

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: sensor uint8 temperature_sensor_read()

Postby rudi ;-) » Sun Dec 27, 2015 6:06 am

WiFive wrote:You have a graph of ambient temp accuracy (self-heating effect) over wider range of temperatures?


thanks for your interest and demand.

this will be the next step, the record with an overview of
ambient temp
"self-heating" by measuring processing SoC read procedure
"self-heating" by measuring with an Infrared Thermometer and compare with read result
and last but not least
number of "ticks" done in this meantime of measurement.
think this is still a crucial factor, when, where and which takes place a self-heating, if it should take place at all.

this ticks i try to increase with computing tasks later.
next steps then measurment with other processings example wifi, bt,..

just in time, i need the modul in other developing processing :)
because in the measurement, i can't program it with apps.
the long measurement is made in the intervals and pauses
when no work with it or sleep or rest.

hope we get to buy asap the module after chin. new year.
think these are previously unavailable.

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

santanapablo1975
Posts: 19
Joined: Wed Feb 15, 2017 8:31 pm

Re: sensor uint8 temperature_sensor_read()

Postby santanapablo1975 » Tue May 09, 2017 5:51 pm

Hi Rudi,

Do you know which ADC is used for the internal temperature sensor? I am asking because for example the hall sensor uses the ADC_1 ch 0 and 3.

Regards

Juan

User avatar
urbanze
Posts: 52
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: sensor uint8 temperature_sensor_read()

Postby urbanze » Mon Sep 18, 2017 12:58 am

Hi guys, I can't calibrate this sensor with ambient or case temperature. I have this informations:

All values are Degress *C.
CHIP and AMBIENT temperatures are measured by termometer.
READ temperature is Degress from code in ESP32.


READ____ CHIP-WIFI-ON__AMBIENT
50_______30____________30______//Start
63_______44____________30______//After run


READ____ CHIP-WIFI-OFF__AMBIENT
50_______30____________30______//Start
53_______37____________30______//After run

I try to use a linear math, but this not linear. How can I calibrate this ?

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: sensor uint8 temperature_sensor_read()

Postby rudi ;-) » Mon Sep 18, 2017 9:35 am

urbanze wrote:
Hi guys, I can't calibrate this sensor with ambient or case temperature. I have this informations:

All values are Degress *C.
CHIP and AMBIENT temperatures are measured by termometer.
READ temperature is Degress from code in ESP32.


READ____ CHIP-WIFI-ON__AMBIENT
50_______30____________30______//Start
63_______44____________30______//After run


READ____ CHIP-WIFI-OFF__AMBIENT
50_______30____________30______//Start
53_______37____________30______//After run

I try to use a linear math, but this not linear. How can I calibrate this ?



hi

have a note that post was from Dez 2015 and was for ESP31B (1. Revision "false silkscreen")

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
urbanze
Posts: 52
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: sensor uint8 temperature_sensor_read()

Postby urbanze » Mon Sep 18, 2017 12:09 pm

Oh :(

But cannot help me?

User avatar
rudi ;-)
Posts: 1089
Joined: Fri Nov 13, 2015 3:25 pm
Contact:

Re: sensor uint8 temperature_sensor_read()

Postby rudi ;-) » Tue Sep 19, 2017 6:50 am

urbanze wrote:Oh :(

But cannot help me?


how looks your code snip for read temp and how you convert it to °C ?
which time interval you read the temp?

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
urbanze
Posts: 52
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: sensor uint8 temperature_sensor_read()

Postby urbanze » Tue Sep 19, 2017 12:10 pm

rudi ;-) wrote:
urbanze wrote:Oh :(

But cannot help me?


how looks your code snip for read temp and how you convert it to °C ?
which time interval you read the temp?

best wishes
rudi ;-)


Code used:
Image

Delay: 1Sec. Just a simple read. I cannot convert read values to chip real temperature, because curve is not linear (I think)

Who is online

Users browsing this forum: No registered users and 4 guests