Arduino with SSD1306 OLED and DHT11/DHT22 sensor

This post shows how to build a temperature and relative humidity measurements station using Arduino and DHT11/DHT22 sensor where the measured values of the temperature and the humidity are displayed on 128×64 OLED screen with SSD1306 driver. (OLED: Organic Light-Emitting Diode)

The SSD1306 OLED used in this post projects is configured to work in I2C mode, some SSD1306 OLED boards may require a small hardware modifications (to select between SPI mode or I2C mode) such as soldering, placing jumpers …. To see how to connect the SSD1306 OLED with Arduino read the post below:
Interfacing Arduino with SSD1306 OLED display

I used Adafruit SSD1306 OLED library to simplify the connection of the Arduino with the screen and Adafruit DHT library for the connection between the Arduino and the DHT11/DHT22 sensors. Both libraries can be downloaded through Arduino IDE Library Manager of manually from the links below (after downloading, unzip the folder and place it in Arduino libraries folder, for example C:\Program Files\Arduino\libraries)
Adafruit SSD1306 OLED library   —   direct link
Adafruit DHT library   —   direct link

We also need Adafruit graphics library:
Adafruit GFX library   —   direct link

Related Projects:
Arduino interfacing with DHT11 sensor and LCD
Arduino with DHT22 sensor and LCD

Hardware Required:

  • Arduino board
  • SSD1306 OLED screen (128×64 Pixel)
  • DHT11/DHT22 temperature and humidity sensor
  • 4.7k ohm resistor
  • Breadboard
  • Jumper wires

Interfacing Arduino with SSD1306 OLED and DHT11 sensor:

Arduino UNO with DHT11 sensor and SSD1306 OLED 128x64

Circuit connections are shown below where:
SSD1306 OLED GND goes to Arduino GND (ground)
SSD1306 OLED VDD to Arduino 5V
SSD1306 OLED SDA pin (serial data) to pin A4 (Arduino UNO I2C SDA pin)
SSD1306 OLED SCK pin (serial clock) to pin A5 (Arduino UNO I2C SCL pin)
SSD1306 OLED RES pin (reset) to Arduino pin 4
DHT11 data pin to Arduino pin 8

Arduino SSD1306 DHT11 sensor

(DHT11 sensor = RHT01 sensor)

Arduino Code:

The video below shows the simulation of the project with Proteus ISIS:

Proteus simulation file download (use it with version 8.6 or higher):
Arduino + SSD1306 OLED + DHT11

Interfacing Arduino with SSD1306 OLED and DHT22 sensor:
Circuit diagram is shown below.

Arduino UNO with SSD1306 OLED and DHT11 sensor

(DHT22 sensor = AM2302 sensor = RHT03 sensor)

Arduino UNO with DHT22 sensor and SSD1306 OLED 128x64

Arduino Code:

Proteus simulation video:

Proteus simulation file download (use it with version 8.6 or higher):
Arduino + SSD1306 OLED + DHT22


Discover more from Simple Circuit

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top