ThingSpeak IoT portal | MATLAB visualisations on cloud | Publish DHT11 sensor data with ESP32

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to my electronics Channel so in today's video we are going to talk about the thinkspeak iot cloud-based portal okay so as you see here I'm using a thingspeak channel to publish all my sensor readings from an iot device and display as a visualization into this thingspeak portal okay so the thinkspeak as you know is a cloud-based iot dashboard which is capable of showing any remote sensing readings from various devices across the world into a widget or a visualization and you can see a various kind of real-time visualization from various sensor readings okay so it has capability to publish as channels and it has a private Channel as well as public Channel you can create some kind of a private view for your channels or you can have a channel which is for the public view everybody in the world can see as long as they have this URL accessible to them okay the thinkspeak also has multiple apps and connectivity to various applications so it comes integrated with Matlab capability or your Matlab signal processing and visualization capability so once you provide the various sensor data to it it will be able to analyze it like create 2D or 3D plots or maybe bar chart pie chart histogram kind of visualization and you can represent those data or your sensor data into more like a graphical or a visual representation for easy analysis understanding as well as decision making so in this like new era of the industry 4.0 where you have like like sensors and the data captured from various sensors across your devices published through iot or your like various kind of data like analysis tools once you are capable of seeing them visualizing them you can make various decisions to take forward as to or you can apply various rules and functional logic to it okay so multiple applications are available which can integrate to this thing speak so it can also connect directly to various iot devices with the help of either HTTP or like mqtt protocols with the help of which you can publish events or like various kind of messages to the things speak as well as you can subscribe to it so both pops up kind of a mechanism can happen okay so in this example what I have done here is I have used an esp32 microcontroller to connect to the internet and a dht11 sensor which is capable of capturing temperature and humidity readings and I have published those messages at an interval of one minute which is 60 Seconds from the from my my devices which is the dht11 sensor readings directly into this the thinkspeak portal so that you can show more like a real time visualization of the data as various gadgets like on this portal okay so I'll quickly like refresh the screen to see where it stands at the moment so as you see here at certain points before 9 pm I shut down my my esp32 controller like device so it wasn't having any data from before 9 till 11. so after around say 11 17 it has started to to capture they did the data once again and the temperature is gradually increasing by 0.1 the same thing happened for the the dht11 humidity readings so just before like nine around 8 58 30 I shut down the device and then I again turned it down around like 11 18 PM from since then it is capturing all the data so thinkspeak is is providing you various like channels it can have a private view it can have a public view you can have multiple widgets added to it so I have added two new widgets one is to capture the current temperature in degree Centigrade so if you see here uh 20.6 degrees is the the internal room temperature here in Southampton so it is able to capture the data here and I've used this temperature gauge to showcase the current indicator as a meter okay the same thing I have used for the current humidity the values and if you see here all these are very much configurable so each so each of these things speak channel the free version of it is capable of capturing eight uh fields at a total I so I have used only two Fields one is to capture the temperature other is for the humidity so I am mapping the field one into the temperature I'm setting a mean and a max value of 0 and 40. and I will be showing the value over here it's at the bottom of the gauge the units at degree Centigrade as you can see here and I've used some kind of a color coding to display the various range of values so for instance 0 to 10 degrees is sky blue 10 to 20 degrees green then 30 to 40 is red and so on okay so based on these color coding this is where it comes up okay if the temperature recorded is say 9 degrees it will be below somewhere in between 0 to 10 in this range the same kind of uh the visualization I have added on this humidity gauge so if you see here it is mapped to feed 2 which is my humidity data from the sensor the mean value and the max value are 0 and 100 because I mean it's a humidity and it cannot uh range Beyond 100 degrees or the percentage or that it's a hundred percent so I'm showing the value here and the units are percentage and I have just added one tick interval to indicate the various like 60 70 80 90 degrees all those kind of percentages and one some kind of a like logical color coding say if the humidity percentage is beyond 90 it will be red so if you see here that's how the the gauge is being like rendered on the screen apart from this apart from these gauges there are some other uh like 2D line plots as well as 3D line plus which is being used by Matlab for instance I have used the studio line plot to capture various time uh the time based data you can actually show real-time data over here and also the channel location so every channel in things Peak can have a particular location where it is like capturing the data so I have used the the latitude longitude of Southampton to indicate where the channel is located okay so that's how a particular things speak a public channel it's been configured so as you see here we have some some API keys so we have a right API key and a read API key this is used to post the data from any applications or any kind of code into this channel so whenever I will be using the the esp32 to post my sensor readings into this cloud-based portal I have to use the write API key okay so let's quickly go to the the code okay so if you see here I have used the dht11 as a temperature and humidity sensor and one one esp32 microcontroller to capture uh the data and then transmit via the Wi-Fi okay so so as usual SSID and password this will be your uh the router the SSID name and your password so I'm using the DHT pin number four of the esp32 uh and similarly all other configurations ah so this is the right API key which I will say will be using so now currently I have only one channel in the thinkspeak that is why my channel number is one if you had multiple channels you have to set the channel number accordingly so this is the same key which I have been configured in the the thinkspeak channel so I will be using this key to post the data okay uh the channel will be the the channel will receive the data at any interval of one minute so I have to specify uh like 60 000 my milliseconds here so two uh the floating Point variables temperature and humidity are being used here standard kind of setup code the dht.begin to initialize my dst11 the temperature and humidity sensor the Wi-Fi mode and then because this thing speak library is being used I have to set the begin method as well uh I'll do the read temperature call so like the sd11 has an API to capture the temperature it's one for the humidity I've captured these two here and then finally so you have to set the field so as I mentioned here on my channel I have two fields which has been used one is the temperature other is the the humidity so I am just setting the field and then finally I am writing the field onto the channel it's with the help of my right API key okay so that's so primarily that's the code and once you get the channel update successful based on your the return code being HTTP 200 okay otherwise it will say there's a problem in the updating the channel so very simple code like mostly like like anybody who is familiar with the rest API uh and so they will be able to understand how a publishing and subscriber model works so as you see here on the serial monitor concern some of the data has been captured here temperature and the humidity as well as channel that has been successfully done so very simple code here and you can use it to to sense any of your like devices or maybe a robot or even like any kind of uh I mean like sensor readings into your thinkspeak portal okay so the benefit will be whenever you are not at home or like not at the road like lab you can remotely monitor the sensor readings from any devices be it a machine or a smart home device or even a I mean a robot which is capable of multiple sensors into your web based portal so a very interesting I mean a cloud-based portal with Matlab visualizations to capture your data okay I think it's very useful okay I will want to to Showcase one small example where you can see so as you see here uh so we are able to see that the temperature reading and the humidity rating so what I'll do here is so I'll quickly capture the so I'll quickly like increase the temperature of the sensor by slightly like blowing into it and see if the temperature and the humidity increase ah oh so at an interval of one sec of one minute it will be able to capture now just that I have like increased the the temperature it should start reflecting the value over here okay so we'll just wait for some interval and then we should see some spikes going in onto the temperature yeah okay so guys if you see here so we have one Spike here where the temperature has increased to 21.7 degrees okay and the humidity has increased to 94 percent okay so earlier the value was like 20.6 degrees and there's a big spike in the temperature range because I have blowed some hot air into the sensor the same has happened to the the humidity readings earlier it was 74 humidity right now it has jumped up to 94 percent okay because of the hot air being blown into it so it is like near real time and if we wait for a I mean a mini torso we should see some kind of a spike down as well because I've stopped blowing here so it should gradually come down okay so so that is the way uh we can use the things Peak as a sensor uh liquid being captured so if you notice here the second reading has also arrived it has now jumped down to 21.1 and the humidity has also Fallen to 82 percent from 94 okay so from from 94 percent it is now right now into like 74 almost okay so so I hope you like the video so if you uh so if you found it interesting please hit like And subscribe to my channel and and thank you so much for watching thanks bye
Info
Channel: Koushik's Digilab
Views: 3,805
Rating: undefined out of 5
Keywords: Koushik's Digilab, IoT, ESP32, digilab, electronics, hobby electronics, internet of things, ThingSpeak, ThingSpeak IoT Cloud, DHT11 sensor, Temperatur & Humidity, IoT Cloud, IoT Dashboard, IoT portal, IoT Analytics, MATLAB, MATLAB visualisations, Mathworks, MATLAB plot
Id: ZPiCItmddsY
Channel Id: undefined
Length: 13min 18sec (798 seconds)
Published: Mon Dec 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.