Hey guys,
I want to get human body temperature using the DHT11 sensor. I am trying to get measurements by placing it on/near the forehead. I'm not getting correct values, can you please check the code?
I am using an Arduino Nano ESP32.
#include "DHT.h"
#define DPIN 32 // GPIO number connected to DHT11
#define DTYPE DHT11 // DHT11 type
DHT dht(DPIN, DTYPE);
unsigned long previousMillis = 0;
const unsigned long interval = 5000; // 5 seconds delay
void setup() {
Serial.begin(115200);
Serial.println("Initializing DHT sensor...");
dht.begin();
delay(5000); // Wait 5 seconds for sensor to stabilize
}
void loop() {
Serial.println("Attempting to read DHT sensor...");
float temperature = dht.readTemperature(); // Read temperature
float humidity = dht.readHumidity(); // Read humidity
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Error reading DHT sensor. Check wiring or sensor.");
} else {
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" C, Humidity: ");
Serial.print(humidity);
Serial.println(" %");
}
delay(5000); // 5-second delay between readings for stability
}
I am getting values in the range of 1.20C and 2.50C which is abnormal, and I expected it to be around 37C. Please help me calibrate my sensor.
Only internal will give you an accurate body temperature. Any external measurement is effected by the environment (distance, thickness of skin, air temperature, humidity, pre-warming... and much more.
So, you rejected the right answer and expect something to change if you ask again? Ask your mother.