The MKE-S14 DHT11 Temperature And Humidity Sensor is a reliable digital sensor that measures ambient temperature and humidity with a calibrated digital signal output. It utilizes the DHT11 sensor, making it suitable for a wide range of applications such as HVAC systems, consumer goods, weather stations, and medical devices. Its ease of use and low cost make it an ideal choice for hobbyists and professionals alike.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3 to 5V DC) |
2 | DATA | Digital data output |
3 | NC | Not connected |
4 | GND | Ground |
#include "DHT.h"
#define DHTPIN 2 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
// Reading temperature or humidity takes about 250 milliseconds!
float humidity = dht.readHumidity();
// Read temperature as Celsius (the default)
float temperature = dht.readTemperature();
// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index in Celsius (isFahrenheit = false)
float heat_index = dht.computeHeatIndex(temperature, humidity, false);
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print("% Temperature: ");
Serial.print(temperature);
Serial.print("°C Heat index: ");
Serial.print(heat_index);
Serial.println("°C");
}
Q: How often can I read data from the sensor? A: The DHT11 sensor should not be read more than once every second.
Q: Can the sensor be used outdoors? A: Yes, but it should be protected from direct sunlight, rain, and condensation for accurate readings.
Q: Is calibration required for the sensor? A: The DHT11 comes factory-calibrated, and no additional calibration is typically required.
Q: What is the lifespan of the DHT11 sensor? A: With proper use, the DHT11 sensor can last for several years, although the long-term stability is rated at less than ±1% RH/year.