DHT11 & DHT22 Sensors Temperature and Humidity Tutorial using Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ค. 2024
  • howtomechatronics.com/tutoria... ► Find more details, circuit schematics and source codes on my official website.
    In this Arduino Tutorial we will learn how to use the DHT11 or the DHT22 sensor for measuring temperature and humidity with the Arduino board.
    Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
    ► howtomechatronics.com/
    Like my page on Facebook:
    ► / howtomechatronics
    Add me on Google+:
    ►plus.google.com/+Howtomechatr...
    Music: Aduro by Jens Kiilstofte (machinimasound.com/music)

ความคิดเห็น • 118

  • @ruitfsilva
    @ruitfsilva 8 ปีที่แล้ว +6

    Thanks,
    You have by far the best Arduino tutorial projects.

  • @jorgefantin
    @jorgefantin 7 ปีที่แล้ว +1

    Excellent! You provide a vital service to the Arduino community. Keep up with the good work!

  • @u0432865
    @u0432865 5 ปีที่แล้ว

    This video is excellent. Educational, clear, and concise, and interesting. Thank you so much! I wish could subscribe 100 times

  • @Messerwerkstatt
    @Messerwerkstatt 7 ปีที่แล้ว

    the dht11 works fine without a pullup resistor...thanks for this super tutorial.

  • @StipsShow
    @StipsShow 8 ปีที่แล้ว

    Thanks for your nice tutorials! They're great!

  • @nicholasbrown8384
    @nicholasbrown8384 2 ปีที่แล้ว

    Thank you. That was very thorough!

  • @SuperHddf
    @SuperHddf 6 ปีที่แล้ว

    very good video. Included everything you need to know. Thank you!

  • @christophermartinez1769
    @christophermartinez1769 6 ปีที่แล้ว

    VERY NICE EXPLAINED, THANKYOU!

  • @ivangambalonga4069
    @ivangambalonga4069 8 ปีที่แล้ว

    thanks, best explanation ever found

  • @amityungerman1886
    @amityungerman1886 6 ปีที่แล้ว +2

    Dejan thanks for your stuff it is clearly and understandable as always! I would like to ask if you know how can l schedule two dht22 to take their measure every 2 sec, l mean to synchronized the measures at the same time (cause l need to calculate a gradient )?

  • @pademo57
    @pademo57 4 ปีที่แล้ว

    I know most of the previous comments are 2 years old or more but I just started and like all the others it was very clear and easy to follow. Thanks for a great tutorial.

  • @MsEDUARDOCR7
    @MsEDUARDOCR7 8 ปีที่แล้ว

    Excellent tutorial!

  • @thomasalexander1563
    @thomasalexander1563 7 ปีที่แล้ว

    great and very educative tutorial

  • @iceheart010
    @iceheart010 6 ปีที่แล้ว

    Thanks for the explanation

  • @justovelarde3456
    @justovelarde3456 4 ปีที่แล้ว

    Excellent. Congratulations.

  • @samuelsantanam
    @samuelsantanam 5 ปีที่แล้ว +1

    Thanks so much man!

  • @user-dn9ld3lv7n
    @user-dn9ld3lv7n 5 ปีที่แล้ว +1

    thank you very much !

  • @donprefontaine3237
    @donprefontaine3237 6 ปีที่แล้ว

    I could not get the DHT11 single wire protocol to work with a 20x4 I2C display. The display works fine with just a display sketch, and the DHT11 works fine with just a DHT11 sketch, but the two could not be carefully combined to work together. Using the serial monitor display as well as the LCD display simultaneously, I can see the sensor working properly but there is no change whatsoever to the LCD - nothing displays. I suspect that with the on-board pull-up resistor pulling the DHT11 high and ready for communication, it may have been preventing I2C from starting up. I don't know. Ideas?

  • @justovelarde3456
    @justovelarde3456 4 ปีที่แล้ว

    Hola, felicitaciones por tu video. Pero me da error de que "no encuentra la librería dht.h HAY varias librerías, no sé cual instalar. En mi Arduino está instalada la librería dht sensor library, pero no funciona con esta librería. Alguna sugerencia? Gracias.

  • @albertanasoul
    @albertanasoul 3 ปีที่แล้ว

    I am brand new to arduino, can you hook this and a MQ9 up to a single arduino uno? Thanks for this video.

  • @justovelarde3456
    @justovelarde3456 4 ปีที่แล้ว +1

    Hi, congratulations on your video. But I get the error that "the dht.h library is missing. There are several libraries, I don't know which one to install. In my Arduino the dht sensor library is installed, but it doesn't work with this library. Any suggestions? Thanks.

  • @prathamva7392
    @prathamva7392 8 ปีที่แล้ว

    Thanks a lot Sir :-)

  • @saturnphp
    @saturnphp 3 ปีที่แล้ว

    man thanks, I didn't know that dh11 doesn't support negative temps

  • @dtn2529
    @dtn2529 ปีที่แล้ว

    The DHT22 sensor enables temperature measurement in the range of -40 to 80°Celsius
    Does your program accept this? I.e it also shows negative temperatures?

  • @oreopls69
    @oreopls69 6 ปีที่แล้ว +1

    help got this error
    #error "CPU SPEED NOT SUPPORTED"
    ^
    exit status 1
    Error compiling for board LinkIt ONE.

  • @joyaron6034
    @joyaron6034 6 ปีที่แล้ว

    can you please snap an upper view of the model
    i dont really know where to put the wires

  • @grahamevans5304
    @grahamevans5304 4 ปีที่แล้ว +1

    I can see others seem to have had the error ‘ dht ‘does not name a type, but no solution seems to appear, does anyone have an answer please ?

  • @hydrogeskinak795
    @hydrogeskinak795 4 ปีที่แล้ว +1

    Hello, could you please tell me how to install dht.h?

  • @ultraidtech8250
    @ultraidtech8250 5 ปีที่แล้ว

    hy bro
    can we control incubator with it

  • @emresagr8593
    @emresagr8593 3 ปีที่แล้ว

    if i change the delay to lower than 2000 ms, is error occure? or it gives the earlier calculation.

  • @adowcale9958
    @adowcale9958 3 ปีที่แล้ว

    can u give the circuit of lcd display its so messy and i tried to understand the pin outs from picture in intro. But its to hard so pls put the fritzing circuit.

  • @tubeDude48
    @tubeDude48 6 ปีที่แล้ว

    Can a Nano work with this? I need Nano, LCD, 2 Temp and 1 or 2 humidity

  • @Presso99
    @Presso99 ปีที่แล้ว

    can we design with an Arduino to read 2 Max6675 temperature and send the data to the computer?

  • @cylurian
    @cylurian 7 ปีที่แล้ว

    @dejan Nedelkovski Do you know if the DHT11's readings of the humidity and temperature can be float variable and give an accurate value, just like the DHT22 you showed in the video?
    thx

    • @cylurian
      @cylurian 7 ปีที่แล้ว

      Yes. I don't see the 1/100 accuracy as I see in your DHT22 video.

    • @cylurian
      @cylurian 7 ปีที่แล้ว

      I did exactly your code, and I don't get 1/100 measurements. I'll try to find an DHT22.

  • @shahabazkhan1903
    @shahabazkhan1903 4 ปีที่แล้ว

    would you please give a PCB diagram with arduino nano.

  • @talespimentel
    @talespimentel 7 ปีที่แล้ว

    My DHT22 started measuring wrong humidity. It was supposed to be around 60% (as used to be) and now a 4%. I am new to electronics, is that a way to fix it?

  • @BadreddineZebbiche
    @BadreddineZebbiche 7 ปีที่แล้ว +1

    I have the while DHT22, is it mandatory to connect the pull-up resistor? I am getting non-logic values without it!

    • @BadreddineZebbiche
      @BadreddineZebbiche 7 ปีที่แล้ว

      +Dejan Nedelkovski this is why i was received bad readings. should be 4.7k or 10k?

  • @akroutsamo
    @akroutsamo 8 ปีที่แล้ว

    hi Dejan ;
    do you have a tutorial about arduino internal eeprom and how to set them that if the power is off the arduino start on a cretin stage not from the beginning

    • @akroutsamo
      @akroutsamo 8 ปีที่แล้ว

      ahh yes i remember it
      thanks

  • @mri3884
    @mri3884 3 ปีที่แล้ว

    Can I use this sensor on the industry level?

  • @mateuszk4825
    @mateuszk4825 5 ปีที่แล้ว +1

    Can you tell me exactly which library to download?
    DHT only? Or the Adafruit-sensor-master as well?
    sketch_oct30b:14:1: error: 'dht' does not name a type
    dht DHT;

    • @grahamevans5304
      @grahamevans5304 4 ปีที่แล้ว

      I have same error dht does not name a type

  • @misharains4246
    @misharains4246 ปีที่แล้ว

    Where do I download the library for my DHT22?

  • @karun537
    @karun537 5 ปีที่แล้ว

    Could you pls help me how to connect to cloud

  • @bo26ang
    @bo26ang 6 ปีที่แล้ว

    im using proteus for simulation BTW. .i need DHT22 library for proteus

  • @nitrocoffee
    @nitrocoffee 3 ปีที่แล้ว

    Gracias

  • @user-xz4wo6zd7r
    @user-xz4wo6zd7r 8 ปีที่แล้ว

    Why do not you have connected the LCD through I2C?

  • @furkana.1359
    @furkana.1359 7 ปีที่แล้ว

    I have constructed the circuit and apply what it 's necessary. But i have a problem. DHT22 reads both Temp:-9999 and Humidity: -9999. What is the issue ?

  • @mulyakuncahyadi8956
    @mulyakuncahyadi8956 4 ปีที่แล้ว

    how if that distance sensor? do you know the code?

  • @mikelemon5109
    @mikelemon5109 8 ปีที่แล้ว

    Would be better if you would make a tutorial about how to use this sensor without a library.

  • @waleedishaq3012
    @waleedishaq3012 2 ปีที่แล้ว

    I am running the same code but getting an error of No such file or directory . Can you please help me with that thanks.

  • @mlgsupergamer948
    @mlgsupergamer948 5 ปีที่แล้ว

    wich resistor is that

  • @ruitfsilva
    @ruitfsilva 8 ปีที่แล้ว

    Btw, can you make a tutorial about using the Wii Nunchuk controller?
    It would be great.
    Keep it up.

    • @ruitfsilva
      @ruitfsilva 8 ปีที่แล้ว

      +Dejan Nedelkovski
      Ok, nice to know that will be more tutorials like this.
      Regards from Portugal

  • @roystervi
    @roystervi 7 ปีที่แล้ว

    hi, if you don't use the resistor what will happen, I have mines setup with a 10k but the temp is off 10 degrees. do you have any idea why I am off so much degrees? I am using the DHT22 with 3.3V. also can this be power by only by 3.3v or it can be power by 5v?

    • @jamessmith9747
      @jamessmith9747 7 ปีที่แล้ว

      It can be powered by 3-5 Volts, but I think the reason the reading is so off, is because of either a mistake in the code calculations or that you ned to use a different resistor.

  • @catchgenerics8667
    @catchgenerics8667 7 ปีที่แล้ว

    Does it have to constantly be connected to the computer to get info from the serial monitor?

    • @catchgenerics8667
      @catchgenerics8667 7 ปีที่แล้ว

      Dejan Nedelkovski can you do a video about the same thing, except use a PIR motion sensor to display sensor values on the lcd screen? or do one with capacitive touch sensors?

  • @McKennaRobert
    @McKennaRobert 4 ปีที่แล้ว

    dht.h no such file or directory..... any ideas?

  • @udith-pz4tv
    @udith-pz4tv 5 ปีที่แล้ว

    Outdoor DHT sensor doesnot read minus values at winter.
    Please ,how can we fix the temperature from -50 to +50

    • @maslenir7422
      @maslenir7422 5 ปีที่แล้ว

      You cant, you need to get a different sensor for that

  • @MrRapmann
    @MrRapmann 6 ปีที่แล้ว

    How i connect lcd?

  • @Alexelectricalengineering
    @Alexelectricalengineering 8 ปีที่แล้ว +1

    Nice :) Thumbs up :)
    Alex

  • @mittromni2133
    @mittromni2133 7 ปีที่แล้ว

    i have dht22, he has a big error if compare whith psychrometer

  • @adamjensen6376
    @adamjensen6376 7 ปีที่แล้ว

    can that really work with my apartment cause I want to create one for myself and I want it to detect the temperature and humidity in my room

    • @adamjensen6376
      @adamjensen6376 7 ปีที่แล้ว

      Ok lets say I have two 3.7v batteries and co2 sensor tempature sensor DHT22 sensor could I power up all that with only two 3.7v batteries

  • @Apollo-ih7hs
    @Apollo-ih7hs 4 ปีที่แล้ว

    It keep telling me -999% on both Humidity and Temp, what do i do ?

  • @daroboro5137
    @daroboro5137 5 หลายเดือนก่อน

    What if I get temperature and humidity values "-999". It happens from time to time and totally random

  • @shrikantnikam2426
    @shrikantnikam2426 4 ปีที่แล้ว

    How to remember set point on power is off

  • @nathanial7249
    @nathanial7249 7 ปีที่แล้ว +2

    with that code i am getting a error
    expected primary-expression before '.' token

  • @serloydactive2284
    @serloydactive2284 3 ปีที่แล้ว

    can you make and DHT11 Temperature and humidity sensor using arduino with LCD display tutorial
    materials needed is:
    2 pieces of DHT11 sensor
    1 piece of LCD 16x2 with I2C Module
    and show to code for this please....

  • @v.e.n.k.e.y8521
    @v.e.n.k.e.y8521 6 ปีที่แล้ว

    hi can it work without computer after programming
    reply fast

  • @marcmandagi6777
    @marcmandagi6777 7 ปีที่แล้ว

    how to use in arduino uno?

  • @HVAC-BDE
    @HVAC-BDE 7 ปีที่แล้ว +1

    Code will not compile:
    sketch_jan28a:14: error: 'dht' does not name a type
    dht DHT; // Creats a DHT object

    • @clementdavid7370
      @clementdavid7370 5 ปีที่แล้ว

      have you find the solution? I try today this program and have the same thing

    • @mateuszk4825
      @mateuszk4825 5 ปีที่แล้ว

      @@clementdavid7370 solution?

  • @chaoxi8966
    @chaoxi8966 8 ปีที่แล้ว

    Hi, I got an error when uploading.... please help...
    fatal error: DHT.h: No such file or directory
    #include "DHT.h"

    • @chaoxi8966
      @chaoxi8966 8 ปีที่แล้ว

      +chao xi I have downloaded the DHT lib and the error is gone now. But still when I open the serial monitor, there is always zero value.... the sensor seems not sending any value, i use a 1K resistor in the data port of DHT11.

    • @chaoxi8966
      @chaoxi8966 8 ปีที่แล้ว

      Hi, Dejan. Thanks for your prompt response. I have downloaded another lib and yes it works now. Thank you sir!

  • @prathamva7392
    @prathamva7392 8 ปีที่แล้ว

    Sir how to connect aurdino to ethernet

  • @dsimiyu520
    @dsimiyu520 5 ปีที่แล้ว

    is your code available

  • @lyang4741
    @lyang4741 7 ปีที่แล้ว +2

    'dht' does not name a type
    How to fix it thanks

    • @yuriromano1119
      @yuriromano1119 7 ปีที่แล้ว +1

      Lyan G hey guy I was with the same problem, you should look for inside of the folder library and look if the name of the folder it's the same, if not just change it to dht and try to use :)

    • @siddhantsinha9276
      @siddhantsinha9276 7 ปีที่แล้ว

      Download the DHT 11 Library

    • @waleedishaq3012
      @waleedishaq3012 2 ปีที่แล้ว

      @@yuriromano1119 brother you mean to change the name in the folder

    • @yuriromano1119
      @yuriromano1119 2 ปีที่แล้ว

      @@waleedishaq3012 yes

    • @waleedishaq3012
      @waleedishaq3012 2 ปีที่แล้ว

      @@yuriromano1119 thank you I think that worked but I have got another error that says dht doesnot name a type
      My code is dht Dht;

  • @kibertrust
    @kibertrust 8 ปีที่แล้ว

    Sampling rate for dht22 0.5 Hz, it means that for 1 second we receive data two times, it's faster than dht11, isn't it?

    • @Ziplock9000
      @Ziplock9000 5 ปีที่แล้ว

      0.5Hz is the sample rate.. 0.5 samples/second or 2 seconds for 1 sample.

  • @justradek4751
    @justradek4751 8 ปีที่แล้ว

    pls arduino uno

  • @Wesgeen
    @Wesgeen 5 ปีที่แล้ว +3

    I'm just getting 0 temp and 0 humidity

    • @Wesgeen
      @Wesgeen 5 ปีที่แล้ว +1

      DHT.read11(dataPin) returns -3

    • @drewbutler1326
      @drewbutler1326 4 ปีที่แล้ว

      @@Wesgeen I am getting the same problem, did you ever figure it out?

    • @Wesgeen
      @Wesgeen 4 ปีที่แล้ว

      @@drewbutler1326 No, i eventually just assumed the DHT11 was broken, and moved on :c

    • @drewbutler1326
      @drewbutler1326 4 ปีที่แล้ว

      @@Wesgeen Well that stinks. Thanks tho.

    • @CanalUn
      @CanalUn 4 ปีที่แล้ว

      I had the same problem.
      Removed the resistance and it started to work.
      Don't know why. My DHT22 has 4 pins.

  • @qolbola_bilimuz4424
    @qolbola_bilimuz4424 6 ปีที่แล้ว

    brother, I am a little bit confused here because you did not show how to contact the display to the arduino board
    Please, help me with this

  • @syedmusakazim8192
    @syedmusakazim8192 7 ปีที่แล้ว

    Hi Sir, Can u send me the Source code?

  • @justradek4751
    @justradek4751 8 ปีที่แล้ว +6

    Arduino: 1.6.7 (Windows 7), Vývojová doska:"Arduino/Genuino Uno"
    C:\Users\User\AppData\Local\Temp\arduino_58c88b70bb658d9ab087ef443dabacf7\sketch_feb17a.ino:10:17: fatal error: dht.h: No such file or directory
    #include
    ^
    compilation terminated.
    exit status 1
    Chyba pri kompilácii.
    Tento výpis by mal viac informácií s
    "Zobraziť viac informácií počas kompilácie"
    povolené v Súbory > Vlastnosti.

    • @oneiricj4877
      @oneiricj4877 6 ปีที่แล้ว

      Hi did you find a way to solve this? I am having the same problem...

    • @akshatsahay9015
      @akshatsahay9015 5 ปีที่แล้ว

      @@oneiricj4877 download the library from the internet then include it in your Arduino sketch

    • @justovelarde3456
      @justovelarde3456 4 ปีที่แล้ว

      @Jair Pedraza Cuál? Hay varias- Gracias.

  • @aoa0687
    @aoa0687 7 ปีที่แล้ว

    Am I the only one getting the readings -999? Please help

    • @miguelunch4
      @miguelunch4 7 ปีที่แล้ว

      me too, do someone knows why does this happen?

    • @pengwin9
      @pengwin9 6 ปีที่แล้ว

      sounds like you guys swapped the ground and 5v wires.

  • @johnrubensaragi4125
    @johnrubensaragi4125 4 ปีที่แล้ว

    Inaccurate!

  • @mitchtalmadge
    @mitchtalmadge 3 ปีที่แล้ว

    The content of this video is really good but you should work on your intonation. Every sentence throughout basically this entire video was said with the exact same intonation pattern and it sounds super robotic. Talk like you are having a conversation with someone, not just spouting facts. No offense intended, just a tip. Great video.

    • @doc6188
      @doc6188 3 ปีที่แล้ว

      Well the reason he sounds like that is probably because of his accent, and English not being his native language

  • @ayasalama7062
    @ayasalama7062 7 ปีที่แล้ว

    translate to Arabic please 😐

  • @dragandespic8877
    @dragandespic8877 ปีที่แล้ว

    I cant find dht.h library

  • @serloydactive2284
    @serloydactive2284 3 ปีที่แล้ว

    can you make and DHT11 Temperature and humidity sensor using arduino with LCD display tutorial
    materials needed is:
    2 pieces of DHT11 sensor
    1 piece of LCD 16x2 with I2C Module
    and show to code for this please....