Hi Guys,

This is my first Arduino tutorial, even though I know there’s huge number of Arduino articles and apprentices videos easy available online, I decided to make my own, to help anyone of us start with basic of Arduino and Electronics.


This tutorial covers the basic low cost DHT11 [Humidity and Temperature sensors inbuilt] and also very common sensor for Arduino projects. The chip inside the DHT11 perform all the heavy task and only output a digital signal with humidity and temperature, compatible with any MCUs, ideal for those who want some basic data logging stuffs, Home Automation and more.

DHT11 Specifications:

· 3 to 5V power

· Max. 2.5mA during conversion

· Humidity range 20-80% with 5% accuracy

· Temperature range 0-50°C with ±2°C accuracy


· VCC (3 to 5V power)

· Data out

· NC


Parts Required:

You will need the following to make the circuit.

· 1 x Arduino Uno

· 1 x DHT11

· 1 x 10KΩ Resistor

· Jumper Wires

Step 1: ​Schematic:

Here’s how to connect the DHT11 to Arduino.

Step 2: ​Source Code:

Here’s the codes for this project.

1. Download the DHT Library from Adafruit repository.

2. Unzip the DHT library and rename the extracted folder to DHT.

3. Copy this folder to the following path to install the DHT library.

C:\Program Files (x86)\Arduino\libraries

4. Upload below code.

You should see the humidity and temperature on the serial monitor once the sketch has been successfully uploaded to Arduino.

Step 3: ​Demonstration:

You should see the humidity and temperature on the serial monitor once the sketch has been successfully uploaded to Arduino.

Thanks for reading,

Enjoyed your instruct able but I have a question? I have one of these sensors but it is a three pronged. How would I run this program? I am attaching a link as well:<br>https://tkkrlab.nl/wiki/Arduino_KY-015_Temperature_and_humidity_sensor_module
<p>Hello pdiddydirty,</p><p>Greeting, I believe the KY-015 is same as DHT11, the only<br>difference I noticed is</p><ul><br><li>DHT11 got 4 pins</ul><ul><br><li>KY-015 got 3 pins only, pin number 3 has been omitted<br>from the module for simplicity. </ul><p>Grateful if you could connect the circuit as below schematic. </p><p>[S] --&gt; Arduino Pin2</p><p>[Middle] --&gt; Arduino VCC 5v</p><p>[-] --&gt; Arduino GND</p><p>Upload the sketch I posted and test. Note the BaudRate should be set to 9600 on the serial monitor. </p><p>Let us know the outcome. Good Luck...</p>
Thank you for the the help! That helps a lot. The code stats the same right?
<p>Hello pdiddydirty,</p><p>Yes, sure you can use same sketch.</p>
Hey I tried your code and I got a &quot;exit status 1 error compiling .&quot; What am I doing wrong?
<p>I made this one. It was pretty straightforward. Great job.</p>
i want to learn about arduino
<p>Hello Batimeh, thanks for your time to read my Instructable, am also learning Arduino. My current reference is <a href="http://www.arduino.cc" rel="nofollow"> www.arduino.cc </a> where you can easily start. Huge number of apprentices<br>videos available on youtube, please check out Jeremy Blum Arduino Tutorial, worth it link below.</p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/fCxzA9_kg6s" width="500"></iframe> </p>
<p>Great sensor project.</p>
Thanks a lot Jason.

About This Instructable



More by Avishek Hardin:Arduino GPS Speed Camera Detector Arduino - DHT11 and OLED V3.0 Arduino – DHT11 and Serial Plotter V2.0 
Add instructable to: