Raspberry Pi LESSON 56: Assembling the Sunfounder Pan/Tilt Hat for the RPi Camera

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Paul McCarter with toptechboy.com and we're here today with episode number 56 and our incredible new tutorial Series where you're teaching your Raspberry Pi who's boss what I will need you to do is pour yourself a nice tall glass of ice cold coffee that would be straight up black coffee pour it over ice no sugar no sweeteners none needed and as you're pouring your coffee as always I want to give a shout out to our friends over at Sun founder Sun founder is actually sponsoring this most excellent series of video tutorials and in this class we're using the sun founder Raphael kit for Raspberry Pi now most of you guys probably already have your gear if you don't look down in the description there is a link over to Amazon you can hop on over there and pick your kid up and believe me your life in my life are going to be a whole lot easier if we are working on identical Hardware but enough of the Shameless self-promotion let's talk about what I am going to teach you today and what I'm going to teach you is I'm going to teach you I'm going to show you how to put together the sun founder pan tilt hat now what does this pan tilt hat all about well you know in the last four or five lessons what have we been doing we've been learning how to use opencv in an opencv we've learned how to find identify and track an object of Interest coming from the Raspberry Pi camera now that's pretty cool we can box it we can outline it we can color it and we can track it around the screen but wouldn't it be cool if we could really track it in real life where as this thing moves the camera moves to keep the object of interest in the center of the camera now in order to do that we need to be able to move the camera so we've got several options first of all if you don't have any coins you can get 90 percent of what you need out of these lessons just using the little blue Servo in your kit you can take that blue Servo and you can mount or you can glue the camera to it and then you can track by panning okay if you were really clever maybe you could glue one Servo on top of another and you could kind of clue something together where you could pan and tilt and you could do it in both directions some of you guys might want to develop design your own bracket and build this whole thing from scratch in Fusion 360. that's an option but the the path that I'm taking and you guys if you take this path great if you take the other path every single thing I teach will also be valid but I'm going to be using this little pan tilt kit and how the pan tilt kit works is if I can find a good view here and get out of your way you can imagine and I already put one of them together I have two of them and it is a hat and this hat plugs onto the top of the Raspberry Pi and it sits there very firmly it attaches very firmly and then what it does is it allows you to move the camera by either panning or tilting so there's two servos on this thing now why do I really like this particular kit and I know some founder sponsors me but I really did pick this because it was the best one and I'd used several in the past that didn't work very well there's two reasons I really like this well three reasons first of all the servos that they put in there are very precise servos they're very easy to use in a control Loop the other thing that I like is is that they're passing through most of the gpio pins for the Raspberry Pi so when you hook the Hat up to the Raspberry Pi you don't lose access to your gpio PIN so imagine we wanted to hook this pan tilt camera system up to the PIR sensor which we were using earlier and maybe when the PIR sensor sees an object come into a room then it turns the camera on okay so you see there's some opportunities to do some really cool things when you pass through the gpio pins okay the other thing that I like about it is is that this you see it plugs into and it sits firmly on top of the Raspberry Pi so as you're swinging your camera around and moving it the thing isn't shaking because it is firmly affixed to the Raspberry Pi so those are the reasons I like it and what I'm going to show you today that's not a very good view this is the view that I meant to show you okay the reason I like it is for those reasons and then what I'm going to do today is I'm going to show you how to put it together now I will say it's a little bit tedious to put together so before you start you want to be relaxed you want to have about an hour and a half to put it together and you want to not be in a hurry and you want to not get frustrated think okay he's going to take me through it step by step I'm not going to get excited I'm not going to get in a hurry I'm going to be patient because you've really kind of got to be patient when you start trying to rush then you end up making mistakes and then you end up having to kind of go back and start over now I put this one together and had to I had to go in and take it apart a couple of times because I didn't do it exactly right but now I have experience and I can show you how to do it and hopefully you're going to get it right the first time okay so that's what we're doing that is where we're going and now what we need to do is before we jump in and get started there's a couple of things that we need to do on the software side before we start assembling our kit and guys I think this is like 30 35 something like that there is a link down below that will take you to Amazon where you can pick this up again I think it is a really cool little device but let's come over here to our Raspberry Pi desktop view and what you will need to do is you will need to open a browser and then what we are going to search on is we are going to search on res Berry or we're going to search on uh Sun founder pan tilt hat software Sun founder pen tilt hat software like that okay now there's two things here that we need the first result that I have is Sun founder pan tilt hat kit just I'll click on that and then just in case yours is different I'll show you the URL is docs.sun founder.com projects slash pan Dash tilt Dash hat slash English slash latest and then you'll come down here and under content you'll find component list and assembly instructions click on that you can see now there's this download link click on that it has downloaded and you can now click on that download link and it will bring up the instructions this is uh engineering drawings and actually it's a pretty good set of instructions but there's a couple of key things that aren't perfectly clear and there's a couple of things that I had to do a little bit differently and so it's okay if you want to open this up but just make sure you follow along with me because I think I can help you with some of the pitfalls in these in these instructions and so just stick with me so you've got that now let's come back over here and the other thing we're going to need is we're going to need a couple of pieces of software so again we have searched on sun founder pan tilt hat software and then the second result is the GitHub Sun founder pen tilt hat pan tilt hat kit we'll click on that and then just to make sure you find this we're at github.com so Sun founder slash pan Dash tilt Dash hat now this has got some code and there's two programs in here that we're going to need and we're going to need these before we do the assembly so we clicked on the examples and now we come down here to Servo dot Pi click on that and then come over here to these two little page icons click on that that copied the code now we need to go to our friend Bonnie okay and let me get a new program I'm going to paste it okay and then we're going to save this as save as Servo dot Pi now what's important you need to save this in your folder that has your python programs because when your Python program says import Servo this Servo Library needs to be in that folder and so that is kind of important and so I'm going to save it and that is safe there is one other program that we need so we're going to go back this is a real simple program but it is called Servo zeroing I need you to grab that and then copy that okay now we're going to come over here and we'll get a new one we're going to paste okay that's a simple little program and then we are going to save as in this one we are going to call Servo Dash 0 dot Pi like that that is the software that we are going to need so most excellent we can come back over here because I think we'll be wanting to look at this as we go through with my lesson so we are going to leave that up all right what we need to do now is we need to get our little kit and where did I put that little kit it could not have gone too far here it is okay and now I'm going to go ahead and open that up and we'll probably come over here to a little bit better overhead view like that okay we're going to open it up and we're going to go ahead and get our stuff out so I've got a bag with the servos and the screws I've got the base I got the brackets and then the kind of cool thing is they actually included a camera well we've already got several cameras but it's kind of cool to have a spare camera laying around so we'll put all this stuff out and the first thing that we're going to want to do is we've got to kind of calibrate or or zero the servos and so we've got to get this base unit out and then we've got to get the two servos out all right we got to get the base unit out and we've got to get the two servos out now I hope you see what I'm trying to do I'm giving you a straight overhead shot here but in case you can't see it then I'm giving you over here kind of a more of an over the shoulder shot in between these two I hopefully you can kind of see what I'm doing so we'll take the two servos out we've got some zip ties that we're probably going to need before this thing is over and then we'll be using the brackets in a minute okay so what we need to do is we need to plug the servo into the base and so mine actually looks a little bit different than the instructions but no matter what it is they are labeled pretty good so you should be able to see this and so let me kind of come into a zoomed in view here you can see that there are these two sets of three pins and it goes black red yellow black red yellow black is ground red is power and yellow is control and that sort of matches here we've got brown is ground so Brown would go to black red goes to power and this orange or yellow is going to go to control and so these are going to plug in these are going to plug in just like this okay I'm trying to get where you can see it and that's not lined up okay do you see that just like that now the thing that doesn't matter now but I'll make note for later do you see right here this one on this side is labeled 1013. and then over here on this side this pin is labeled pin 12. so this yellow one is 12 and this yellow one is 13. now one of those is going to be pan and the other one is going to be tilt now right now we don't care which one is pan or tilt but it will matter later so I just want you guys to see that that is pin 13 and that is pin 12. so this one we're going to come in and we're going to hook it up as well just like that now I've got that plugged in now I need to come over and I need to put this onto the Raspberry Pi because we've got a zero these things before we start the assembly now when you come in and put this down remember don't jam it down on this side and then jam it down on that side try to work them down together and similarly when you take it apart don't lift this side up and lift this side up because you'll Bend those pins try to work them off together and on together and so we're going to be real careful I'm going to come over here and let's see if I can just kind of get them started okay now I've got them all lined up and now I kind of push push push push push like that and then I have them on there all right now this is what we need to do before we start assembly we have got to go in and make sure that those servos are in their zero position so I need you to come over here to thawny and then we're going to run this program and it's going to put the pan and the Tilt in the zero Direction and so I'm going to come in and we're going to run this okay did you see them kind of glitch now I want to make sure that I'm talking to both servos so I'm just going to come in here and I'm going to say go to 10 just because I want to make sure that both servos are responding okay this one didn't but probably it was because it was this one so I'll set this one back to zero this time I should feel it move okay that one moved now I want to make sure that I feel this one move and this one then should be the tilt okay so I'm talking to this one and now I will set them both to zero and then run okay and so now these are in the right position so that when I assemble this thing everything will Point correctly and will respond to the software correctly very important that you do that step okay let's come back over here to the overhead view because I think we are just about ready to start putting this thing together so again I'm going to take this off now and I'm going to be very mindful to not bend the pins I got it off we'll put this out of the way for right now and then what we need to do is we need to come over here and look and see where we are going on our instructions Okay so we've done this first part where we've zeroed it and I think it'd be good if I kind of zoomed in a little bit and we're going to come to step one so we're going to need to get our brackets out and there's three brackets in here you can see this bracket is really for the camera to hook to this bracket this tall one mounts to the base and this is the bracket that the servos go in this is the bracket that the servos go in so what you want to see is you want to have the flat part facing towards you not the narrow bottom part the flat part and then you want to get your Servo I'm going to go ahead and unplug them I'm going to go ahead and unplug them from the base and now what do you see the drive gear goes to the left now I'm going to go ahead and feed the cable through there and now what do I have the hole is up [Music] the hole is up and the drive gear is to the left and it goes in just like that now I need to come in and I need to look through my screws now what it says is it says to use the M24 screws now unfortunately my packets of screws were not labeled but what I want you to see is you've got one packet that is kind of the big screws those are going to be what put the standoffs on in the corner so the big screws put the stand offs in the corner and then you have these intermediate size screws all right and then you have a bag of these little bitty screws okay these little bitty screws in the little bitty screws have a sharp point we want to use these middle size screws okay and you also want to get out your handy little screwdriver I think this will be a better view okay so we're going to use these middle size screws and we're going to use the little screwdriver so I'm going to go ahead and I am going to start getting this put together I like to drop it through the hole to begin with like that and then as I bring it down kind of hunt four and I've got it okay now on the other side what I'm going to do is I'm going to do the same thing don't tighten this one up till you get the other side in because you want to make sure that you have this other side aligned before you get too tight on that other one okay so I'm kind of searching for it it found it now because you're driving through plastic you don't want to tighten these too much because you don't want to crack that plastic so I kind of come down until it's done okay I kind of come down till it is done and then I give it kind of a like that and then this one over here I'm going to come down till it's done and then kind of give it a oomph and I'll come back over here okay that's good so we've got that one in now if we come back over here now what we want to do is we've got to get the bottom one in now what you see on this one the gear is pointing towards the left when you're holding it like this on the bottom one the gear needs to come out the right okay do you see the bottom one the gear needs to come out to the right so what we're going to do is we're going to feed the cable down through the hole and out and now the gear needs to be to the right so let's see if we can give you a better view of that the gear the drive gear the output needs to be to the right and so it is going to go in like that and then again keep your cables pulled out now we're going to need two more of these intermediate size screws like this like to start by getting them down through it like that come in Hunt for it I think I've got it there come over here same thing get it started all right hunt for it got it come down and then a oomph on it come down and a pump on it there now I think where we are is we are kind of like this and let's check our orientation when I have the flat face towards me the drive gear is to the left and then when I tilt it the drive gear is to the right and so I really do have this orientation here now what it's telling me is it is telling me that we need to now go in and get ready to mount to the base but you see how it is telling me to use this long one and four screws okay but the problem is I don't have a long one I have this little cross-shaped one I have this little cross-shaped one like this but then when I look at the bottom it is telling me to use the cross shaped ones so again my kit does not exactly match the instructions all right so now I'm going to get that out and this is very important you have the pins facing up okay do you see the pins are facing up now this comes up through the bottom and snaps in like that okay pins are facing up and now this is coming through and then if you look there's a little outline there now what we need to do is we need to get those little bitty screws okay the little bitty screws not the screws that are in this package with the horns but the little screws that have the sharp ends on them the little bitty screws that have the sharp ends on them we're going to need four of those now this you have to be careful you're going to come from the top side and you're going to drive down but you are driving into plastic so you don't want to overdrive this and you don't want to strip it okay so you want to get it in there tight but you don't want to keep going because you will strip the plastic and then that will be a problem so we're going to start here I think I have it lined up okay I think I've got it lined up so I'll get that one going come over to this one no matter what I do it seems like my hands are in your way huh tightening those four we had a jailbreak there one of them tried to get away from us okay so we're gonna come down and then give it a little oomph we're gonna come down until it kind of stops and give it a little oomph come down it stops give it a little ump so I think that is in there pretty good now so we basically have this step three done and if we look the pins are up I've got a little bit of the uh horn the plastic piece sticking up and then I have the four screws so step three is done now what it is telling us in step four is it's telling us to use a PVC washer between the base and putting this on but when I look in my kit I don't have a PVC washer and so what we're going to have to do is we're going to have to just do it without the washer and I put this together and it does work without the washer and so don't worry about it we're just going to have to power on through so we'll come over here now this is where things get very very important okay you cannot turn that little gear because the little gear has already been zeroed the little output shaft has been zeroed so you don't want to put this on and start turning it where you rotate the output shaft because then if you do that your zero is not going to be zero now also you have to snap this on right at the right angle so you see I'm holding it in my left hand the pins are up and to the right and now I want it to go this way straight right I and from the top straight this way I don't want it here I don't want it here I want it straight like this and this is very important now you you're not going to get it perfect but that is pretty darn good because you've got like geared teeth so there's certain discrete places that you can be but but I got that on there pretty darn good now what you got to do is you've got to be careful from now on in the assembly do not turn this do not turn this this needs to stay right there now you need to come over to the bag of screws and the ones that come with the little plastic pieces and then this is the screw that you are looking for here and let me give you a close-up view of it okay do you see these are the ones that are in that bag with the plastic pieces you see how it almost has a washer on there and then on the other end it is sharp so then we're going to come in we're going to come in from the top and write I don't want to turn this so I'm going to hold this I'm going to drop this in and then I'm going to get my little screwdriver and this is where you do not want to rotate you do not want to rotate your Servo okay and this one is one of those it's kind of hard because it doesn't have much room to drop down in there so you're gonna have to just be patient and this is where you've got to just take a deep breath and you got to tell yourself that you've got all day now we're going to drive this and this is driving into that output shaft of the servo okay it's driving into the output shaft of the servo and again you don't want to strip it but you want to come down and then give it a little ump like that good news is we didn't rotate that so okay I think we are done with that step now that was step four and then we're going to come over here to step five and now what we're going to want to do is we're going to want to get this bracket and we're going to mount this bracket from the base we're going to mount this bracket from the bright base up to the top for that we are going to need these little rivets now in my kit these plastic rivets one set of them in one kit was white and in the other kit it was black and so this might be either color but let me show you how these rivets work so that you understand it and so let's come over here to a close-up view okay so do you see the little rivet okay this is what you want you want the rivet kind of in the out position like that okay you want the rivet in the out position now this will easily go through the hole but now when I snap this up a little ball comes up and expands that out so when I press it in I don't want to press it in like this because then it might snap before it goes in I want to press it in putting my thumbnail on that part press it in and then snap it down if that makes sense so let's come over here and let's see if we can do that so we will get our little bracket here and notice you've got kind of a clear outline here of how to how to do it and then also notice that you come from the bottom okay so you come from the bottom you get the bracket lined up with those two holes okay bracket lined up with those two holes the rivet in the out position and then with my thumb on that inside ledge okay so I'm pressing it through on the inside ledge like that now get it lined up Okay so I'm through the base and I'm through the bracket and now I press on the outside and it pops okay and let me show you what it looks like once it pops okay do you see how now that little ball came up through there and spread it out okay so this other one should go a lot easier because we've already got it started I'm just making sure that I'm kind of in the out position before I get started and this one kind of it should be almost lined up already sometimes they'll kind of come apart on you too okay get it lined up with the whole use the thumbs to press through the bottom part okay and now that it's through we're going to push and snap and you feel that thing snap we've got one more which is up here to do in the top and so I'll get that and then make sure that I'm kind of in the out position yep and now this is going to go through the top and then find that hole all right it's through now be careful because you don't want to put Force here so I'm holding it because you see I don't want to put I don't want to put torque on that output gear so you see I'm putting it here and then pressing from there and this one boom okay that snapped all right so that is in place okay now what we're going to have to do is we're going to start having to assemble we're going to have to start assembling this other bracket the one remaining bracket this bracket here and we're going to have to put the camera on it okay and so we're going to have to dig through here and get our camera foreign and what I need you to do is you've got to kind of hold this in the right orientation what we're going to do is we've got the camera ready to go but we've got to put that little Servo part on before we put the camera on okay we got to put the servo part on before we put the camera on so what you do is it wants the long arm one so you get the long arm and then you see this hole it goes away from you like that with the hole at the top now this goes on the outside okay do you see that goes on the outside like that it's on the outside okay but you drive the screws from the inside okay so you drive the screws from the inside and these need in the bag by themselves these two itty bitty tiny screws that have the sharp edge okay and they're going to drive in from the inside so I'm going to put it in there and see if I can kind of get it into the hole one thing that kind of makes this hard is one thing that makes it hard is that screwdriver kind of gets blocked by the bracket when you're trying to do it but I'm getting it lined up I think I've got it lined up and you see the screwdriver kind of runs into the bracket so you've got to kind of operate a little bit at an angle here and that I have bit it okay but before I put it real tight I'm going to come in and I'm going to put the inside one in so I'm going to do the inside screw and the outside screw like this same thing we're driving into Plastics you don't want to strip this thing so I'm going to come down it's stopped and then I'll give it a little oomph this one comes down it stops I'm going to give it a little oomph okay now that was the easy part now we have to mount the camera the camera is going to we're going to go back and the camera will be using those medium sized screws the intermediate screws that we have the nice bag full of them we'll need four and this is the hardest part okay this is the hardest part these are the intermediate screws and the the reason this is hard is is that these holes are not tapped and so it's almost like we're going to have to tap them with the screws and the screws it's hard to tap when you have just a tiny little screwdriver like this because you start rounding the screw heads you're just going to kind of have to do the best you can but we're holding with this plastic piece towards us you can see these are pointed down and now the camera goes where the holes line up and the ribbon is coming out the top but we got to feed the ribbon through it's coming out the top now we've got to line it up and now we've got to try to get these screws in so what I suggest is start by just trying to get them started and I have found also let me say be very careful this black camera is Loosely affixed to this and if you bump that you can very easily knock it off the board and so you want to be very very diligent to be very careful not to touch that as you are beginning to struggle to get these screws going in so I'm trying to kind of find the hole okay I think I've got it and I'm driving it in the other thing you can do if you have a tap and die set you could try to go in and tap those holes the other thing you can do is you can tighten and loosen and tighten and loosen to try to get them to go in further I'm going to loosen them up a bit I kind of went pretty hard on them there and then you know it makes it harder to get the other side lined up so this probably was one of the most one of the more frustrating parts of it was to get these things in but like I say that the key is to just stay relaxed don't get frustrated don't get in a hurry and if you do just stop take a deep breath and try to relax a little bit [Music] not right I am missing I'm missing one screw and what I have found on this particular step I could not get the screws to go go all the way in and I really wanted to mount this thing flat out you know but I couldn't get them to go all the way in so I didn't even try because it's it's not going to really flap around that much I'm just going to kind of get it as much as I can okay and you can kind of hear that the I'm starting to kind of go round you know I'm kind of starting to lose grip on the screws and so that is pretty good but you can see that they didn't go all the way in but it's going to be good enough so let's come over here and so now we have the camera mounted and also I want you to notice that the Blue Ribbon should be facing towards you when you're like that and then we have this in there as we should coming from the outside to the inside the camera is in there so now this is a very very important and very critical step we have to put this onto here and this is what I need to show you so I'll try to give you a nice close-up this needs to go on don't line it up don't line it up like this where this is lined up with that because then what the camera is pointing down at this zero point that we've zeroed the servo to this camera needs to be pointed straight out so it needs to be not like this not like this it needs to be straight out and you can't do it perfectly because there's discrete gear teeth but what you're going to have to do is kind of pull it out and get it there and get it lined up and I am going to try to go up a little bit more and write do not turn do not turn this to turn that gear and so that is lined up pretty good and then it snaps on and you you can see mine is pointing up just a little bit but if I went the next gear tooth down it would probably be pointing down a little bit don't try to adjust it with your finger just leave it like it is there that's going to be close enough now we need to come back to our little bag our little bag that has the servo end pieces in it where'd that little bag go if one of these screws out of this bag and right this is again the one that looks like it has a washer on it already and it is going to come in now because we're doing this make sure that you don't turn any of this the only thing that you want to turn is the screw okay the only thing that you want to turn is these screws so we're going to come in here thank you and I think I have it started and we're driving into plastic so we don't want to strip it so I'm going to come down I'm coming down and it stops and I'm going to give it a oomph okay now this is something very very important what the instructions say is Okay so we've got uh we've got this done right that is connected properly what it is saying is to come over here and put one of these white rivets okay and then rivet this side down this is what happens when I rivet this side down it squeezes you see there's no there's no washer or anything between that and it squeezes these together and it torques over this a little bit that when you have a piece of sheet metal that's bent like this you can't get the Precision that you need to make that kind of connection so if I rivet that in there what it does is it impedes the motion of the Tilt and then what it does is it hits a spot and it hangs and then it burns the servo out and so this is what I have found is the best solution it's not the solution that in a perfect engineering world that you would want and it's not the solution that I would hope for but it is a solution that works and what we're going to do is we're going to take this rivet okay let me give you a close-up of it here we're going to take this rivet and we're going to pull it apart okay now do you see how I have just the bottom part of the rivet I'm going to come over here and I'm going to put that in as a guide and it'll actually kind of stay in there okay so you see now that is a guide but now this is free to move up and down because it isn't clamped in it's just got that it's a little bit of an alignment piece and in fact what I might do is I might glue this to this so that it doesn't just pop out but it's serving as a nice alignment piece so this doesn't go up and down and it doesn't go forwards and backwards okay but it's not clamping this to this in such a way that this is not free to move and like I say when I put this one together I use the rivet and then what I did was I burned that Servo out or I stripped that Servo as I was trying to move it and then I tried to recover by going in and using one of the little blue servos and then the little blue Servo didn't work so I basically kind of uh didn't do real well on that particular on that particular device you know this one is kind of this one's for spare parts now we'll put it that way that's the nice way we can say we got some spare parts okay I'm gathering up some of my excess pieces here all right and save all those extras because you might need them all right so I think that we have this thing put together now what we want to do is we want to come back over here because now this becomes important we've got to figure out which is the pin and which is the Tilt and if you remember the pan Servo should go to pin 13. so pan goes to pin 13. well what is pan pan is the one that goes like this pan is the bottom Servo the bottom Servo right makes it go like this so this wire is off of the bottom Servo this is the pan Servo it needs to go where it needs to go to pin 13. so we're going to come in here and then we're going to look and so can you see that top row is pin 13 and my yellow needs to go on the outside so pin 13 yellow on the outside am I lined up there yeah okay do you see that and then I press in yellow is on the outside and that is pin 13. now the other one is tilt and the other one the yellow goes on the outside too okay and you can see down there that one is labeled pin 12. so yellow on the outside two pin 12. okay like that and then we'll just come in and bingo right now this thing should be this thing should be hooked up now I think we have this thing hooked up so now we're ready to come over and we're ready to put it on the Raspberry Pi but not quite not quite I forgot the standoffs so what we want to do is we want to come in on the Raspberry Pi and we want to put our standoffs on and our standoffs are this little bag of goodies now what you can see is there's two kinds there's the kind that have the hole on both end and then the con that have the screw on one end and so I will show you how to do that and then also now we are going to need that bag that had the larger screws okay so the larger screws which are here and then these and we will put the standoffs on so the way I like to do it is I am going to get the larger screws I'm going to start by putting them in place so I'm going to get the four larger screws and I will go ahead and just drop them through the holes two three four okay so I've got those in and so now I need to get the standoffs that do not have the screws these are the four standoffs that do not have the screws on the end they don't have the peg-like things on the end those like that and then what I'm going to come in is I'm just going to come in and I've got a jailbreak screw there okay so we'll come in get that one back in and now I'll just kind of put my finger on the top there and then come in and just finger tighten this like that come over here finger tighten it teachers like that get this one it's going pretty well finger tighten it that one needs a little help with the screwdriver up here I believe okay got it and then our final one here and God says I'm doing this remember don't twist the servo either pin or tilt do not twist that okay so now we have got those standoffs all on there what I think that we're going to need to do now is to actually shut down the pi and so we'll come back over here because I don't want to hook the camera up to it while the pie is powered so we're going to come over here and we are going to do a shutdown okay and now I'll just kind of watch here I'll watch here until these lights go off okay until these lights settle down okay and I think that is down so now I will unplug this so we don't have power now we've got to hook the camera up all right so to hook the camera up we're going to take this cable and we're going to feed it down through that little slot okay and then always remember as you are using the camera as your use as you're connecting the camera that this blue ribbon this Blue Ribbon faces towards the ethernet okay and if the ethernet is on the other side then what faces towards me is the part that does not have the blue on it okay I've got it in now and now try to press it down on both sides okay we got that in and now we're going to very carefully come in and line those pins up as we talked about and now I'm going to come in and I'm going to press it side to side and bring it down gently now we need to get these four standoffs that have the screw ends on them and now we need to put those in as little legs for the Raspberry Pi to stand on in this you can just kind of hand tighten just thumb tighten okay like that come in like this we're almost done I used to hate things like this because I would get in a hurry and I would just want it done and I would not read the instructions and I would get frustrated but I just learned you know just take your time relax take a deep breath don't get in a hurry don't get frustrated and then it usually goes really well like I say the first time that I did this there were some things that weren't clear to me so I ended up taking it apart a few times but hopefully you guys will be able to just follow along smoothly with me okay let's go ahead and plug this thing in and let's see if it'll boot up now and let's save all of our little pieces here and I think these uh I think these zip ties are going to be useful later on to do a little Cable Management with those Servo cables but right now we're not going to worry about that and let's see if we are getting booted here foreign we successfully booted so let's take a look over here okay so you can see this and you can see my code View so let's go back and let's call up Bonnie again and remember that Servo program was just a library let's say I'm going to go ahead and run this and just make sure that the uh let's just make sure the camera works so I'm just going to run my camera program make sure that I've got the camera working got the camera connection and they're good anyway yeah there it is okay you can see I'm upside down and that just means I need to do a flip in the CV2 but the camera is uh the camera is working so that's good now let's go in and let's open that program that was Servo zero okay and now pan is zero tilt to zero so now let's just see what if I put a plant pan of tin what I would expect is either for it to rotate counterclockwise or clockwise but just just do a little step let's just see if that pan is alive giddy up okay so what do I see positive rotation is counterclockwise that's how you do it in math positive uh angles are counterclockwise let's go to minus 10. okay so that should come back clockwise yeah that's good if we said minus 25 go Little Steps at a time make sure that things are going right okay that looks good let's go minus 45 . okay that looks good let's come back to zero I'm going to try it again 45 okay it's 45. okay it's looking good and zero all right that pan is working very well now guys I have to warn you on the tilt I've got to warn you on the Tilt if you tilt down too far you're going to crash this into the base and you can ruin your servos if you do that so we've got to figure out is this positive tilt or is this positive tilt and then I would just not tilt down or I would not tilt down more than like maybe 20 degrees you got to be really careful because you don't want to crash that thing and you don't want to crash that thing and then strip out your gear so I would not come in and say 90 because if it went the wrong way it would crash so I'm just going to say tint what direction is 10 on tilt okay positive 10 tilts it down I've got enough room so I'm going to go ahead and say 20 that should tilt it down some more but I wouldn't want to really tilt it down any more than that probably so let's say minus 20 and we're expecting that now to tilt up okay and the up is pretty safe so let's go minus 45. okay that looks good and then let's go zero okay guys this has been a little bit of a tedious lesson but you got your pan tilt system put together and now we're ready to go in and start developing some Control Systems where what our objective is what our goal is is that as I am in here as I am in here moving my object of interest that the camera would track it well now if I can track on yellow I could develop a little more artificial intelligence and instead track on a face or a nose or an eye or track on a dog or other things the point is we now have an ability to move the camera so now we can start moving ahead in the sophistication of the things we are tracking we can move forward in the sophistication of the things we are tracking guys I hope you are having as much fun taking these lessons as I am making them if you enjoyed this be sure to give us a thumbs up if you want to help us with your YouTube juice leave a comment down below if you've not subscribed to the channel already go ahead and subscribe and as always share these videos with other people because the world needs more people doing engineering and fewer people sitting around watching silly cat videos Paul McWhorter with toptechboy.com I will talk to you guys later ha
Info
Channel: Paul McWhorter
Views: 5,338
Rating: undefined out of 5
Keywords:
Id: ipbpr35p7I0
Channel Id: undefined
Length: 57min 20sec (3440 seconds)
Published: Thu Apr 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.