Here’s the dht11 temperature and humidity sensor arduino code, you’ll need to use a library that simplifies communication with the sensor. Below is a simple Arduino sketch to read data from a dht11 sensor and display the temperature and humidity on the Serial Monitor. Components Needed for dht11 temperature and humidity sensor arduino code :...
Those sensors are pure trash. Use SHT-75 or SHT-85 if you actually care about getting a real value. More expensive though.
I believe the DHT22 is also much better than the DHT11