ESP32 DHT11/DHT22 Asynchronous Web Server (auto updates Temperature and Humidity)

Поделиться
HTML-код
  • Опубликовано: 2 авг 2024
  • For complete project details (schematics + source code), visit ► RandomNerdTutorials.com/esp32...
    Enroll in "Learn ESP32 with Arduino IDE" Course ► randomnerdtutorials.com/learn...
    In this project, you'll learn how to build an asynchronous ESP32 web server with the DHT11 or DHT22 that displays temperature and humidity using Arduino IDE.
    The web server we’ll build updates the readings automatically without the need to refresh the web page.
    Like my page on Facebook:
    / randomnerdtutorials
    Add me on Google+:
    plus.google.com/+RuiSantosdotme
    Follow me on twitter:
    / ruisantosdotme
    Subscribe for more projects like this!
    bit.ly/subscribeRNT
  • НаукаНаука

Комментарии • 114

  • @RuiSantosdotme
    @RuiSantosdotme  5 лет назад +6

    You can find the full code for the Asynchronous ESP32 DHT11/DHT22 web server on our blog ► RandomNerdTutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
    You can enroll in "Learn ESP32 with Arduino IDE" Course ► randomnerdtutorials.com/learn-esp32-with-arduino-ide/

    • @edudz151186
      @edudz151186 5 лет назад

      Hi Rui, can I use this for my esp8266 wemos d1 mini?

    • @RuiSantosdotme
      @RuiSantosdotme  5 лет назад

      @@edudz151186 for the WeMos, you need to use this code instead randomnerdtutorials.com/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide/

    • @Ankit-mq6em
      @Ankit-mq6em 4 года назад

      Hello sir I'm getting ip address of esp32 but when I'm putting in browser it is not loading whyyy????

  • @factormarketing5652
    @factormarketing5652 4 года назад +4

    i don't understand how this type of videos have less views that trash videos , excellent thanks :)

  •  4 года назад

    Very good, thanks. I made a remix with your ideia in this video and with the Oled display, now I have a system that shows the temperature in all devices connected in this IP and in the Oled, as the same time. Thank you for shared your knowledge.

  • @Flynn3778
    @Flynn3778 5 лет назад +4

    One of the best video tutorial I have ever seen. Well done!

  • @user-st8bb2gs9e
    @user-st8bb2gs9e 2 года назад

    Bro your tutorials are soo amazing good! Never seen anything like this before on youtube ! Ty soo much :)))

  • @victor7ultimate
    @victor7ultimate Год назад

    I love the detailed voice-over explaination.👍👍

  • @marinmitev
    @marinmitev 4 года назад +1

    Just awesome explanation! Thank you!

  • @stefanbramel
    @stefanbramel 5 лет назад +5

    Great job Rui, I'm definitely going to upgrade my current weatherstation as fast as possible. I'am wondering if it is possible to draw diagramms with the sensor data to see for examle how the temperature has changed over night. It would also be nice if you could display the lowest and highest temperature per day on the website. ;)

  • @101appsCoZa
    @101appsCoZa 4 года назад

    Excellent tutorial. Thanks very much for sharing!

  • @alexharijanto9137
    @alexharijanto9137 4 года назад +2

    EXCELENT..!!!..., thanks for sharing and the mailing list

  • @micaelsantosnascimento8566
    @micaelsantosnascimento8566 4 года назад +1

    Thanks, this video helped me a lot :)

  • @marioronquillo4771
    @marioronquillo4771 2 года назад

    Thx mate, this was so useful for me!

  • @leizerleite4457
    @leizerleite4457 4 года назад

    Grato por compartilhar conhecimento! Trabalho muito bem elaborado, aprendi muito.

  • @Lyndon_K
    @Lyndon_K 5 месяцев назад

    Great video, thanks!

  • @VerasakSahachaisaree
    @VerasakSahachaisaree Год назад

    Thank you so much for this video. Very good.

  • @RickB3n
    @RickB3n 4 года назад +1

    Awesome tutorial, i subscribed immidiately :)

  • @esp-explain655
    @esp-explain655 3 года назад

    thank you so much bro u saved me from a lot of researches from google

  • @Squancheeb
    @Squancheeb 5 лет назад +1

    Thanks for the informative video. I'm trying to make an arduino that monitors humidity and temperature in my mushroom fruiting chamber. I'd like to use the data from these sensors to also create a graph. Any tips?

  • @henkkuik2341
    @henkkuik2341 4 года назад

    Grato por compartilhar conhecimento Rui. (Had to look that one up) Great video. Can i use basicaly the same method with a max31865 rtd converter and a rtd100/1000 sensor? Witch library would i need then?

  • @carloscoelho3824
    @carloscoelho3824 3 года назад

    Muito bom este vídeo, muito bem explicado só é pena não ser em português.

  • @user-mr9ol6lx1l
    @user-mr9ol6lx1l 3 года назад

    Very good thanks.

  • @msingh9550
    @msingh9550 3 года назад

    Awesome tutorial.
    Is it possible to have a control of this module and have the data from this station show up in homeassistant iot interface. Thx

  • @filalieya7725
    @filalieya7725 4 года назад

    thank you

  • @Shabloop
    @Shabloop 3 года назад

    great video tutorial. i have a question though regarding about this esp32. im building a project that will need a camera and internet connectivity and found that there is a esp32 wifi camera. my question is if the esp32 wifi camera can be used to control the arduino over wifi while receiving data then send it to an android app

  • @ogad12
    @ogad12 4 года назад

    Thanks for this project and tutorial it has come in really handy. Is it posible to integrate an email alert if the senor detects a dip or increase in temperature? Email would be from pop3 /smtp. Thanks again!

  • @SandeepSandhu
    @SandeepSandhu 5 лет назад +1

    Can you please make a video on ESP32CAM to send files over Bluetooth considering Aithinker's builtin Bluetooth. Thanks

  • @mibrahim4245
    @mibrahim4245 Год назад

    Great Rui !!! ...
    But, I didn't understand the lower part of the web page, how did you replace the variables in HTML with the sensor readings ? "using the % symbol" ?

  • @longngo2418
    @longngo2418 3 года назад

    the Webserver can monitor the temparature and humidity value on runtime ? we don't reload website to update the value? Thanks for this interesting video. So very useful!

  • @marioneves177
    @marioneves177 4 года назад

    Antes demais parabens pelo bom trabalho e por partilhar, tenho uma questao, e possivel atribuir um ip fixo ao esp 8266 para nao estar a ser atribuido pelo dhcp?

  • @gustavosantos5886
    @gustavosantos5886 3 года назад

    Hello,Nice tutorial! How can i use for a hc-sr04 sensor?

  • @renen26
    @renen26 5 лет назад

    Nice man! im currently building smart terarium and this is exactly what i need. Previosly i was using html meta refresh command and after 30mins my esp always soft WDT resets.. Could this fix it? or do you thing my app crashes for some other reasons? because when i dont have the web interface opened it runs smoothly :D

  • @jacgeo9887
    @jacgeo9887 4 года назад

    Hi
    Am I able to print a series of texts (from data from a flex sensor - for eg. “hello, how are you?” onto the webserver that the esp32 connects to?

  • @fluna1974
    @fluna1974 4 года назад

    eXCELENT! How can I do the same but with 4 sensors (4 esp32) I need all of them shows on same page...

  • @teodoro4715
    @teodoro4715 4 года назад

    You are my god

  • @nhat_uet7151
    @nhat_uet7151 4 года назад

    how can i add more sensors to the system? I did try but I can't upload the data from the extra sensor onto the web page? can you help me?

  • @cheapskatetanks8200
    @cheapskatetanks8200 4 года назад

    I just want to ask about the esp32, I have a problem when uploading the codes to the esp32. Some says ur need capacitor 10uf to connect the gnd to the EN pin. i dont remmber.. but somewhere in the esp32.

  • @TechInventorAman
    @TechInventorAman 4 года назад

    If i use the AP mode instead of a STA mode will the values still get updated . And how exactly is the values getting updated automatically without actually using AJAX or anything else without actually refreshing the page ?

  • @davidsantiagogalvan3795
    @davidsantiagogalvan3795 2 года назад

    Hi Rui! Great video, ¿can you make a video with ESP8266? Thanks.

  • @shakerileiwat4341
    @shakerileiwat4341 5 лет назад

    Amazing

  • @wnemn
    @wnemn 4 года назад

    Hello, great work, thanks. But i ran into an issue:
    If a add more paragraphs for other sensors, the last paragraphs on the page wont be displayed…doesnt matter what i put on the button of the page. Can you helb me?

  • @yudistiradewanda4231
    @yudistiradewanda4231 4 года назад

    is it possible to use 2 sensors(dht22) in 1 esp32?

  • @richrizo1515
    @richrizo1515 4 года назад

    i want send a voltage of a potentiometer to a web page like you, you use a library for the sensor, i dont know how make that., can you hep me?

  • @puchomoreno
    @puchomoreno 5 месяцев назад

    Can you do it as an access point?

  • @hamzamaxmouri1099
    @hamzamaxmouri1099 3 года назад

    Great vidéo thanks.
    i tried to do the same but the page would not referech automaticly anny help please !!!

  • @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?

  • @rendirestman4615
    @rendirestman4615 4 года назад

    Sir how can i send a message with valiable data from android using MIT app to the esp web server? How the esp can get that data? What i mean is like for controlling led brightness

  • @mustafa97radhwan
    @mustafa97radhwan 3 года назад

    How could I change the background color of the web page according to value of the Temperature ?????

  • @Terry_Genereaux
    @Terry_Genereaux 2 года назад

    How do you know what board to use?

  • @alpeshsoni
    @alpeshsoni 3 года назад

    Very Good, How to Access this IP outside wifi? from the mobile location? Any Help!!

  • @irfanpin-2255
    @irfanpin-2255 4 года назад

    What is the range of it??

  • @xiaomidrone4k905
    @xiaomidrone4k905 Год назад

    Can you make update? Temperature and humanity graph?

  • @dimitriosa8tsipouras953
    @dimitriosa8tsipouras953 4 года назад

    how i make that with fix IP? for example 192.10.1.1 then i login in with that ip?
    Thank you from Greece

  • @TashTech
    @TashTech 4 года назад

    im trying to run this on a nodemcu esp8266MOD, and first i was getting an error about the conts ssid, if i chnage it to insert my ssid and password instead of variable, then the error im getting is Error compiling for board NodeMCU 1.0 (ESP-12E Module). can anyone offer some advice please?

  • @yvesinformel221
    @yvesinformel221 3 года назад

    if you have multiple sensor, is it possible to write something like this
    DHT garden[2];
    then you could initialize them in a for loop like
    for (i=0; i

  • @galihridhoutomo
    @galihridhoutomo 4 года назад

    Rui Santos, I have problem "Error compiling for board ESP 32 Dev Module" please i need solution

  • @rafalzasada8826
    @rafalzasada8826 2 года назад

    It is possible to have fixed website name instead of IP address? Is Arduino library capable of that?

  • @yawarsaeed6499
    @yawarsaeed6499 5 лет назад +1

    Thanks for sharing such an Awesome project. Can I get the same web page over an access point without having local WiFi network.
    Awaiting your earliest response.
    Thanks.

    • @henkkuik2341
      @henkkuik2341 4 года назад

      Do you mean from outside your network?
      If so than that is not a problem, you need to open the port 80 for that ip adres on your router. (Portforwarding)

  • @mohammednidal5206
    @mohammednidal5206 3 года назад

    i want to build web server using arduino uno. is this possible? can you help me out with it

  • @jasonmare33
    @jasonmare33 6 месяцев назад

    Hi I have IDE 1.8 arduino esp 32 dev the code stops at the WiFi.mode! the mode is not highlighted cant load any idea what the problem I have used this tutorial before no problems thank you

  • @ضياء6
    @ضياء6 3 года назад

    how can we make the IP static?

  • @ManuelCastillo-kq3xy
    @ManuelCastillo-kq3xy 4 года назад

    Hi. Thx for this titorial.
    I need control 4 buttons/relay also.
    What is the best node to abord this?

  • @budianto3917
    @budianto3917 3 года назад

    thank you, good job. I have tried according to the tutorial, but why is it slow response from esp32 sometimes it doesn't even respond

    • @MoJoM0J01
      @MoJoM0J01 3 года назад

      I suggest you put an external antenna on it.
      After working with a few modules, having the external antenna really makes a difference in response time. I went from thinking I was coding something incorrectly, to realizing that the signal was just weak on multiple projects.

  • @mohammedthalha5006
    @mohammedthalha5006 2 года назад

    Does it need internet to transfer that data

  • @shahbaztech7064
    @shahbaztech7064 2 года назад

    When connect serial cable with esp32 on rx pin WiFi of esp32 not working it disconnected
    I take data from. Weights scale and send ko webserver using esp32

  • @AlexandreEglit
    @AlexandreEglit 2 года назад

    Friend you could do this same project with local indication with Oled display 0.96 I2c SSD1306

  • @rsrofik2019
    @rsrofik2019 2 года назад

    Can I see this output only ip address? And how to store pc? Please help

  • @user-ck4kb7cc6f
    @user-ck4kb7cc6f 4 месяца назад

    Iam trying to do same from last 1 week still cannot can help me how to connect to you

  • @Du2025
    @Du2025 3 года назад

    Xin chào bạn. tôi ở việt nam . tôi đã làm được. cảm ơn

  • @user-bg5jr4ji2z
    @user-bg5jr4ji2z 4 года назад +1

    Hello. Thank you for your great work. How to add button for LED in this script?

  • @kamalambrator4332
    @kamalambrator4332 5 лет назад +1

    nice! thank you. just one question, how to run any dht in web server with nodemcu or esp32?

    • @RuiSantosdotme
      @RuiSantosdotme  5 лет назад +1

      What do you mean? This web server is running on an ESP32 with a DHT sensor

  • @paulwilkie5350
    @paulwilkie5350 Год назад

    Hello Rui, I have been successful to replicate your ESP32 DHT11/DHT22 Asynchronous Web Server project, with the info in your great video. How can I convert the sketch to make the ESP32 modile an AccessPoint to communicate with my iPad as a WiFi client. My project will not have access to cell communication or internet access; such the need to make the ESP32 an access point to communicate data.

  • @nipoanz7865
    @nipoanz7865 5 лет назад

    Hola, una pregunta, con el esp32, cómo se puede configurar en modo (Accesa point) y de Cliente. Y como con esto puedo generar una red de esp32, gracias

    • @RuiSantosdotme
      @RuiSantosdotme  5 лет назад

      You can set the ESP32 as an Access Point by following this tutorial: randomnerdtutorials.com/esp32-access-point-ap-web-server/

  • @ericjoulin8758
    @ericjoulin8758 4 месяца назад

    Hi, my name is Eric (new subcriber)
    I have a projet of "connected beehive" to monitor the weight (HX-711 analogic sensor) and temperature (DHT22 digital sensor) with an Heltec ESP 32 Lora V3 board.
    I'm working with IDE Arduino interface and the driver of my Heltec V3 board has been successfuly installed as well as the boardmanager and library so that the COM communication between my Arduino IDE and my Heltec board works normally.
    My Heltec board is poorly documented (only a pin diagram which speaks more or less for me) so I found your channel with several videos dealing with "ESP32-DHT" ...
    But I have problems to make work (simple) sensor such as my DHT22 with my board. I mean I get "abnormal results" from my DHT22 sensor, such as T=253°C and H=253%
    (let me add that the problem doesn't seem to come from the sensor because I also have a DHT11 which gives the same abnormal results)
    These abnormal results I got from my DHT22 sensor with my Heltek ESP32 V3 board occurred with the "basic" example you gave to monitor a DHT 22 sensor on the serial monitor of an IDE Arduino interface.
    As a matter of fact, i exactly used the connexion example you gave BUT for the data pin, I replaced the GPIO 27 (digital pin of your ESP 32 board) given in your example by the GPIO 46 of my Heltec V3 board (which should be a digital pin if I'm not mistaken but I would like you to confirm if you can)
    After this first problem of abnormal results of my DHT 22, I decided to "start again from scratch" with another of your examples (i.e. the present video dealind with "ESP 32 and asynchronous web servor")
    BUT I faced with another problem when I downloaded the "DHT unified sensor" library because I wasn't able to make any modification of the sketch because of a error message ("cannot edit in read-only editor")
    Then I opened the "preferences" of the IDE Arduino interface but didn't find any option to enable the edition of you "DHT unified sensor".
    So I have 2 questions:
    1) how to enable the "edit mode" of your "DHT unified sensor" sketch so as to change the pin name and DHT sensor type?
    2) could you confirm that the GPIO 46 of the Heltec ESP32 Lora V3 board is effectively a "digital" pin which suits for the connexion of the DHT22?

  • @Ankit-mq6em
    @Ankit-mq6em 4 года назад

    Where to get this ip address ?

  • @hoanghaiduong8174
    @hoanghaiduong8174 5 лет назад

    hey, i have this error message: error: unterminated raw string
    const char index_html[] PROGMEM = R"rawliteral(
    ^

  • @nilatac115
    @nilatac115 5 лет назад +1

    It is possible instead using the local ip ( 192.168.0.1 ) to use a domain that can be accessed over internet ?

    • @Flynn3778
      @Flynn3778 5 лет назад +1

      I would like to know this as well.

    • @gleglenopeone
      @gleglenopeone 4 года назад

      If you have a web site you are familiar with adding blocks to the website you can add a block custom HTML to put sensor readings on the website with this HTML code ,
      example like this ,first open the serial display and then power the board and see the ip address for the board on the display , not sure that 192.168.0.1 would be the boards ip address that just looks like the router address . once you have the ip enter it into the code like below
      also add “DHT sensor library” to the arduino code and the reading will be much more stable .
      when I used only the recommended libraries the reading would come and go but became constant after adding the DHT sensor library
      you may need to adjust the width and height number make it fit the display on the web page .

    • @gleglenopeone
      @gleglenopeone 4 года назад

      put your boards ip address in place of this one

    • @glennpeckham7945
      @glennpeckham7945 4 года назад

      @@Flynn3778 disregard what I said about the “DHT sensor library” that is already a recommended library , I made a mistake . the html code to add temperature readings to website works I use it , Im using it right now .

  • @ehsanulkarim
    @ehsanulkarim 3 года назад

    I am trying to connect dht22 to esp32. But esp32 gpio can only tolerate 3.3v whereas dht22 output is 5v. How do you solve it?

    • @davidsantiagogalvan3795
      @davidsantiagogalvan3795 2 года назад +1

      I think DHT22 can work with 3.3V, Because it worked for me. And if the sensor doesn't work you put it on VIN It could work like that

  • @user-ck4kb7cc6f
    @user-ck4kb7cc6f 4 месяца назад

    Hi

  • @bartekll7068
    @bartekll7068 5 лет назад

    its not IoT right? its work only in local network?

    • @RuiSantosdotme
      @RuiSantosdotme  5 лет назад

      Yes. It's only available in your local network...

    • @bartekll7068
      @bartekll7068 5 лет назад

      @@RuiSantosdotme thx for answer. I hope that u will make it in near feauture ;) it is possible to control 12V fan by this ESP8266?

  • @yooli6829
    @yooli6829 5 лет назад

    hello~ I am trying this project,but when it complied ,the arduino ide said that no such file ... If you ever change the the file's name of AsyncTCP?

    • @ivanciez
      @ivanciez 4 года назад

      Any solution?

  • @Kaka-zs4cp
    @Kaka-zs4cp 5 лет назад

    ok, now i'm confused, "Rui Santos" sounds like a Brazilian name ( I'm brazilian), but boy ur accent sounds like russian...
    MISTER RUI I DEMAND EXPLANATIONS!
    TRIRTY TUE is russian accent!! you cannot fool me, you are a spy!!

    • @RuiSantosdotme
      @RuiSantosdotme  5 лет назад

      I'm from Portugal :-)

    • @MicroageHD
      @MicroageHD 4 года назад

      His accent sounds 0% russian and 100% portugese. Never played CSGO?

  • @mohammednidal5206
    @mohammednidal5206 3 года назад

    hey can i add this with my arduino uno board?

  • @AlexandreEglit
    @AlexandreEglit 2 года назад

    Friend you could do this same project with local indication with Oled display 0.96 I2c SSD1306