Sensor Monitoring using Blynk Mobile App and NodeMCU ESP8266

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's learn how to read and monitor temperature sensor data using blink web dashboard and the blink mobile app as you can see if i start rubbing the sensor then the temperature goes up and as i stop rubbing the sensor the temperature goes down if you have not watched the previous blink video lesson on binary updates then please go ahead and watch that video the link is given in a youtube video description that will clear up your basics about how to use blink web dashboard and mobile app and then you will be ready to go ahead and watch this video and complete the project this video is sponsored by altium designer world's leading pcb design software company if you want to take your idea from a breadboard to an actual professional looking circuit board just like any other electronics product you must give it a try it's a free check the link in the video description to get your first hand experience and i'm sure you will enjoy working with it so we will head over to the template section here you can see in top left corner there's a templates so we'll click on a template and then we see our device is still here nodemcu so i will click on the device and then you see we have the nodemcu device and firmware configuration from our previous project and since we are modifying the same project same template we will be adding new functionality into the same device so we have to head over to the data stream here and we have to add one more data stream for a new temperature sensor lm35 that we want to connect to the nodemcu esp8266 so on our top right corner we have this edit button so we have to click on the edit and once we click on edit then we see in the top right corner there is a new data stream button so when we hover over the mouse cursor then we kind of see virtual pin options so we have to click on virtual pin and then we have to create a new uh data stream and virtual pin for temperature sensor so i will keep it the name as a temp for temperature and the color i would go with the blue that's what my favorite color is and the pin because we already have used the v0 pin for virtual pin 0 for the led now we have to choose v1 for the next uh sensor that we want to communicate with the blink web dashboard as well as mobile app so we have to select the v1 pin virtual pin one the data type we will select integer because to keep it simple uh we will send the integer uh value of a temperature in a degree celsius and unit uh we will keep it as a degree because we will send it the degree celsius the minimum value that we want to we expect is 0 and the maximum value will be 60 because in india it's never go more than 60 degree celsius and the default value will be 0 so when there is no data it will be zero and this looks little more sense i can scroll down and click on create in the lower right corner and the data stream temp is already created which reads the data temperature sensor data from v1 pin which basically resonates with a0 pin analog pin 0 that's where we have connected lm35 on node mcu or esp8266 now before we do anything even further we have to click save button on the top right corner so when we click on a save and then you see it says update one active device because we have made the changes in a running project because we are very warm from our previous project and that code is still running in the node mcu so we have to check this box update one active device and click on continue so the modification will be applied into the device or the firmware so now we have to head over to the web dashboard and in a web dashboard we have this one button from our previous uh project and we have to add the gauge so that we can visualize data uh temperature sensor data in more intuitive way so on the top right corner we have this edit button so we have to click on edit and then we have plenty of options here i would select get and i would put it here now to make it more beautiful i will put the led button on the top and put the gate right below it and then just resize it properly so that they will align and then in the gauge there is a little gear icon so i have to click on that to configure the gauge the title maybe i would just keep it simple temp for temperature data stream will be temp that's the v1 virtual pin one that's the data stream we created and the color i would prefer to stay with orange looks more intuitive and attractive and then just click on save in the lower right corner and you see the gauge um can be seen here and on our top right corner i will click on save and then the dashboard will be saved so it again asks me to update the device because from our previous project the nodemcu is still connected to the blink server so i have to check this box update one active device and click on continue and now the changes have been applied so i can just close this and you might see okay the temperature of 51 is not really what you expect i understand that because we have not yet written the arduino code and the temperature data can be seen under the search bar and into the device so if we go on a top left corner search then we can see our device got listed here so nodemcu d8570 so when we click on that now we have the temperature can be seen here right but still we have not yet written the real arduino code so we have to write an arduino code and then we can expect the real temperature data and we can even change and then we see if we make the temperature sensor a little bit more warm so if we rub the sensor then the temperature goes up and when we stop rubbing the sensor then the temperature goes down right so let's head over to the arduino code and then do the arduino programming for esp8266 so here is the arduino program from the previous lesson uh to control the led through the blink app as well as uh the blink web dashboard so i'm going to modify the same code rather you don't need to write all the code from scratch i have this github repository i have given the link in the video description of youtube or anywhere you're watching this video and you can click and come here so here's a project sensor monitoring with the blink and you see all the project file can be downloaded from here if you want you can download i can just choose this one i you know file okay and then you see here on the top right corner there is a there's a little button here which says copy raw content so i click that and i will explain the code in a while so i'm just control a delete and then i paste the new code right so this is the same code look at this this uh the template id and device name belongs to our same template that we worked on so if we go back to template and if we go to device so this is the uh the template id and the device name if you don't believe it i can just click here to copy and then i will just remove this and paste it here okay and now this belongs to our web dashboard and the mobile app that we are working on since our previous blink project and the new thing here in the project is we have created this uh integer variable temp because when we connect lm35 to the node mcu at a0 pin analog pin 0 then we have to store this temperature data in a variable so this temperature variable temp will hold the temperature data and then we have to write this one more line of code blink dot virtual right because the temperature value that is stored into the temp variable will be written onto the v1 pin which is basically a data stream through which we will going to write virtual right so we will write from the hardware device node mcu to the blink server okay that's why it's a virtual write and the stamp value of a temperature sensor will be written into the v1 data stream into the blink server and that's how it could update it onto the blink web dashboard as well as the blink mobile app and then if you scroll down a little bit then we have in the loop function we have this variable temp is equals to analog read a0 because that's where our lm35 temperature sensor is connected to and then we multiply this value coming from the sensor with 0.32 which basically converts the temperature data coming from a0 into degree celsius and this temperature value real life temperature sensor value will be stored into the variable temp and then it will got pushed into the temp variable value into the v1 data stream into the uh actual uh blink wave dashboard as well as mobile app so here we have node mcu with esp8266 microcontroller and we have to connect the lm35 which is an analog temperature sensor you can see this is a temperature sensor lm35 and i'm going to place on the breadboard something like this so you can clearly see all three licks of the temperature sensor and make sure the flat surface of the temperature sensor is facing towards us means towards the camera and the extreme left pin will be vcc that's going to connect to 3.3 volts the middle one will be an output of the m35 temperature sensor that will going to connect to a0 pin because lm35 is an analog temperature sensor and the extreme right most pin this one will going to connect to the ground so let me take the jumper wire as i said extreme left pin this one will going to connect to 3.3 volt to give the power to lm35 all right then the middle pin which is an output of the temperature sensor this one will going to connect to the a0 pin and here is the a0 pin on node mcu because uh lm35 is an analog temperature sensor and then we need another jumper wire extreme right pin of the temperature sensor and that will going to connect to the ground pin on the node mcu okay so that's how we're gonna connect lm35 with nodemcu that means esp8266 you can see all three pins of the lm35 so i hope you know that make sure the board is properly selected nodemcu 1.012e module and then the port will be selected com3 in my case in the top left corner there's an upload button so i will just click on update button and this basically upload the code onto the device and then we have to see whether um we could able to connect the node mcu with the blink server uh and then we have to go to mobile app and then we also have to make the necessary changes up there so the code is still writing and as you can see in a lower left corner it says done uploading now we have to go to tools and we have to open serial monitor and make sure the baud rate is 11 5200 if you are coming up from the previous lesson you might know already and then if you don't see anything on to the serial monitor then as you may remember we have to press the reset button our sd button on the node mcu so once you press the reset button then you see connecting to wi-fi binary updates that's basically the wi-fi that i have set up earlier in our previous lesson and now you can see it is already connected to the cloud and it is running fine so even before we go and make a mobile app we have to check whether at least the dashboard is working fine or not so we have to go to dashboard here and in the top left corner in the search icon we have the device listed here so we can click on the device and you can see right now here is the button i would just start with button first so if i press the button here so turn off the led on node mcu esp8266 i mean the built-in led will turn on and it turns on and turn off so it's working fine so the temperature value 25 is true now if you don't trust in me then i will start rubbing the sensor and probably you'll see in a moment look at this it's getting increased 27 and if i keep rubbing the sensors then maybe you can see the temperature value goes up look at this it's 31 now if i keep rubbing it will keep increasing even we have not yet done the mobile app part so the blink mobile app will customize in a moment just look at this so as long as i am rubbing the sensor the temperature goes up oh i forgot to tell you if you want to change this name you can change this name you can change the tag and other things so let's say if you want to do that so here you have node mcud8570 so click on this and click on edit and you can change the name i would just keep it binary updates dot com oh it doesn't take dot com so just keep it binary updates i'm okay with that i would choose my brand color and then save it and you see the name is changed right uh if you want to see much better bigger so close this oh my god click again and then click on this uh you know bigger view or full view or something and you can see now it looks a little more intuitive right at least i believe not sure so let's head over to the mobile app so here we have a mobile app from our previous project that we still have this template created so i can click on this template and you see we have the button which is from our previous lesson so if i press the button then you see the led on board led lights off when i press the button the onboard led lights up now we will going to modify the same uh template so on the top right corner you see this little icon here so when i click on this icon here and then we can get to see the the view where we can uh able to um add the widgets and it's basically called developer mode so on the top right corner there is an icon uh which looks like uh three horizontal sticks so if we click on that we can able to see the lot more option shows up so the one that we are looking for here into the mobile app is basically your gauge that we are interested in so i select the gauge uh select the gauge and put on a onto the workspace and i select the button here okay just hold uh for long time and then you can resize the button properly so they will look better and now we have the button this is led from the previous one that controls the led connected to uh gpio uh two pin and uh this is the gauge basically that reads the temperature data this lm35 temperature sensor which is connected to a 0 pin and then i'm going to just go back here so go back and let's click on this gauge so the setting get pops up so you see the setting pops up and in a title we will have to just say temp just give any random name that makes sense and the data stream will be temp because that's what we set up um [Music] for the v1 virtual pin we want and then we select the auto and then the color maybe take the orange because we have made it orange and once that looks fine you can click somewhere onto the screen and then go back and now you see the color comes up in the top left corner there's a back button when you click on the back you see again it says 25 degree celsius as a temperature and here is a button so if i rub the sensor as i said if i keep rubbing the sensor you see the temperature is increasing it's 26 now if i keep rubbing the flat surface of the temperature sensor maybe the value goes up somewhere maybe 30 or 35 or something like that you can look at this right now look at this it's 31 right now so it's increasing right and when i stop rubbing the sensor then it will come back to the normal temperature which is 25 as when we started it was 25 so it's dropping down to 30 from 31 and slowly it will goes down [Music] if you want we can create an external led as well to the d4 pin so you can see the both function works in the sequence so here goes the external led and now you can see the temperature is 29 it's slowly coming back to 25 but you can see the temperature is dropping down at the same time we can even control the led so both functions are working fine right the temperature will even drop further down to 26 25 i guess if you want to become an expert embedded engineer check out our website courses.binaryupdates.com for awesome high quality courses in the next video lesson we will learn how to use relay to control ac operated light bulb thanks for watching and bye bye for now
Info
Channel: BINARYUPDATES
Views: 31,402
Rating: undefined out of 5
Keywords: blynk, sensor, monitoring, mobile, app
Id: _kywwUFH3Pc
Channel Id: undefined
Length: 18min 45sec (1125 seconds)
Published: Tue Dec 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.