How to display soil moisture data data with thingspeak #thingspeak #esp8266

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey yo today I'm excited because I'm in the field and we're gonna make a little project that's gonna help us keep track of the soy moisture of any field and visualize it over the internet using things so if I get closer right here you can see we got some a little strawberries going on and there's a sensor that is located inside the soil so this is connected to um this sensor is connected to the PC right here and as you can see you can see that the system is telling us that the level of the soil or maybe the level of the the water in the soil is 37 and [Music] here you can see a green I mean I'm in a red I'm a red light that shows us that the plant needs watering all right so let me go ahead and bring um and bring a jar of water and try to water this thing and see if there's a change that's going on right there so this is the project we're making today so let me go and take this thing right here I'll come and a lot of my plants just like that so now we need to go ahead and check in the dashboard to see if really the values has changed as we water as we water these plants all right so um it's kind of hard to hold the camera and do all these activities but yeah that's how it is all right so now let's go back to the screen right here you can see that now the level of the water is a hundred percent and the red light has turned off so this is the project that we're making today using things the thinkspeak is an iot platform analytic service that allows you to aggregate visualize and analyze live data streams on the cloud and it's free it's not totally free but you know some of its services are free but limited so um now let's see the hookups of of the circuit that we're going to use this is the easiest circuit you ever do because it's just one Sensor One microcontroller and that and of course One dashboard so of course we have the did not MCU we also have these moisture sensors this is the level moisture sensor and you can see on the screen we're going to show how these things are hooked up because you can't see it on the camera so um you're gonna take the ground the ground on the moisture sensor and try to find it the ground on the nodemcu just like that so now let's say that this is the G and oops let me just do this so now you're also gonna take the VCC let's suppose the VCC is this one and put it on the three volt right there all right so now the the the other one is going to be the a0 you're gonna have to hook it up onto the a0 just like that now you need to make sure that you have a Wi-Fi access Wi-Fi network in your home and these we assume we have it already now um if you never use things things speak before I want you to go back and look at a video that I back then that I made using thinkspeak because that's where I explain more than in this video because this one is going to just be video for those who ever used thinkspeak before but don't worry you can hook up with this one if you never ever use the thanksg2 so let's now go to the Arduino IDE the reason why I'm saying that is I'm not gonna start hardcoding everything that is related to pushing data into thinkspeak all right we already have this all we're gonna do is configure these moisture sensors so that it tells us the level of the water in the soil so the next thing I need you to do is to go here onto things Peak you can if you have an account you need to log in I already logged in into mine so the thing you're gonna do here first is to create a visualizer for the sensor so I'm gonna go here and click on new channel then I'm gonna call my channel plant thetas all right plant status so because the readings from this sensor is just you know the level of the soil I'm gonna need one field all right and I think everything here is uh optional at least for this video so the next thing I'm gonna do here is to save so um I don't need this visualizer I'm gonna hide it then I'm gonna click here add widget so we need this visualizer as you've seen in the video in the presentation video so I'm going to click on this one click next so um what do I need to call it I need to call it um let's say level because level of water all right in the soil then we can go down here so they're asking us for the update interval it's just 15 seconds you can't go below it units I'm going to say percent do any decimals I don't need it right now then I'm going to click ok so you're going to see that for the moment it is saying that field value unavailable that's just because we've never pushed anything from this circuit here into the car the thing speak so now um the the other thing I'm gonna add is uh something like um a light that is going to be red when the the soil needs to be um watered and not no color when nothing is needed when the water level is fine so I'm gonna go ahead and do add again I'm going to click on lamp indicator next now I'm gonna call it indicator in the indicator all right now yes of course it is corresponding to the field one okay it only shows field one right here because we only made one widget already so now when do we need it to turn to change the color we needed to change the color when the the level is less than all right lever is less than 50. so because maybe we can say that when the level of the water is like 50 that's just fine when it goes below it's going to be a problem so we need the color to be red and create so you can see that as well this one doesn't have any value so we're going to push this value through the things big now what are we going to do right here the next important thing to check here is uh scroll a little above and go to API so the API that we need right here is the right because I'm gonna copy it because we need this node MCU readings to be sent sent to the things Peak so I'm gonna go here the first thing to specify is the API I copied the um this one the right then pasted it into here I'll leave the links in the description and now the SS ID this is my Wi-Fi so my Wi-Fi is one on one and I'm gonna type in the password for it and of course I'm gonna leave everything blank right here so now let's go ahead and code these level moisture signs all right so I lift it up now I'm gonna say int let's call it sensor then I'm gonna put it into a0 as we agreed 0 just like that now I'm gonna look for the void setup don't touch anything right here right here now I'm gonna say pin mode pin mode so because we need to specify that that a0 is just a sensor so how do we say that we're going to say that a zero no I mean sensor is an input all right just like that then I'm gonna go down here into the void Loop now because we're gonna do something that is you know detecting the level of the water in the soil when we put the sensor in now the thing I'm gonna do is uh go back and declare a value that is going to hold the readings of the sensor so I'm going to say I'm going to call it um value just like that and by starting it is just value no no no where you added so I'm gonna go down here now what's the void Loop yeah inside the void Loop right here so I'm going to say that our value now is equal to analog hello greed all right now what are we reading we're reading this sense all right so we used analog because we put this sensor into the analog pin now the next thing to do is to map the analog readings of this sensor into a certain value in certain range that range is between a hundred and one 1023 because the highest value of an analog is 1023. if I am not wrong all right so if I'm wrong you can you know leave that in the comments and maybe tell me what's right right so um so how do we do that we're going to say value is equal to use a keyword code constraint constraints strain that then we're going to you know keep the range I'm going to say that the value is in range 400 and 1023 all right just like that now we need to round these values we need to round these values on a hundred and zero hundred percent and zero so how do we do that we're going to do it again oops value is going to be equal to map all right so what are we mapping now we're mapping the value so we need 100 and 1023 to be mapped to zero to a hundred and zero all right so this means we're turning these Val these analog values into values that corresponds to uh from zero to a hundred percent so I think this is it the next thing we need to do right here you need to consider this thing right here so this is where we sand we send a value if we push a value into our Cayenne our thing speak oops I'm sorry so um the thing here I'm so now you can see that it is titled field it is named field because here in our thinkspeak dashboard this one which is going to receive the value is the things Peak I mean yeah is um this one right here is called field one all right so we need to push data into the field one so here I'm gonna add our value like that then I'm gonna go down here a little here here on the display this is where I'm going to display cereal dot print line so what am I gonna say I'm gonna say that I'm gonna say that the soil soil moisture is that then down here I'm gonna say cereal print line then then I'm gonna add our Valley just just like that so um you can see that right here we're just delaying sending data so the first thing I need to check is to do a compiling stuff to see if there's no errors oh this thing takes quite a time so we need to wait a little the empire Shazam nothing is wrong now the next thing is to check if really um huh it is connected the port is connected I chose the right board now the next step is to hit upload and I'm crossing my finger to make sure that it works otherwise you would just take me for a fool and that's not what I want I want things to you know to work well all right yeah uh so uh I think this might not be a big problem because we already done this unless we get a network problem or anything so you can see that now it's uploading uploading uploading 23 30. 38. 6 I like this 53 61. 6 to nine why is it so slow 26 84 92 bam now let's go to the serial monitor you can see that it's just connected to the Wi-Fi and it is sending the value one waiting 20 seconds let's go into our thanks Peak and see if there's values oops oh wow so you can see that the one percent that we're seeing into the into right here into the um serial monitor is the one that is being displayed into our thinkspeak field and here it is red just because one will not just be a good value for soil so let me go ahead and put this thing here into the soil like that let's see if some some values changes uh changed all right so nothing is changing so maybe let me just add some water there to see if it's changed uh let me grab a water all right let's pour in some water and see if anything changes but now I'm gonna go um here let's add some water into the soil so let's just wait a little is anything changing let's see what we have in the serial monitor we have A6 so maybe there's a problem with the internet reload let me just reset this thing uh so now you can see that as we added some you know some water the level here is 8 is 83 and the lamp just turned off all right so bam this is how we do this thing and if you like this video please give it a like subscribe or maybe a comment if there's anything you need to tell us and of course the next thing to do right here is to take to grab these things this activity that you've just done and put it in your field and test it for yourself so now until next time peace
Info
Channel: Idukunda Lengo
Views: 2,323
Rating: undefined out of 5
Keywords:
Id: IRQw6isPdF8
Channel Id: undefined
Length: 18min 38sec (1118 seconds)
Published: Wed Jan 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.