- DHT11 sensor gives the values of temperature in degree Celcius and humidity in percentage.
- The values for both temperature and humidity can also be seen on the Serial monitor screen of the Arduino Software.
- You can open the serial monitor from the top right corner of your screen as shown in the screenshot below.
- In this dht11 with Arduino project, The OLED display is useful in displaying texts as well as graphics.
- It works with the I2C protocol as it has SDA and SCK pins. In the code, we have to set the size and color of the text which is going to be displayed on the OLED screen.
- The clearDisplay() function is used to remove all the text and reset the OLED screen.
- We use setCursor() function for adjusting the text on the screen so that it looks neat and clean.
- The values of the temperature and humidity keep updating automatically with time.
Components Required
- Arduino UNO board
- USB cable for uploading the code
- DHT11 temperature-humidity sensor
- SSD1306 OLED display
- Jumper wires
- Breadboard
NOTE: Please upload the code which is given below to the Arduino board. Before compiling the code you have to install <SimpleDHT.h>, <SPI.h>, <Adafruit_GFX.h>, <Adafruit_SSD1306.h> these dht11 Arduino library to the IDE software.