• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » ESP32 Arduino with DHT11 Sensor : Connection & Code

By Abhishek Ghosh March 17, 2019 6:21 pm Updated on March 17, 2019

ESP32 Arduino with DHT11 Sensor : Connection & Code

Advertisement

Here is Connection & Working Code for ESP32 Arduino with DHT11 Sensor. We will use Adafruit’s libraries for DHT11 and DH22 Temperature Humidity Modules. For using DHT11, DHT21, DHT22 with non-ESP32 Arduino please read our previous guide on Arduino Temperature Humidity Sensor. For ESP32, it is mandatory to have the common required setup for Arduino IDE (ESP32 does not work with Arduino IDE out of the box).

We will need two libraries. First install them (unless you already have them) :

Vim
1
2
3
4
#
https://github.com/adafruit/Adafruit_Sensor
https://github.com/adafruit/DHT-sensor-library
#

DHT22 is modern, sensitive but more costly. DHT11 is commonly used module. If you newly purchased some kind of China DHT11 temperature humidity sensor, it will appear to you that they have lot of pins. That blue or white coloured plastic outside is a mini casing. If you open it up it (not needed for operation but for optional learning) you will find a PCB inside which has a resistive type humidity sensor, a negative temperature coefficient thermistor for measuring temperature and an 8-bit microcontroller. Left to right the pins are :

Advertisement

---

VCC – to connect with 5v of Arduino
Data – to connect with digital pin of Arduino
NC – not needed to do anything
GND – to connect with GND of Arduino

Essentially we have one data pin for our actual need, it is obvious that one pin will go to 3v and one to GND. The 2nd pin, which is Data, needs some operational voltage. Adding a 220 Ohm resister to 3v of ESP32 and adding it to Data pin will work fine. Then Data pin will go to digital pin of Arduino. Here are the pins :

Vim
1
2
3
4
5
6
#
------------------------[5v of Arduino]-------------+-------+
---[5K Ohm resister]----[Digital Pin of Arduino]----|  DT   |
---[Not needed]-------------------------------------|  11   |
------------------------[GND of Arduino]------------+-------+
#

Here is the diagram for required connection :

ESP32 Arduino with DH11 Sensor

We have attached the data pin to pin 15 of ESP32. You will get the required Fritzing diagram and Arduino code on our Github repo.

Here is the required code, which is nothing but minimal modification of our code for Arduino UNO. Open the serial monitor on Arduino IDE and set it to 9600 baud rate. Use the code from our GitHub repo (there can be error of web rendering on this site) :

The code definitely works as we have tested it.

Tagged With esp32 dht11 , arduino IDE esp32 with dht11 sensor , connect dht11 to esp32 , dht11 sensor connection , dht22 thingspeak using uno code , arduino code for dht11 sensor , dht11 with arduino connection , dht11 esp32 , arduino esp32 dht11 , sensor connectivity code arduino
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to ESP32 Arduino with DHT11 Sensor : Connection & Code

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Arduino Temperature Humidity Sensor : New DHT11, DHT21, DHT22 Test Code

    Here is New Test Codes For Arduino Temperature Humidity Sensor DHT11, DHT21, DHT22 Test Code as Hardware (Not Shields). 2 Libraries Needed.

  • Connecting ESP32 Arduino with DHT11 with IBM Watson IoT

    Earlier, we described how to create graph on IBM Watson IoT dashboard by using the default widgets. In previous guide, we described how to use ESP32 Arduino with DHT11 sensor. Here is the Code and Diagram to Connect ESP32 Arduino with DHT11 with IBM Watson IoT and Get Odometer Like Gauges on Dashboard. For this […]

  • Arduino With DHT 11 Sensor and Arduino Online IDE : Basic IoT

    Arduino With DHT 11 Sensor and Arduino Online IDE is Example of Basic IoT Which Needs No Special Hardware But Arduino, DHT11, Internet Connection & Web Browser.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy