DHT11
The DHT11 is a digital temperature and humidity sensor module widely used in various electronics and IoT projects. It consists of a capacitive humidity sensor and a thermistor to measure temperature.
Tech Specs for the DHT11 temperature and humidity sensor:
#include "DHT.h"
#define DHTPIN 2 // we're using pin 2
#define DHTTYPE DHT11 // we're using the DHT11
// define our DHT object using the pin and type from above
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
}
void loop() {
// create a float and read the temperature sensor
float myTemperature = dht.readTemperature(true);
// print the temperature on the screen in Celsius
Serial.print(myTemperature);
Serial.print((char)223); // degree symbol
Serial.println("C");
delay(3000); // wait 3 seconds before updating again
}