AOSONG DHT11 Temperature and Humidity Sensor Example-Arduino

Hello ,

This post is about an example of AOSONG temperature and humidity sensor usage with arduino.First of all, you need these equipments :

-Arduino board,BreadBoard,AOSONG – DHT11 and a few jumper cables.

Some people wrote a library to use DHT11 sensor easily.We are going to use this library.You can download from here :

Or here :

In order to use in sketch ,you must copy this folder to library folder of sketch. There are two ways of doing this.

First open sketch and from top, select Sketch>Import Library>Add Library…

Second is(for mac) ,open applications folder and find , right click>show package contents>Contents>Resources>Java>Libraries folder and copy it there.

We are going to use only three pins of dht11 for vcc , one for signal and one for ground.If you would like to review datasheet for dht11:

Connections are shown below :

dht 11 connection
dht 11 connection



Connect vcc pin of dht11 sensor to 5V arduino pin and connect GND pin of sensor to GND pin on arduino , then connect signal pin of sensor to 5th pin of arduino.Example code is below your sensor info will be streaming from 5th pin.

Open serial monitor to see your rooms temperature and humidity like mine 🙂

Hope you enjoyed it.

My room's temp.


Leave a Reply

Your email address will not be published. Required fields are marked *