Measure Temperature and Humidity WiFi with ESP32 DHT11 and DHT22 - Robojax

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 มิ.ย. 2024
  • Learn how to use ESP32 as web server to measure temperature over WiFi on mobile phone or computer using DHT11 or DHT21, DHT22. Full wiring diagram, wiring and preparing Arduino IDE explained.
    If you have not used ESP32, you MUST watch this video • How to use ESP32 WiFi ... before you start with using ESP32
    *** Cool new product ***
    SONOFF TH Elite Smart Temperature and Humidity Monitoring Switch
    itead.cc/product/sonoff-th-el...
    The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
    I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊 .
    Download Arduino code for this video: robojax.com/L/?id=334
    **Purchase DHT11 from **
    Amazon USA: amzn.to/3dObYbY
    Amazon Canada: amzn.to/3d4Xg1c
    Amazon Europe (All Europe): amzn.to/3dObYbY
    Banggood (1 pc): www.banggood.com/custlink/m33...
    Banggood: (3pcs): www.banggood.com/custlink/Gv3...
    Banggood bare module(10pcs): www.banggood.com/custlink/GKm...
    **Purchase DHT22 from **
    Amazon USA: amzn.to/3mK2EKo
    Amazon Canada: amzn.to/3wO3FFA
    Amazon Europe (All Europe): amzn.to/3mK2EKo
    ** Purchase ESP32 WiFi Bluetooth MCU **
    from Amazon USA: amzn.to/3jOW5ob
    from Amazon Canada: amzn.to/3rJONVq
    from Amazon Europe : amzn.to/3jOW5ob
    AlExpress: s.click.aliexpress.com/e/_9iy3MO
    Banggood www.banggood.com/custlink/3vm...
    Jump to different section of video by clicking on the time:
    00:00 Start
    00:40 Introduction and web server
    04:26 Wiring diagram
    05:30 DHT22 wiring
    06:24 DHT11 (with pcb) Wiring
    07:08 DHT11 bare sensor
    08:19 Preparing Arduino IDE for ESP32
    10:32 Code Explained
    20:14 Demonstration with DHT11 (1)
    24:29 Demonstration with DHT22
    26:03 Demonstration with DHT11 (2)
    Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Learn Arduino from a proven instructor with 100s of projects, code, wiring diagram in structured course in one place. Purchase Arduino Course at Udemy.com : robojax.com/L/?id=153
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
    Get early access to my videos by becoming my Patreon and and have your name mentioned at end of very videos I publish on TH-cam: robojax.com/L/?id=97
    If you want to learn Arduino from proven instructor on **Udemy**: bit.ly/rj-udemy
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/learn/arduino
    #robojax #robojaxESP32 #robojaxDHT
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    Sir your video is so helpful for using arduino. Please make video on 7 segment or matrix display with neopixel ws2812b.

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

      thanks. never heard of it. Every months 1000s of new products come to the market. I will see if I can get it.

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

    If below correct. How can I have results BOTHshow on monitor (and write to a file). I need to print file results for 120 days. (I should be able to change intervals to every 4hrs to test and record results). Can HOMEASSISTANT (HASSIO) allow me to record 120 days of report to print?

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

    Hi, great video. Could this be used to periodically (say once per minute) log the data (temperature and humidity) to some kind of spreadsheet (googlesheet) to track the change of values in a graph?

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

      Hi, here is data logging to microSD card as spreadsheet and display it as graph th-cam.com/video/TduSOX6CMr4/w-d-xo.html

  • @kslim34
    @kslim34 2 ปีที่แล้ว +1

    Awsom video.... can you do one that uses a OLED Display?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hi, yes it can. you can learn it from this th-cam.com/video/UZTAV2sRi9w/w-d-xo.html

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

    Thank you for thai subtitle

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

      You are welcome. Please subscribe. I appreciate it and helps my channel grow. Thank you

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

    Thanks for sharing your incredible knowledge, you make it clear and easy. I'm trying to reproduce your project by adding 3 more DHT22. I'm not getting trusted values since I'm using the same ESP32. Do I need to get 3 of them and link it to a main board? Thank you for any further information. keep it going

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      you are welcome. I am pleased you found them useful. no you don't need 3 esp32. just define different pins for each and make separate object. I mentioned that we crate object install of the class dht.h file. please watch beginning of the code. in this case we created the dht object, then change it to dht1 for first sensor and dht2 for second and so forth. You may watch this video to learn the meaning of object better th-cam.com/video/L6ekl2ABcuY/w-d-xo.html

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

      @@robojax thanks for your answer I'm also checking now your website (robojax.com/learn/arduino/?vid=robojax-DHT22_2_or_more_DHT22) I assume that html code must be rewrited in order to show all the values but server config still the same. thank you.

  • @fawad960
    @fawad960 2 ปีที่แล้ว +1

    Can we connect M5STACK-CORE2-ESP32 with the DHT 22 the same way as you did in the above video?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Please search my channel. I have it

  • @electronic7979
    @electronic7979 3 ปีที่แล้ว +2

    Very helpful information

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

    Hi,
    Great video. Need some help.
    I'm trying to go to the IP address and see the readings, but I get just the humidity information. I need both temperature and humidity to be seen. Can you help with that please?

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

      Hi, I believe I have explained all lines of code. simply replicate the temperature code and make sure you can get two lines of temperature. Once it worked, then replace the variable that is holding the temperature in second line with the humidity.

  • @safriedlove7702
    @safriedlove7702 2 ปีที่แล้ว +1

    Bonjour
    Merci pour cette vidéo
    Svp comment peut on faire pour récupérer les données du moniteur série pour les enregistrées dans un ficher de sa machine ?
    Est il possible de faire un montage entre un esp32, une carte arduino et un capteur dht22? Si ou comment svp ?

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

      Bonjour, Arduino ne peut pas écrire sur votre ordinateur. vous pouvez utiliser le module de carte micro SD pour l'écrire là-bas. ou transférez-le sur un site Web ou un serveur Web. Je travaille avec quelqu'un pour offrir un tel service.

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

    Why do you disconnect the power wires for the sensor when uploading the code? If this were soldered together, you could not do that so I wonder why you do. Thanks!

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

      I don't remember exactly what I did but I've seen some components interfere with uploading the code to the device so I've done that.

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

    Great Video Ahmat thank you. Seems like you are from Afghanistan? I'm using a ESP32 Cam with it's own Webserver. Is it possible to add your Code also and have two Webserver on one Esp32 cam module?

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

      Hi, I am a Persian from Khorasan (now Afghanistan).
      On the same web server you can have camera and the sensor. just make sure not repeat the portion that is doing the same thing.

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

      @@robojax thanks it works now. I had to create the webserver an a different Port. Also GPIO 16 the only "free" Pin if not using an sd card wont work or will randomly reset. GPIO 4 is hooked to the LED Flashlight und will also have strange behavior. I'm trying to build a babyphone. Next Goal is to add a microphone and somehow transfer it via the Webserver..

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

    I actually meant was it possible for me to setup an OLED with the current configuration to display what was shown on the web, this way OLED would be local for me to see in the room... and the browser for when I'm sitting at my desk on the same network 🙃

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

      see your previous comment.

  • @-Ramani-go2zq
    @-Ramani-go2zq ปีที่แล้ว

    Sir can we have sensor to measure the temperature values for deliveries.. please help this is my final year project

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

      What is “values for deliveries “ ?

  • @DrTRonik
    @DrTRonik 3 ปีที่แล้ว +1

    ✔✔✔

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

    Can I use a OLED display with the ESP32 to display the temp and humidity also with the web

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      if you mean to be able to read it outside your home or your work network, yes it is possible. I am working with a new service . You would have to pay for a service that makes it possible and a computer is running 24/7 to read the information and you will then be able to use any browser to read it. The service I am working on will be available in 2 to 3 months. .

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

      you should have replied there so other would learn from it. I am correcting it by replying here.

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

      Here is my video on OLEd display th-cam.com/video/UmYiHTOz-5k/w-d-xo.html I have explained it fully. so watch, learn and use it with ESP32.

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

    Anyway to store data in a graph or to monitor the temperature when you are not connected to the same WiFi network? Something like a VPN I guess

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

      that needs separate video. Yes possible. but not just buy itself. We need a web server to do that. I never thought people would want to view it on remote location outside home. God willing, I will make series of videos on that.

    • @UpSpider
      @UpSpider 3 ปีที่แล้ว +1

      @@robojax I build automated systems for terraria. Real Time Timers, temp/humidity sensors, Relays for Lights, Pumps, Heating devices. When I am not home, it would be great to know that everything is fine and nothing is on fire or that the temperature is not too hot or too cold. Your videos are amazing as always.

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

    Am I able to use the same code on the esp8266 instead of the esp32 ?

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

      Hi Tim, please search my channel. I have the video. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

  • @feyyazsandkc4202
    @feyyazsandkc4202 10 หลายเดือนก่อน

    Hello ı have some problems. I did everything like you but it doesn’t define an IP adress. It constantly prints “…..” How can I fix it ?

    • @robojax
      @robojax  10 หลายเดือนก่อน

      I assuedm you have installed the Arduino Driver and libraries. The next problem woudl be the SSID of your Wifi- If it is "Book" and you type "book" it wont' work. So chek that. But if this is your fist time usign ESP32, then you need to watch introduction to ESP32 here th-cam.com/video/--Fj8QDlGuQ/w-d-xo.html

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

    How can I get the code for esp32 control pca9685 16 servers use smart phone?

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

      why you posted here? Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

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

      you should have posted it under videos related to PCA9685.

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

    How much cost to set up my 6 devices with battery power each?

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

      Hi, hard to tell. it depends where you are going to buy it from. From Amazon it would be fast and expensive like ESP32 $15 + 5x$10=$65. from eBay or AliExpress less than $20 but you have to wait for 30 to 50 days.

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

      The link for Amazon is in description of this video.

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

    So DHT BLUE IS FOR HUMIDITY / DHT22IS FOR TEMPERATURE. AND A SINGLE ESP32. THEN WE GET BOTH TEMP AND HUMIDITY.

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

      all of them can measure temperature and humidity. just select which one you want.

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

      Thx Sir. I checked USA supply and it’s low. China ships November. How crazy.lol. If you have qty 6 dht22 and esp32 to sell, that would help me assist elderly person home with black mold growing. Trying to save her home. I would need 18650 loin batteries x 12, and hardware to connect batteries to esp32. No power under her home. Thx, god bless!

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

      10s if not 100s sellers are selling in on Amazon just search for either DHT11 or DHT22 and you can get it same or next day. the same for ESP32 or ESP8266

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

    fatal error: sys/socket.h: No such file or directory

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

      How to use ESP32 WiFi and Bluetooth with Arduino IDE full details with examples and code
      th-cam.com/video/--Fj8QDlGuQ/w-d-xo.html

  • @PauloSilva-ll4vs
    @PauloSilva-ll4vs 3 ปีที่แล้ว

    I have a problem with this sensor, when I turn on the esp32 the sensor just answer with nan, I need to turn off and on the sensor.

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Hello, I posted the video few minuets ago so you have not watched. If you watch my videos fully, I can assure you that you WILL NOT have any questions left. So please watch that is exactly I've shown the "nan" problem.

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

      @@robojax i watched the entire video and i do not see the resolution for nan problem.

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

      I have mentioned it. it is there.

    • @tcpbox
      @tcpbox 3 ปีที่แล้ว +1

      @@robojax you talk about a desconeted pin , this is obvious that we won't have a reading, but i am talking about the dht22 nan problem, even connected we have a wrong read.

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

      view at 25:05

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

    hi sir plice give me tha openpilot gcs softwir

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Hi, this video has nothing to do o do with drone. Lol 😂 . I believe if you search Bing or Google you should get it. I have not used it. I ha e pled openpilot softwares link in one of my video where I spoke about cc3d flight controller. So search my channel and check the description of the video. Please always post questions always relevant to the video so others learn as well. I read all comments.

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

    I AM MOST HUMBLED IN ASKING YOU TO READ MY SPECIAL NEEDS. ADVISE IT YOU CAN HELP.
    need battery powered option for both temperature and humidity. I am confused which hardware to use after you talked about many items.
    It needs to be very small without bread board if possible. I need to monitor qty 6 constantly an the information record to raspberry pi 3b+.
    I have to show record of temp/humidity/date/time on a report that continues recording data.
    I will use router locally.
    I would like to SEE and FILE RESULTS FOR PRINTING BOTH.
    Can you SHOW ONLY HARDWARE NEEDED with battery power? Can you write code for each device qty 1. Then show me how to name the device where I can copy code then change name for each of the 6 devices?
    They will each be in different locations and require battery power. I need to read and print data file often.

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

      please see my other comment.

  • @ignatiusp.freely8880
    @ignatiusp.freely8880 2 ปีที่แล้ว

    Huge fan of your videos. I use them more than any other tutorial provider.
    However, I didn't like this video.
    Biggest problem:
    To alternate between temperature C, temperature F, and humidity, we must recompile and upload. YUK!!!
    Why not give us three buttons on the web page instead?
    *Lots* of little problems in the code:
    1. Even with "showSerial" set to false, "Serial.println();//just adds new line" keeps cranking out blank lines to the Serial Monitor;
    2. "Serial.println(" to read temperature");" could be a little more responsive (i.e. temperature isn't appropriate if unit=2)
    3. float temperatureValue,temperatureFValue, humidityValue;
    really only need one variable as your web page and loop() really only use temperatureValue
    4. loop() is screaming for a "switch (unit)" statement
    Sorry to be so pedantic, but the "Biggest problem" perturbed me.

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

      Hello, WiFi has always lags. use Bluetooth with ESP32 th-cam.com/video/Zm8Xor_vYF4/w-d-xo.html Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo