Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to use a DHT sensor to show humidity and temperature values on an OLED display

By Ashutosh Bhatt April 5, 2022

In Part I and Part II of this series, we learned how to use an analog sensor — including a potentiometer (POT), a light-dependent resistor (LDR), and a soil-moisture sensor — to present values on an organic light-emitting diode (OLED) display. 

In Part III, we’ll also present data on an OLED display, but this time using a digital temperature and humidity sensor, the DHT11. 

Refer to Part I for a discussion about the basics of an OLED display and how to properly interface it with Arduino. 

The DHT11
The DHT11 is a low-cost digital sensor that senses temperature and humidity. Humidity is the measure of water vapor that’s present in the air. 

There are two types of humidity sensors, based on their measurement units: 

  • An absolute humidity sensor – the measure of water vapor in the air, regardless of temperature, expressed as grams of moisture per cubic meter of air.
  • A relative humidity sensor – the measure of water vapor in the air relative to the temperature, expressed as the amount of water vapor in the air as a percentage of the total amount that could be held at its current temperature.

The DHT11 measures the relative humidity in the environment. To measure the temperature, this sensor uses a thermistor. It also has an in-built chip (IC) that provides an analog-to-digital conversion and the digital signal output as the temperature and humidity. 

Working principle of the DHT11
Along with the thermistor, the DHT11 sensor has a capacitive humidity sensing element. This capacitor has two electrodes with a moisture-holding substrate that serves as a dielectric, which is an electrical insulator, between the two. 

A change in the capacitance value occurs when there is a change in humidity levels. The in-built chip measures the change in the capacitor and converts it into a digital value of relative humidity.

To measure the temperature, the DHT11 uses a negative temperature coefficient thermistor, which causes a decrease in the resistance value when there is an increase in temperature. Typically, the sensor is made of semiconductor ceramics or polymers to ensure a greater resistance value when there is even a slight change in temperature. 

The in-built chip measures this change in resistance and converts it into a digital value in Celsius. 

Specifications

  1. Voltage ratings: 3 – 5V
  2. I/O voltage range: 3 – 5 V
  3. Current ratings: 2.5mA (max current use during conversion – while requesting data)
  4. Humidity range: 20-80% (5% accuracy)
  5. Temperature range: 0-50° C ( ±2° C accuracy)
  6. Sampling rate: 1 Hz max (output readings update after every second)
  7. Dimension: 15.5 x 12 x 5.5mm

Pin outs and functions

For this project, we use the DHT11 module, which can easily and directly connect with Arduino. This sensor has one 10K pull-up resistor, which connects between the VCC and data-output pins. It only has three pins instead of the typical four. It also has a power ON LED indicator.

Circuit diagram

Circuit connections
The circuit is built using only three components: 

1. The Arduino NANO board
2. An OLED display
3. The DHT11 module 

  • The DHT11 module has three pins: the +V, GND, and signal (op) pin. The +V and GND pins are connected with Arduino’s +5 V and GND pins. The signal pin is connected to Arduino’s digital pin 13.
  • The OLED has four interfacing pins (as discussed in Part 1): the VCC, GND, SDA, and SCL. The VCC and GND pins are connected with Arduino’s +5 V and GND pins, providing the power supply to the display. The SDA and SCL pins are connected with Arduino’s A4 (SDA) and A5 (SCL) pins for data communication.
  • Arduino receives its power supply from a computer’s USB port. The onboard voltage regulator chip provides a 5V supply to the DHT11 module and OLED display. 

Circuit operation

  • The DHT11 module senses the room temperature and humidity, providing direct values of the temperature in oC and humidity in % RH.
  • These values are read by Arduino, which used the DHT.h library to read the temperature and humidity.
  • Arduino then displays both the temperature and humidity values on the OLED display

Software program
The Arduino board microcontroller (ATMega328) performs these tasks because of the below program:

1. Reads the temperature and humidity values from the DHT11 sensor.
2. Displays the values of the temperature and humidity on the OLED display.

This program is written in C/C++ language using Arduino IDE’s software. It’s also compiled and uploaded to Arduino’s microcontroller using the same software.

The program…

Video

You may also like:


  • Sensor value display on TFT LCD using Arduino: Part I

  • What are the top open-source software systems for home automation?

  • How to display LDR and soil-moisture sensor values using an…

  • How to design a digital compass using Arduino and an…

  • How to program an OLED display with Arduino

  • What are the different types of fingerprint scanners?

Filed Under: Electronic Projects, Featured, Sensors
Tagged With: Arduino, dht11, humidity, lightdependentresistor, oled, program, sensors, software, temperature
 

Next Article

← Previous Article
Next Article →

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Thermal modelling of repetitive power pulse
  • Redundant XORs
  • No Output Voltage from Voltage Doubler Circuit in Ansys Nexxim (Harmonic Balance Simulation)
  • Discrete IrDA receiver circuit
  • ISL8117 buck converter blowing up

RSS Electro-Tech-Online.com Discussions

  • Can I make two inputs from one??
  • using a RTC in SF basic
  • Help with finding unique wire lug(s)
  • Simple LED Analog Clock Idea
  • Kawai KDP 80 Electronic Piano Dead

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe