Send DHT11 data to PHP MySQL Server using NodeMCU ESP8266

Today, I will show you how to send DHT11 data to MySQL Server. Then you can display temperature and humidity data on your own dashboard in real-time. I have just connect the DHT11 sensor to NodeMcu ESP8266. And after uploading the code, the NodeMCU start sending temperature and humidity data to MySQL Server.
This is a NodeMcu based internet of things project. And you do not need to use any IOT cloud Platform. I will show you how to build cloud like platform using a PHP and MySQL Server.
The dashboard of this project is very simple. I've added two gauge meters to display the real-time temperature and humidity data. You can also visualize all the latest data in tabular form. This project is just like having your own weather station dashboard and you can monitor your weather station readings, from anywhere in the world.
--------------------------------------------------------------------------------------------------------------------
Parts Buy Links (Affiliate Links)
--------------------------------------------------------------------------------------------------------------------
1. NODE MCU - amzn.to/3Zzm1bJ
2. DHT11 Temperature Humidity Sensor - amzn.to/421TIUD
3. Breadboard - amzn.to/3ysOvHX
4. Jumper Wires - amzn.to/3YRafs5
0:00 - Intro
0:46 - Advantages of your own IOT Cloud
1:45 - Project Code and Related Resources
2:07 - Recommended Hosting for Weather Station Froject
2:36 - Create a Subdamin
3:35 - Crate MySQL Database
4:32 - Uploading SQL file in Database
5:07 - Upload Project Files to Web Server
5:42 - Project Configuration
7:34 - Testing Project with Fake Data
8:07 - Wiring NodeMCU with DHT11
8:32 - NodeMCU Sketch (Programming)
9:04 - Arduino Serial Monitor Tesing
9:17 - End Screen
--------------------------------------------------------------------------------------------------------------------
Useful Video Links
--------------------------------------------------------------------------------------------------------------------
NodeMCU SIM800L GPS Tracker
• NodeMCU SIM800L GPS Tr...
Arduino IOT Cloud Home Automation With ESP32 and NodeMCU
• Arduino IoT Cloud Home...
--------------------------------------------------------------------------------------------------------------------
Social Media Links
--------------------------------------------------------------------------------------------------------------------
GitHub:
github.com/ahmadlogs/
KZread:
kzread.info?sub...
--------------------------------------------------------------------------------------------------------------------
Download Code
--------------------------------------------------------------------------------------------------------------------
github.com/ahmadlogs/nodemcu-...
--------------------------------------------------------------------------------------------------------------------
Disclaimer
--------------------------------------------------------------------------------------------------------------------
Disclaimer: All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.
#NodeMCU #ESP8266 #ESP8266Projects

Пікірлер: 108

  • @ry0usama511
    @ry0usama511Ай бұрын

    Very simple and understandable guide. Thanks!

  • @Lovely-bx8se
    @Lovely-bx8se7 ай бұрын

    Bonjour, Tous d'abord un grand merci pour ce tuto très complet précis accompagné en plus de l'ensemble des elements.Pour ce qui cherche, ne cherchez plus vous avez trouvé. J'avoue ne pas être un grand spécialiste et grâce a ce tuto j'ai put appliquer l'ensemble du projet ( avec un serveur LAMP ) sur un Raspberry. Merci !!!

  • @AhmadMehraGohar
    @AhmadMehraGohar2 жыл бұрын

    very nice and professional best product

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    Thanks

  • @abdiqadirmohamednor6101
    @abdiqadirmohamednor61012 жыл бұрын

    Thank you so much you helped me deeply

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    thanks

  • @shakerileiwat4341
    @shakerileiwat43412 жыл бұрын

    Great project Thank you

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    Glad you like it!

  • @user-gm4lh9cl8t
    @user-gm4lh9cl8t Жыл бұрын

    thank you. so helpful vid

  • @AhmadLogs

    @AhmadLogs

    11 ай бұрын

    thanks

  • @rampage_xdit
    @rampage_xdit2 жыл бұрын

    You are the best

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    thanks

  • @ahmedtaher4015
    @ahmedtaher40152 жыл бұрын

    Verry nice

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    Thanks

  • @kamalkamel7559
    @kamalkamel75592 жыл бұрын

    very great project, how control devices, example relay and display temperature!!

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    It is possible. but it required some research.

  • @TechTrendsShameer
    @TechTrendsShameer Жыл бұрын

    Hi Bro, How to change the maximum value in the gauge from 100 to any other higher value? Please help me.

  • @EasyOne
    @EasyOne2 жыл бұрын

    nice

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    Thanks

  • @tamapra57
    @tamapra572 жыл бұрын

    If you could explain each PHP file that'd be great since im a beginner. Thanks!

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    Noted!

  • @TechnicalidEas07
    @TechnicalidEas072 жыл бұрын

    Arduino or NodeMCU will have a push switch attached. When I press in that switch, the location will go to our mobile

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    ok

  • @tariq4846
    @tariq4846 Жыл бұрын

    How to display multiple sensors data on same page?

  • @rodiasgohoue6014
    @rodiasgohoue60142 жыл бұрын

    thanks for this tuto

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    so nice of you

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    @@AhmadLogs i really like this tuto .Actually im working on how to send data to laravel mysql. Have you an idea to how display data through gauge

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @Rodias Gohoue laravel is a php framework. you need to convert all the php code to laravel. To work with laravel you need to learn basics of this framework for 1. inserting data in the database 2. displaying it on the web page in a nice format. I have used Google Gauge in the tutorial. and you can use the same with laravel. the same code will work for laravel that I have used at the end of the index.php file. there is a tag. and all the code for gauge in available within the tag. this is a java script code and you can use JavaScript with any web based programming language and framework.

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    @@AhmadLogs thanks . Im working on it

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    it's work now thanks a lot

  • @Lovely-bx8se
    @Lovely-bx8se7 ай бұрын

    Je me permets de revenir vers vous pour une question,peut on rajouter la fonction MQTT a ce projet?Merci de votre reponse

  • @amirtelecom6898
    @amirtelecom68982 жыл бұрын

    Verry Nice ... Can this be used with SIM800l ?

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    yes, it might be used

  • @TechTrendsShameer
    @TechTrendsShameer2 жыл бұрын

    Good one bro. Shall I use your code for my videos? Any problem ?

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    no problem. you might use. the code is free for all

  • @TechTrendsShameer

    @TechTrendsShameer

    2 жыл бұрын

    @@AhmadLogs thanks bro.

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @@TechTrendsShameer you are welcome

  • @AITwo_co
    @AITwo_co2 жыл бұрын

    please make a video on going live with jazzcash payment gateway...

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    NOT POSSIBLE

  • @annoorkhan4219
    @annoorkhan42192 жыл бұрын

    Nice ,I tested your projects and it worked perfect but now I need to control few LED from web page, so what I have to do ?do I have to use mqtt broker?

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    I pefer to suggest mqtt broker

  • @Lovely-bx8se
    @Lovely-bx8se3 ай бұрын

    Bonjour, J'ai essaye d'adapter votre code pour un capteur DS18B20 mais les valeurs ne change pas elle m'indique 24 et 77.

  • @DiyintheGhetto
    @DiyintheGhetto Жыл бұрын

    Hello, What happens if you have multiple sensors on multiple esp866. How can I do that within mysql to store and display them?

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    then lot of changes are required. both in the sketch as well as php myql code

  • @DiyintheGhetto

    @DiyintheGhetto

    Жыл бұрын

    @@AhmadLogs got you thank you.

  • @TechTrendsShameer
    @TechTrendsShameer2 жыл бұрын

    Hi bro. How to change the color of the gauge in the output. I tried in the script, but the color goes to blank

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    I have used Google Gauge in this project. and the Google Gauge have limited colors only 3 red, green and blue. try this on line number 115 of index.php redColor: "rgba(198, 0, 0, 0.67)",

  • @TechTrendsShameer

    @TechTrendsShameer

    2 жыл бұрын

    @@AhmadLogs Ok bro. Thank you

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @@TechTrendsShameer so nice of you

  • @SAURABHKUMAR-py9or
    @SAURABHKUMAR-py9or2 жыл бұрын

    Hi bro I did everything like u said. Database is getting data if we try to add fake data through post_data_test.php and nodemcu is also sending data successfully as it's showing http code 400 on serial monitor but it is not saving in database of the website if we check in database. Can you tell me the reason?plz

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    http code 400 means the data is not sending successfully to the database. please post your full serial monitor output here.

  • @SAURABHKUMAR-py9or

    @SAURABHKUMAR-py9or

    2 жыл бұрын

    @@AhmadLogs Connecting...........Connected to WiFi network with IP Address: ***********Temperature: 31.30Humidity: 39.20--------------------------temperature_data: api_key=hello world&temperature=31.30&humidity=39.20HTTP Response code: 400

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @@SAURABHKUMAR-py9or which web server you have used awardspace or any other

  • @nonel7215
    @nonel72152 жыл бұрын

    Thank you so much for this. I'm having issues with http.begin(client, SERVER_NAME); It gives error Compilation error: no matching function for call to 'HTTPClient::begin(WiFiClient&, const char*&)' I would appreciate if you can help

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    install the esp8266 core version 2.6.0 or lower

  • @nonel7215

    @nonel7215

    2 жыл бұрын

    @@AhmadLogs thank you so much!

  • @kucingawak

    @kucingawak

    10 ай бұрын

    @@AhmadLogs I also get the same error but my esp board is currently version 2.4.0 how to fix it?

  • @mailtorameshhr
    @mailtorameshhr2 жыл бұрын

    very nice project thank you and why it is giving error like #1226 - User '4071374_tempdb' has exceeded the 'max_connections_per_hour' resource (current value: 1500)

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    this is because you are using free web hosting. you can send 1500 request in an hour using this hosting. for getting more you need to buy a web hosting plan

  • @mailtorameshhr

    @mailtorameshhr

    2 жыл бұрын

    @@AhmadLogs thank you

  • @markludwig5805

    @markludwig5805

    2 жыл бұрын

    Great video...good stuff. I had the same problem. Awardspace shut down my free account due to abuse. Problem appears to be config.php line 18 according to awardspace. Is there a way to fix or reduce the number of connections/hr????

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @@markludwig5805 you just need to buy premium plan.

  • @virenrao82
    @virenrao82 Жыл бұрын

    monitor in showing http 200 code at nodemcu side, but data not available on php page. I am using infinity web hosting

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    there are just two free web hostings that work with the project. 000webhost, and AwardSpace

  • @syaduinotech3681
    @syaduinotech3681 Жыл бұрын

    Thanks for sharing. I try already but fail to get the function. I am using personal website.. its so hard many creator using free..huhu. can you share video about own personal website. I try using randomnerdtutorial get the http code 300. Mind to help. Using the personal website. I did not know the host name.

  • @user-oy1kq4ck8y
    @user-oy1kq4ck8y Жыл бұрын

    my serial monitor is not displaying anything

  • @katkatia9255
    @katkatia92552 жыл бұрын

    What can i modify if i use xamp ?

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    I think you just need to change the URL. I mean change the website url to your locallhost project url. like localhost/your_project_name

  • @bektinurwanto
    @bektinurwanto Жыл бұрын

    If using localhost, can i use api key?

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    yes you can

  • @ahsanejaz1743
    @ahsanejaz17432 жыл бұрын

    i will wait for your response

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    for what?

  • @rodiladriangaryck6488
    @rodiladriangaryck6488 Жыл бұрын

    Can I use this code for esp32 as well?

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    not

  • @jeromebla5835

    @jeromebla5835

    11 ай бұрын

    You have to modify it. I run it on a esp32 with DHT20

  • @rikinurfalakhi8943
    @rikinurfalakhi8943 Жыл бұрын

    i have followed your video and i found the https respone code is 400 not 200, what should i fix?

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    it means the page you are requesting is not found. just make sure you have properly uploaded the php file on the webserver

  • @mbinacedric3566
    @mbinacedric356611 ай бұрын

    Hi, i have a video topic for you!!!

  • @fakhriaidil3774
    @fakhriaidil3774 Жыл бұрын

    why when it try to run the post_data_test.php ....it come out with error 404 page...i follow all the instruction

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    If you are getting a 404 error when trying to run the post_data_test.php script, it means that the server is not able to locate the script at the specified location. Make sure that the file is located in the correct directory on the server.

  • @user-om1sv1df1r
    @user-om1sv1df1r Жыл бұрын

    how to fix bad requests. response code 400. the file sensordata.php cant find HTTP request, btw im using hostinger as webhost

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    I thinks you did not upload the sensordata.php file at the correct location

  • @rodiasgohoue6014
    @rodiasgohoue60142 жыл бұрын

    Ahmad logs plz help me. Im in trouble each time i tried to compile my code on esp8266 this error appear double free or corruption (out) signal: aborted Erreur de compilation pour la carte NodeMCU 0.9 (ESP-12 Module) do you know what this means?

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    you just flash your esp device

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    @@AhmadLogs oki thanks i'll try it Can you give me mail . i'll chat there if need . Thanks

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    hello @@AhmadLogs

  • @rodiasgohoue6014

    @rodiasgohoue6014

    2 жыл бұрын

    @@AhmadLogs I need your help Did you ever use esp8266-01 ?I want ti know how connect it to php server

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    @@rodiasgohoue6014 Sorry I never used it before. there is a video on electronoobs channel in which he uses esp8266 for the same purpose

  • @yashagrawal3539
    @yashagrawal3539 Жыл бұрын

    why am i getting the http 301 error? i have followed all the steps

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    which hosting service you are using?

  • @yashagrawal3539

    @yashagrawal3539

    Жыл бұрын

    @@AhmadLogs thank you for the reply. i have my site on the hostinger platform

  • @l3nnyraw901

    @l3nnyraw901

    Жыл бұрын

    Im getting the same HTTP code (301). It means that you have a wrong link or so. I host my project too with hostinger. but there is already a wordpress Webpage in my files. So I had to rename the index.php file (wehre the html code is in) to index2.php. So maybe this causes the HTTP Code 301. But I cant find the place in the project files wehre i can link to the index2.php file. /// The "post_data_test.php" makes an entry in the DataBase and works fine but the esp8266 creates no entries. so I cant find the issue.

  • @joroxanborata3102
    @joroxanborata3102 Жыл бұрын

    sir is this working for hostinger cause my http code: -1

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    it must work

  • @persephone1571

    @persephone1571

    Жыл бұрын

    @@AhmadLogs same but there are no changes on the index page

  • @persephone1571

    @persephone1571

    Жыл бұрын

    @@AhmadLogs also can you help me send an email using php?

  • @POTTIVENKATASAICHARANBEC
    @POTTIVENKATASAICHARANBEC Жыл бұрын

    website is not working can u check it thanking you

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    I have tested it and it is working fine.

  • @TechnicalidEas07
    @TechnicalidEas072 жыл бұрын

    Make GPS project GPS and push switch

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    give me some details

  • @TechnicalidEas07

    @TechnicalidEas07

    2 жыл бұрын

    Arduino or NodeMCU will have a push switch attached. When I press in that switch, the location will go to our Mobile 📲

  • @kiritochanel2351
    @kiritochanel23512 жыл бұрын

    How to fix? : HTTP Response code: -1

  • @AhmadLogs

    @AhmadLogs

    2 жыл бұрын

    this is the issue with the free web-hosting. but this is not more frequent issue if occurs time to time. if you buy a hosting plan then the issue will solved forever.

  • @nattanon_mixx3657

    @nattanon_mixx3657

    Жыл бұрын

    i use localhost?

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    @@nattanon_mixx3657 but I did not test it on local host. try http:localhost/yourproject http:127.0.0.1/yourproject. make sure not use https. (I am just talking about 's' in the https string)

  • @emojiit362
    @emojiit3622 жыл бұрын

    We need to talk Can you check your email?

Келесі