Yet another illustration how to use the 0.96” OLED 128×64 Screen Display, and DHTXX Temperature & Humidity Sensor, The OLED 128X64 Screen Display module it is made of 128×64 individual blue OLED pixels, each on is can be turn on or off by the microcontroller chip, and works without backlight, that will light in a dark environment, OLED display is higher compared to LCD display. These module works in i2C communication,

The DHTXX temperature & humidity sensor is a complex with a calibrated digital signal output by using the exclusive digital signal acquisition technique and temperature and humidity sensing technology, it insures a high reliability and excellent long term stability. This sensor includes a resistive type humidity measurement component and an NTC temperature measurement component offering an excellent quality fast response and anti-interference.

As you can see the illustration below the DHT11 was illustrated to a manual wiring concept, but if you have a module that already mounted to the PCV along with the resistor just follow the wiring diagram.

For generating an Image to byte C Code Array please refer to this link.

 Required Component

  • ESP8266 12E or 13E / NodeMCU Development Board
  • 0.96 inch 128×64 OLED Screen Display
  • DHT11/DHT22/DHT24 Package or Module
  • Jumper Wire / DuPont Wire
  • Solder Less Bread Board

Wiring Diagram

C Source Code

Required Libraries 

  • Download Adafruit_ESP8266 | Zip
  • Download Adafruit_GFX | Zip
  • Download Adafruit_SSD1306 | Zip
Wiring DHT11, DHT22, with OLED Screen on ESP8266 12E
Facebooktwitterredditpinterestmail

JLCPCBPCBgogoPCBway4pcb

9 thoughts on “Wiring DHT11, DHT22, with OLED Screen on ESP8266 12E

  • at
    Permalink

    Hi!
    Tried your code but i get nothing when putting uploading it.

    Also, the code would not compile at first, i found a unclosed bracket. But still, after upload nothing happens. Have i missed something? Using a NodeMCU, OLED with i2C and a DHT11.

    The missing bracket (as i understand it);
    display.clearDisplay();
    }; <- Added this
    void loop() {

    delay(1000); // Wait a few seconds between measurements.

    Reply
  • at
    Permalink

    Check the input voltage of your OLED Screen, sometimes the OLED screen works on 5v. you can achieve the 5v by hooking up 1 jumper to get 5v. note: ground should be common ground.

    Reply
    • at
      Permalink

      I’ve tried the screen at 3.3v with a arduino and som other codes on the NodeMCU and then it works. But will try the 5 volt anyway. Maybe it aint sufficient with the setup. It’s spec at 3-5 volt.

      Other thoughts;
      #include
      #include
      #include
      #include “ESP8266WiFi.h”

      Shouldn’t it be;
      #include “Wire.h”
      #include “Adafruit_GFX.h”
      #include “ESP_Adafruit_SSD1306.h”
      #include “ESP8266WiFi.h”
      or does it not matter?

      Reply
      • at
        Permalink

        This probably fixed it, got the pins wrong. For me the working combination was;
        DHT: D5
        SCL: D1
        SDA: D2

        So sorry for all other mumbling above :)

        Reply
  • at
    Permalink

    Thanks for coding and fixing coding. But surprise for me rook. I have found that I have to use an 4,7 KOhm resistor between VCC and signal from DHT11. And it works . But again I am an rook

    Reply
    • at
      Permalink

      You are right. Actually the wiring diagram is wrong because the 10kOhm resistor must be connectet between +Vcc and DATA pin of DHTxx sensor. So in your case, addind 4.7kOhm got the same result.
      With resistor between GND and DATA I guess nobody will get it works!!!

      Reply
  • at
    Permalink

    In file included from C:\Users\Pradeep\Documents\Arduino\NodeMCUESP8266_OLED_DHT22\NodeMCUESP8266_OLED_DHT22.ino:1:0:

    C:\Users\Pradeep\Documents\Arduino\libraries\SPI/SPI.h:16:26: fatal error: avr/pgmspace.h: No such file or directory

    #include

    ^

    compilation terminated.

    Multiple libraries were found for “SPI.h”
    Used: C:\Users\Pradeep\Documents\Arduino\libraries\SPI
    Not used: C:\Users\Pradeep\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\SPI
    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

    Reply
  • at
    Permalink

    Please, there should be a mistake in Wirin Diagram;
    The 10 kOhm resistor should be connected from DHTxx DATA pin to VCC pin, not to GND.

    Reply

Leave a Reply

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