This is used to define which type of DHT sensor we want to use. You can use this with DHT11, DHT21, and DHT22 sensors. You should uncomment the line according to the sensor you are using. For example, we are using DHT22 in this tutorial, we have uncommented this, and others are ...
Before you can use the DHT11 on the Arduino, you’ll need to install theDHTLib library. It has all the functions needed to get the humidity and temperature readings from the sensor. It’s easy to install, just download the DHTLib.zip file below and open up the Arduino IDE. Then go ...
We have another tutorial on the DHT11 for theArduinothat goes into detail on relative humidity and how the DHT11 measures it. So instead of repeating all of that here, check outHow to Set Up the DHT11 Humidity Sensor on an Arduino, then come back for the specifics on setting it up o...
The BME280 sensor is more expensive but it has more functionalities. For example, you can build a weather station project with only this sensor. But if you’re not interested in measuring the pressure or humidity, you can get a cheaper temperature sensor. Interfacing these sensors with Arduino...