Real-time Monitoring of Humidity and Temperature: Sending DHT11 Sensor Data to ThingSpeak Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
la la la la hi everyone welcome to the think speak series of videos this is bhupinder Singh and today I will tell you how you can send dst11 sensor data to the thing speak Cloud Server so we need the following components to make this project node MCU or 95x5 module dht11 sensor 3 female to female connecting wires this is circuit diagram of tst11 connections with nodemcu or notify Wi-Fi development board so this is the dht11 sensor that provides the relational humidity and temperature of the atmosphere it has three pins the first one is VCC middle one is data and the last one is ground this is 95 Wi-Fi development board this board is designed by a Nutty engineer company you can also contact them for your customization you can use node MCU connection will be the same so now connect the DHT sensor with the Wi-Fi board take three female to female wires and connect the VCC pin of DHT sensor to 5 Volt or V in pin of the nodemc ground to ground and data pin to D2 number pin of notify or node MCU our connections have been done now it's time to login to the thingy speak server open the web browser and open the thingspeak.com website here you will get the option to login to your account if you already have an account then login to your thing speak account otherwise you can create the new account by clicking on create one here you will get the verification mail from MathWorks if you created the new account now you can create your new channel here you can also find the channel in the channels tab click on the new channel right here the name as DST sensor data select the two Fields here write the field one as humidity and fill 2 as temperature scroll to the last here click on the show status and click on Save Channel button so our channel has been created you can see your channel that you have created for the DST sensor in the public view you can display your channel to everyone you can enable the public view by using the share tab in the sharing tab click on the share Channel View with everyone option you can find your API key to read and write data in the API Keys tab server you need only the write API key okay now time for the programming code go to the video description to find the link for the programming code this link will redirect you to my GitHub code copy this code and paste it to your new sketch of Arduino ID so this is the complete program first we need to save this program go to the file Tab and click on the save choose the location where you want to save the program like in the desktop write the name as dst11 thing speak and click on save button our program has been saved we need to add the DST sensor library in the programming code so click on the sketch Tab and in the include Library click on the manage libraries it will take little time to download the list of all the latest libraries for the Arduino search here DST foreign so click the install button you will get three options but you need to click on install all button to install the DHT sensor library with supportive libraries all right this will install the DHT sensor library in the Arduino IDE that will support our program once installation is done click on close at the top of the programming code I have defined the esp8266 Wi-Fi header and below the DHT sensor head here in the API string type you need to write the write API key hope your thing speak Channel you will find the right API key in the API key tab of your channel like this you need to copy paste it to the program below you need to write the Wi-Fi name in which you want to connect your nodemc board and Below you need to write the password of that Wi-Fi now I have defined the thing speak server address here I have defined the Wi-Fi client and the DST variable in which I have passed the D2 and DHT sensor type as dst11 if you are using dst21 or dst22 sensor then you need to change it here I have taken Hume and temp as float variable to store the humidity and temperature that we are going to fetch from the DHD sensor no requirement of this variable in the setup function I have begun the serial monitor at 9600 board rate and then begin the DHT sensor I begin the Wi-Fi with the SSID and password that we defined at the top of the program so that it will connect with the Wi-Fi or 40 spot while it will not connect to the Wi-Fi it will print the dot symbol in the serial monitor once it's connected to the Wi-Fi it will print the message Wi-Fi connected to the serial monitor in the loop function we call the DHT data function in which I have read the humidity and temperature from the DHT sensor we have defined this function Below in the programming board and if our board is connected to the working spec server then we will call the forward to thinkspeak function in which we have written the command to send data to the thing speak server we also Define this function Below in the code once we post all the data to the thing speak server we stop the client using this command here is the DHT data function inside we read the humidity and temperature and store it in the Hem and temp variable and in the forward 2 thing speak function we Define the string as post Str and all the API key that we have defined at the top of this program then we add the field one and then humidity after it fill 2 and then temperature if you want to add more data for other sensor then you need to Define all in the same pattern right so we have now complete string with API key then field one and field 2 with data then these are the complete commands to send the data to the thing is pixel remember guys this is essential while you are sending the data to any Cloud then first send the total length of the string that we are going to post to the server like this after it we send out data through post HDR I have also serially printed all the data so that you can see the data in the serial monitor so this is our complete program now connect your nodemc board to the computer change your program credentials like write API key Wi-Fi name and password select your Wi-Fi board go to the tools tab in the board section select the board as node MCU 1.0 esp12e module for this node MCU board must be installed in the Arduino ID if you don't know about it or have not installed it then a link is available in the video description to guide you how to install you also need to select the port go to the tools tab in the Arduino ID in the port section select the port as com file if you don't know or don't find the comfort then the link is available in the video description that will guide you how to install and troubleshoot the com port now click on the upload button to write the program to the node MCU board it will take little time to upload the program as you can see the program has been uploaded to my Wi-Fi port now time for the live demo open the serial monitor and also the private or public view of your thing speak Channel still there is no data in the field one and field 2. but our board is pushing data to the thing speak you can see in the serial monitor and yes we have got one data as you can see here humidity is 37 and temperature is 30.7 in my room actually the room heater is hitting my rooms so the temperature is high there is 15 to 20 second latency in the thinkspeak server to display the data once means you will get your data in the thinkspeak server in every 15 to 20 second only and you can't do it fast in any way so again we will wait for the next data as you can see we code another data in the fields you can also verify the data with a Serial monitor we also got the our third data in the field foreign speak Channel you can also download the data in the CSV format so that you can utilize the live data in your research so click on the data import export below you will find the exporter so click on the download button to download the recent data of your Channel as you can see the data file has been downloaded click to open it you can see it's open with the Excel document you can see all the data of field one and fill 2 with date and time so guys this is how you can post any data through thing speak like I do in the video you can also see the thing speak data to the mobile app by downloading the third party app named thing View you can see my old video for this link is available in the video description if you want any kind of help in your board customization or in your projects so thanks for watching please like And subscribe to my channel and videos stay connected for more innovation
Info
Channel: SME Dehradun
Views: 5,939
Rating: undefined out of 5
Keywords: Real-time monitoring, Temperature monitoring, Humidity monitoring, Data logging, Cloud-based platform, Internet of Things, DIY, Tutorial, Step-by-step guide, Electronics Engineering, Maker, Data visualization, Analytics, Sensor data, dht11
Id: fMZ8NZ1Ksow
Channel Id: undefined
Length: 14min 24sec (864 seconds)
Published: Tue Feb 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.