I ask again for the ESP32 internal temperature sensor.
I've read the internet and found many blogs that get 128 ° F or 53.33 ° C as Arduino output.
e.g. this code "espressif/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino"
That the sensor is inaccurate, I can not determine.
It always shows the same temperature, even with different ESPs and also when I heat up the ESP32 with the hair dryer.
If I "mix" the program with the example: WiFiScan, I get a start value of 66.00 ° C, which rises to 75.00 ° C in one minute. Again, the hair dryer does not help .
Code: Select all
// Wifi + intTemp _Ergebniss: int.temp from 156F to 168F
/*
* This sketch demonstrates how to scan WiFi networks.
* The API is almost the same as with the WiFi Shield library,
* the most obvious difference being the different file you need to include:
*/
/*
github : pcbreflux/espressif
espressif/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino
*/
#include "WiFi.h"
#include <time.h>
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
//uint8_t g_phyFuns;
#ifdef __cplusplus
}
#endif
void setup()
{
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
tzset();
}
uint8_t temp_farenheit;
float temp_celsius;
char strftime_buf[64];
time_t now = 0;
struct tm timeinfo;
char buf[256];
void loop()
{
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n == 0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(10);
}
}
Serial.println("");
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
sprintf(buf,"scan start %02d:%02d:%02d ",timeinfo.tm_hour,timeinfo.tm_min,timeinfo.tm_sec);
Serial.print (buf);
temp_farenheit= temprature_sens_read();
temp_celsius = ( temp_farenheit - 32 ) / 1.8;
Serial.print("Temp onBoard ");
Serial.print(temp_farenheit);
Serial.print("°F ");
Serial.print(temp_celsius);
Serial.println("°C");
delay(1000);
now++;
// Wait a bit before scanning again
delay(5000);
}