Arduino - DHT11 and OLED V3.0

Introduction: Arduino - DHT11 and OLED V3.0

Hello Guys,

With reference to my last tutorial [Arduino - DHT11 and Serial Plotter v2.0], I decided to make similar project but one which is portable and can be battery powered. In this tutorial, I decided to use an OLED display to visualize the incoming data stream from the DHT11 sensor.

I used the Adafruit OLED display, this is made up of 128x64 individual white led pixels to make the OLED display. This is a miniature module, very clear due to the high contrast from the led pixels as such no backlight is required.

Interestingly, in this project i used the OLED display to visualize the following graphs. These graphs are easy to implement and of course you can choose any of the graphs you find exciting and suitable for your needs, the Arduino sketches are found below. Enjoy

a. Non-continuous dotted [refreshing] graph.

b. Non-continuous bar [refreshing] graph.

c. Continuous dotted [non-refreshing] graph.

d. Continuous bar [non-refreshing] graph.


Parts Required:

You will need the following to make the circuit.

· 1 x Arduino Uno

· 1 x Adafruit OLED 128 x 64

· 1 x DHT11

· 1 x 10KΩ Resistor

· Jumper Wires

Step 1: Schematic:

Here’s how to connect the components to the Arduino module.

Step 2: Source Code:

Here’s the codes for this project.

1. Download the following libraries from Adafruit repository.

2. Unzip the libraries and rename the extracted folder to following.

  • DHT
  • Adafruit_SSD1306
  • Adafruit_GFX

3. Copy the folders to the following path to install the libraries.

  • C:\Program Files (x86)\Arduino\libraries

4. Upload any of the below sketches.



Sketches:

  • Non-continuous dotted [refreshing] graph.
  • Non-continuous bar [refreshing] graph.
  • Continuous dotted [non-refreshing] graph.
  • Continuous bar [non-refreshing] graph.

Step 3: Demonstration:

Now you can easily differentiate between the Temperature and Humidity readings on the OLED display, and enjoy the various graph on the OLED.

I hope you like the post and hope this tutorial helps you find a way to implement your own OLED graphs.

Thanks for reading.

-Avishek Hardin

1 Person Made This Project!

Recommendations

  • For the Home Contest

    For the Home Contest
  • Big and Small Contest

    Big and Small Contest
  • Make It Bridge

    Make It Bridge

2 Comments

0
TueBjørn
TueBjørn

5 years ago

Hi! super nice code brah!
I have been working a bit with it, but i can't figure out to make a delay in the refreshing time so the curve is adding a bar for each minute and not each cycle.

I have added a RTC to also add the time. my idea is to have the time displayed at top and the temp and humi at the bottom. if i just add an delay the time will only update every minute and i want seconds on my clock. :-)

Could you help me? or come with and idea?

0
KamilK40
KamilK40

6 years ago

I was looking for code like that whole weekend! Thanks man :)