Get human body temperature with DHT11

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.

Btw I need a contact sensor for forehead because this will be implemented into a wearable device, so I cannot use other sensors like infrared.

That's not the way to measure true body temperature.

Can you please suggest a better way to measure temperature?

Many........ds18b20 for one.
Under tongue, up the butt or under arm.

1 Like

Mouth, arm pit or rectal.

1 Like

Previous Post:

if i want to balance out non-invasiveness and accuracy, which place should I measure from?

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.

1 Like

And why not use a real temperature sensor, rather than a secondary function of a humidity sensor? The temperature part is only accurate to +-2C.

1 Like

With the correct sensor you can insert the tip into the ear!

Missing an "r"...

5 Likes

???

Prefixing "ear"

Oh! Yes, I had it there, also.

Maybe just sit on it?

His ear?

There are better temperature sensors for measuring body temperature , google will find them

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.