 This is a peristaltic pump and in this video I show you how to use an Arduino to control it all while we build this test rig for future videos Where we're gonna test water level sensors So in this video, I will show you how this pump works on its own How to control it with code with an Arduino and how to make a switch to reverse the polarity So if I put it here It'll suck water out of this cup that it's been putting water into and bring it back into the main cup And all I need you to do is give this video a like and subscribe to the channel if you enjoy this type of content Recently I figured out that 95% of you aren't subscribed to this channel and you're watching videos It doesn't cost you anything and it helps me out a ton So as I said before these peristaltic pumps squeeze a tube and force the liquid into a direction By causing waves in the tube these waves cause directional pressure and a vacuum on the back end Just like at a beach with waves that come crashing down They come and they push everything towards the end of the beach And then when there's no more water they go back and suck it all in kind of like a curtain The nice thing about these peristaltic pumps is that there's no chance of contaminating whatever's in the tubes Because all the mechanisms that cause this pump to work are outside the tube So they're really popular in medical fields in foods In dangerous chemicals because the actual mechanism has no contact with the chemical inside the tube It only has those rolling wheels when you turn them like this It's kind of hard to do with your fingers When you turn it like that you could see this one right here is just going around and squeezing the tube As it comes around in either direction But there's actually no contact with the liquid I could just take this out Take the tube out and it's still the whole the whole tube system is still intact regardless of this pump So it's kind of like an add-on. It's also extremely easy to do maintenance on like if you need a new motor Just take this out and then put a new one onto these two pieces and actually goes together like this That clicks in there That clicks in there and then that's it those three pieces now made me a pump That will not contaminate the liquids usually in these type of videos we take an arduino We connect it to whatever we're reviewing we make it work and that's it But in this video, this is actually going to be a project for the next five videos on the channel What we need to do is make this arduino and this pump pump water it in out of a big container like this And then we have all these different types of water sensors that we're going to review in each video individually And we're going to use this rig to test them So the goal would be that with arduino and the pump we put the water into the container until the level sensor says the water is too High and then we cut the water Uh, you know, we cut the pump off So all we really need to do is put water in and out of this container We're going to need to reverse the direction of this pump and we're going to do that all within arduino If you want to actually copy this build You're going to need a relay to use the arduino to control the pump and then i'm going to be using this Rocker switch to control the direction of the pump So for example, this could be left and this can be right and this could be like an emergency shutoff in the middle So the arduino will plug into the relay the relay will plug into the rocker switch The rocker switch will plug into the pump and then the pump will pump liquid in and out of our big Trainer here and we're going to need a water source which will most likely just be a cup on the side of the screen That you can't see filled with water. Oh, you're also going to need some tubing Now since this uses water and I have a computer right here off screen. I'm going to be using this little I don't know what to call it like lunch tray Just to make sure you don't get liquid on the computer You're also going to need a power supply for your water pump in this case This water pump is a 12 volt dc water pump where at least the motor is so I have here a power supply I think I took off of an old laptop It's 12 volts 2 m's which is going to be perfect for what we're doing. So first off, let's build it out on the board here Let's connect all the cables all the tubing and everything and then we'll go and actually write the code to control it all So to keep this organized. I'm just going to start heart gluing stuff to this Lunch tray just to try and get it Kind of clean So there's our Arduino board It's going to need some more glue for sure I'm not going to glue the rocker switch yet because we are going to have to Sotter up these pins in the back before we glue it down so we can you know control the directions So for now, I'm just going to place it right there. But these two look good And then same thing with our pump. We have not finished yet with connecting everything So I think we're just going to wait out on that For a little bit. I don't want to spend too much time in this video showing you how I made this reversible switch So I'm going to keep that for another video in the series But for now I'm going to put a picture up on the screen if you want to follow along to do it yourself And then on the right I'm going to put a picture of what it looked like when it was finished All right, so now we're done with the switch. Let's connect it up to this dc motor It's got this one on the right here with that little red dot tagged as positive And this pin is going to have to be negative So I'm going to grab some cables from my trusty box over here So I'm just going to grab these two cables here and make those connectable for the water pump All we have to do is repeat the process of Stripping them down twisting them up Sticking them through these pins just like this And that's what it should look like Then just go and repeat the same thing for the other side All right, so back to the test rig we go. You're going to need your hot glue gun Your newly soldered h-bridge reversing polarity switch whatever you want to call it and your water pump Just to be safe, I'm going to put my water pump inside this little tool container It's not going to stop a massive leak because we're going to be working with way more water than can fit in here But at least if I see a little water leakage or won't leak over to my electronics or to my power supply That's connected to the wall or my laptop. I'll just be able to unplug everything and Take care of that leak issue. So first thing I'm going to do Is just get some glue And then get that down onto our board Now we're going to take our water pump going to lightly glue it I don't need anything crazy because it probably will come off at least once get some glue where those bolt holes are And then I'm just going to do this We need a good amount of glue because I will be pushing this switch a lot And then motor side will go to the motor And relay side will go to the relay just like this I don't want to touch the hot glue with my fingers. So I'm just going to scrape it off with this All right, so we have our do we know we have our relay We have our polarity switch or h-bridge switch whatever you want to call it And then we have our pump the pump connects directly into these two cables coming from the h-bridge switch Then on our h-bridge switch, we have our power supply, which is going to be our relay We're going to plug in our positive terminal from our switch To our relay now this is going to be the the one thing we really really really don't want to get wet So this right here we just cleaned up here Is our negative from the power supply or 12 volt power supply that's going to go directly into the polarity switch Now this is going to plug into the middle Port which has co-m on it. So now we have our positive and negative from the power supply connected to our relay and to our switch Which both go into our pump Our relay isn't connected to the Arduino so we could do that but first Let's just clean up this cables for that. We're going to need three different cables We're going to need a black cable to go to the minus And that black cable will be going to ground on the Arduino Then we need another cable. I'm just going to use brown to our plus on Arduino Which is going to be a five volt supply And then we're going to need another colored cable, which I'm just going to use green That goes on to s and s is for signal And we'll do signal on three Three on the Arduino board now that we have our rig built out We have our Arduino connected to a relay our relay connected to a power supply Which then interrupts that power supply to a switch, which allows us to reverse the direction of the motor So we'll do one side will be to pump water into the into the big box right here Then one side will be to pull water out and then eventually in each specific video The Arduino will be connected to a different type of level sensor Like let's say we're using this big float sensor And when the sensor detects that the water level has reached the highest it should be It'll tell the Arduino and that pump should shut off. That's the goal of what the videos will be And that's why we built this whole test bench So let's connect the Arduino board to our computer and then write some code to make this pump work When you upload this code I put up on the screen right here The relay is going to flash a light and make a loud click for one second And then it's going to turn off and repeat over and over there we go There's that light on and off. So I just changed up the code I'm going to have it initially turn off for a second Then I want it to turn on for one second and then turn off for five and repeat So that's one second on one two three four five Back on for one and then repeat. So I'm just going to Comment this out and upload it to the board. So only this code runs right here So the relay should stay off We're going to uncomment that. So I'm just going to plug in the power supply into the wall No sparks no smoking. I think we're good I don't feel any heat. Now let's upload this code to the Arduino and see if it does what it's supposed to do Now it's off for five seconds and then the motor should turn on for one second Now that we know that it works and it's not burning up Let's change that five seconds to one second and let's repeat the process I don't know if you can hear this so I'm just going to move the microphone All right, so we actually got this working if you put it in the middle switch here It's going to stop the motor from working and if you put it in this one it will turn the motor the other direction I'm just feeling it to see if it's hot. It seems like we're good Now the motor is back in an emergency off. I guess you can call it But if you put it in here, it's one direction put in here. It's the other Let's plug our pump into some tubes get those tubes into a cup of water And maybe another cup to dump the water in and then let's see if this thing actually works We know we can activate it But we haven't figured out yet if we can make it do what we're trying to do And hopefully it will not make a big mess and fry everything So let's go over this one more time. Arduino goes into relay relay controls a power supply Which goes to a reversing switch to reverse the motor in and out So that water can be sucked out of the cup or put into the cup And then That's pretty much it So i'm just going to run the code that turns the water on and off And i'm going to put it five seconds on and then five or we'll do five seconds on two seconds off All right, so we're we're getting bubbles in this cup right here, which means we're trying to push out this way Now it should start sucking water. There it is It's going down the tube. It's stuck right here Keep going It's in our pump For some reason there's red stuff in our pump. That's pretty cool And now our cup our little mug here is filling up with water Well, that's it for this video in the next couple videos We're going to take water level sensors like this one right here where it has a ball on a long stick And as the water level rises the ball will rise with the water level telling us where the water is We're going to use sensors like these inside of water containers And then we're going to use this system to bring the water level up until the sensor tells us It's enough or until it overflows and burns everything I have If you enjoyed this video one more time, just give it a like and subscribe to the channel and I'll see you in the next one