• 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) :

#
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 :

#
------------------------[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

This Article Has Been Shared 302 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

  • ESP32 Arduino : Create a Webpage to Control a Relay Module

    Here is How to Create a Webpage to Control a Relay Module Using ESP32 Arduino. This is a basic example which provides the base of advanced projects.

  • Arduino ESP32 : Turn on LED on Button Press and Turn Off After a Period

    Here is How to Turn on LED on Button Press and Turn Off After a Period on Arduino ESP32. For this guide, we will use onboard boot button and onboard LED.

  • Base64 Encoding on ESP32 Arduino (Base64 for Images)

    Base64 images are easy to transmit over the network. Here is How to Use Base64 Encoding on ESP32 Arduino. ESP32 lacks sufficient RAM.

  • 7 Segment LED Display Tutorial For Dummies

    Here is Step By Step 7 Segment LED Display Tutorial For Dummies On How To Light Up With Battery To Control With Arduino Without Library.

  • Arduino 2 Push Button One LED : Switch On/Off

    Here is Circuit Diagram and Code For Arduino 2 Push Button One LED to Switch On/Off Project. It is Very Easy Yet Important Basic Behind Using Sensors to Switch On/Off an Event.

Additionally, 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How To Repack Installed Software on Debian/Ubuntu January 16, 2021
  • Components of Agile Software Development January 15, 2021
  • What is Conway’s Law? January 14, 2021
  • Effects of Digitization on Companies : Part XIII January 13, 2021
  • What is SoftAP Mode? January 12, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "ESP32 Arduino with DHT11 Sensor : Connection & Code," in The Customize Windows, March 17, 2019, January 17, 2021, https://thecustomizewindows.com/2019/03/esp32-arduino-with-dht11-sensor-connection-code/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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