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: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

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

  • Voltage mode pushpull is a nonsense SMPS?
  • Input impedance matching network
  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Reducing "shoot-through" in offline Full Bridge SMPS?

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

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