Sunday, October 23, 2016

How to build Humidity and temperature meter using DHT11 and OLED Display

Arduino Light Meter with photo resistor and OLED display
This video show how to build a humidity meter using a DHT11 humidity sensor, I2C OLED display and Arduino Uno.

 A 128X64 I2C Oled ssd1306 display is used to display the humidity, temperature and heat Index.

I used an Arduino UNO 3.3V clone which uses Atmega328P. DHT11 humidity sensors are cheap and easily available on Ebay, Bangood, Sparkfun etc.

DHT22 humidity sensor can be used in place of DHT11 for more accuracy.

Library used U8Glib: Installed directly from the Library Manager in Arduino IDE.

Connect the humidity sensor pin 2 to D2 pin of Arduino. Also connect an 10K resistor between D2 and 3.3V pin of Arduino. The OLED display VCC is connected to 3.3V of Arduino. GND to GND of Arduino. SDA of OLED to SDA or Arduino, SCL of OLED to SCL of Arduino.

Humidity Meter code: Download/copy in the box below and save with .ino extension.


  1. what if i need the temp in Celsius to be displayed?

    1. y hawe to coment one lane u hawe instructions in code u just hawe to read a bit ...

      take a look on line 12

      // Display defaults to Degree F. TO use metric display,
      // comment out next line to display temperature in Degree C,
      #define METRIC

  2. Works perfect - Is there a way to use nano instead? Thinking about SDA and SCL... Thanks!!

  3. Hi the font is hard to read how would I increase its size, and maybe lose the heat index to make room for the larger text.

  4. It proved to be Very helpful to me and I am sure to all the commentators here! Coupon Monkey

  5. Is there a code for white color display thanks for anwser