 This here is a water level sensor. You stick it in water and as the water gets higher or lower you can track that level and put it into your computer and do things with it. For example, if I took the sensor and stuck it in this bowl of water, as I move up and down I can track the level of the water and let's say when the water gets low I can notify the computer and tell it to turn on an LED that's or a screen or an alarm or whatever to notify me that the water is low. The way it works is it has these power pins power bars across from the top to the bottom and then it has also ground bars as you know power flows through the power line to the ground line and creates a circuit. As there is more water touching the sensor water is conductive allowing more electricity to flow through the circuit lowering the resistance because air isn't very conductive and electricity doesn't flow well in air thankfully the more air there is touching the sensor the more resistance there will be. So using that the more water there is the less resistance there are going to be so as the electricity gets stronger and stronger and stronger we know there is more water contact and we can up the value so if there was no water touching this at all it would have barely any electricity flow maybe just a little bit through like the water droplets that are left here but not much. Now there is a billion different water sensors water level sensors this is the one we're using there's also a bunch of other water sensors that you might have seen there's the ones where it's just a tube and it has a ball inside usually a metal ball and it floats in the water and then there's a magnetic switch here and when the ball reaches the magnetic switch it triggers it to do something or there's the ones in toilets where it sits in the part of the toilet bowl you know the one right here and the way it works is it usually has like an arm and some rubber floaty thing here and as this thing goes up and down it triggers a switch that tells you there's enough water in the toilet to flush and then when you push the plunger down or whatever you want to call it it flushes if there's enough water according to the switch. Here's what you're going to need you're going to need your water level sensor you're going to need three cables i went with red black and yellow these are male to female and then you're going to need an arduino take your cables and plug them into the right port so we're going to go red into five volt which is right here black into ground as always and then yellow is going to go into a zero we're going to want an analog port not a digital port analog ports give more detail in the description where digital ports is just a higher low one or zero then we're going to go and plug in yellow into s as you can see on the sensor it says s plus and minus so red is going to go into plus because red is always positive and then black is going to plug into negative now you're ready to go and now you can see a red light on it meaning you have power we're going to do the testing on this actual water bowl it's about half filled with water and as we stick the temperature sensor in or out we'll see the values go up and down now as always open up your arduino editor make sure that you are on the right board so go to port make sure your port is the one with the arduino in it make sure you choose the right board i'm using an arduino uno so i'm going to choose arduino once that's set up you're going to see set up and loop set up is the things you do right before the application starts and loop is while the application is running before set up we have a couple things we need to do the first thing is we're going to have to declare the port where the water sensor is plugged in that's going to be a zero right under that you're going to add int value and this is where we're going to hold the level of water and set up as always you have to set up your console so we're going to go serial dot begin and put a number in here i usually go 9600 in your loop you're going to have to set that value equal to analog if you were using a digital sensor you would just do digital read it's pretty simple and then in here we're going to put read which is our a zero sensor under that we're going to do a bit of a big if statement so i'm just going to write it out and then i'll explain it to you guys all right so this if statement what we're saying is if the value is under 300 print out empty if it's between 300 and 500 then it's low it's if it's between 500 and 600 it's medium and then anything over 600 is high these values don't really matter i kind of made them up just out of testing it out and seeing what makes sense to me you can really change just anything you want you don't have to make it empty low you can actually like measure the the distance of the water on the temperature sensor like how much is this this is one centimeter whatever and then you can have it equal in the computer to one centimeter and actually have like a descriptive number but i'm not doing that i'm just saying hey is there water in the bowl or is there no water or is there a lot of water in the bowl just figuring that out then you're going to put a delay this can be whatever you want i like to put low numbers so i can get constant updates but you can make this 10 seconds you can make the one second it doesn't really matter now all you got to do is compile it make sure you have no errors everything looks good we're going to upload it let's take our temperature sensor we're going to have to first go into tools serial monitor and when you open that you'll see it's printing out empty a bunch of times because nothing is touching my sensor i want to take my sensor and slowly insert it into the water as i'm putting it into the water you can see it going between medium low high just jumping around as i'm pulling it out it's going to low empty medium and right at the bottom it's gonna hit high there we go i'm just gonna rest it here usually you would have it like secured onto the side of the bowl for accurate reading but i'm just gonna have it loose so now what's happening as i explained earlier is those power pins and ground pins are letting electricity flow to the water so there's actually electricity right now flowing through the water it's a very small number it wouldn't hurt me but it's something to know the more water there is the more electricity is going to flow through the water and touch the ground pin so actually right here where the pins are there's electricity going between these now if i pull it out air is just not as conductive as water it's actually not very conductive at all so it's not going to let electricity just freely flow between the pins now when i lower it back into the water you'll see it goes medium when i pull it out you see it goes low once it dries it goes full empty low is usually when there's a bit of residue left like you see low low low low low i'm gonna shake it a bit i'm gonna tap it on the bowl and now it goes back down to empty now let's take this one step further i went on to tinkercad now while i don't actually have the time to go in 3d print this and put it all in a video i'm going to show you guys what i'm actually gonna do this is a design for uh what's gonna fit around a dog bowl i'll show you the dog bowl in a second this is where the temperature sensor is gonna go then i'm gonna have a battery and an Arduino tucked in here and then the cap is just going to close it all together making it waterproof and it's going to stick inside the dog water bowl and then using this and a couple other things like a led and a buzzer i'll be able to make myself a module to let me know when the dog bowl is out of water and then i should refill it here's the more complex setup i have the dog bowl here with the water temperature sensor inside of it i have a buzzer here that's going to make a really annoying sound when there's no water and then i also have an led on the board that i didn't really wire up it's going to stuck it in there if you look at the code here what's going to happen is we have a buzzer an led we declare those that they're outputs and then down here we go and have a really annoying and complicated statement that pretty much says hey if water is empty beep and buzz like crazy if it's low just kind of tell me and then if it's medium or high we're good to go now when i plug it in you're going to hear the super annoying sound it's going to go nuts so what we're going to do is just get some water here i don't know if this is actually going to be enough i'm just going to pour it into the bowl it's still too low so i'm just going to try and find some more water in my room so i'm not sure exactly what happened but if you let me focus this if you look close at the sensor something happened and a bunch of it burnt and uh thankfully it was in water so fire wasn't going to be a problem but guess this is a really faulty sensor so luckily i have a second one we're just going to plug this one in and use this one all right so i fixed it the sensor something was wrong with it we're going to throw that one out we're going to use this one right now so right now you can see it's printing out right now you can see it's printing out high because we're pretty deep in the bowl right now and there's actually a shit ton of water in the bowl but as i remove the sensor it's going to start dropping down just like earlier but this time it's going to freak out and beep and scream at me depending on the water level so right now it's kind of chilling out right here just one beep once in a while and as it empties later on i'm going to 3d print that piece it's going to fit right around this bowl it's going to have a battery and everything's going to be integrated and then it's going to be able to tell me if there's water or not i actually put a lot of work into these videos to try and be descriptive but also fun so if you do enjoy them if you learn something maybe leave it a like subscribe to the channel i'm going to be bringing a bunch more of these videos up on the channel and if there's any sensors you'd like to see please let me know in the comments see you in the next one