Jump to This TimeTranscription Text
00:00:00hello everyone and welcome back to the channel I'm not exactly sure how to get started with this video um this is really just a video that's trying to explain the electronics that I'm hoping to get coordinated and working in the
00:00:14robot those of you who have been following along know that I'm trying to build a robot that's capable of sorting out pennies by date and I'm going to use an artificial intelligence program in AI or machine learning in order to do that
00:00:29hopefully at the end of this project I will have a machine that is capable of finding pennies to add to my own coin collection on the desk here in front of me you can see what I'm trying to do for the guts and the brains of this machine
00:00:43I have two stepper Motors two limit switches two cameras and a power supply that's outputting 5 volts on both rails of that breadboard I have a cooling fan running over here off of the 5vt rail and I also have a Raspberry Pi for
00:01:00with 8 GB of memory in addition those of you who've seen my previous videos will recognize this part as the camera studio that I talked about and that contains not only a camera but a string of LED lights that can be used to light the
00:01:15Pennies from different angles now the challenge of all this is trying to get all of this coordinated and with these temporary breadboards the connections are actually pretty loose so often times we're not making good solid connections
00:01:29and that's causing problems with the programming so what I intend to do in this video is just show you the progress that I've made and trying to get all of this coordinated as we talked about in the last video we have two stepper
00:01:41Motors one that controls the coin Grabber that rotates the coins into position between these two cameras we know where the stepper motor is going to end up because we can turn it on and off using a limit switch here same thing
00:01:56with the coin sorder mechanism we have 11 positions that we could potentially drop coins into and we need to know exactly where this stepper motor is at all times we're going to do that by setting a limit switch that will tell
00:02:10this to turn off when it is in an exact position from there we'll be able to rotate it by a number of steps to get to any of the other positions in the robot without further Ado I think I'm just going to show what I've accomplished so
00:02:23far and then try to explain some of the challenges that I've faced in this program that we have running on the Raspberry Pi you can see that we have uh a main Loop here that's listening for the limit switch
00:02:39States and if I run this program both stepper Motors are now running and down further in the code here what this while loop is doing is actually listening for the state of these limit switches and the idea was to
00:02:57say if one of these limit switches is pressed then you can stop just one of these stepper Motors so you can see that one limit switch goes with one stepper motor so this one will go with that one that one will go with that one I think
00:03:10that's the way it works we'll see here in a second but as we activate a limit switch if I press on one of these you can see that this uh stepper motor is now stopped and this one continues to turn
00:03:25the problem that I'm seeing here is that the cool fan over here is now stopped also which means that I think that the power on the power rail this 5vt rail has dropped to a point where this motor is no longer able to run but if I press
00:03:42the other limit switch you can see that that stepper motor now stops and the cooling fan now starts up again so you can see that when I try to activate everything all together and coordinate these things I get the
00:03:58stepper Motors turning very very slowly which means that they have a very low voltage the cooling fan doesn't have enough voltage to stay running and the LEDs Flicker at a very low intensity but as I click the limit
00:04:11switches here you can see that this stepper motor picked up speed which means that it has greater voltage the cooling fan still doesn't have enough voltage to run and the LEDs are still at a low intensity but as I stop that last
00:04:26stepper motor you can see that everything else starts working again so I really need to find a way to C to maintain the voltage on all these buses even when I have everything running at once here and that's going to be a
00:04:39challenge for me if anyone has any suggestions about how what power supplies to use to maintain voltage to all of these components at once even when I'm using them all at the same time that would be really helpful to me my
00:04:52online research hasn't really turned up much that will allow all of this to run together and I'm okay spending a little money to buy better equipment here but I'm just not sure what to buy because this is my really my first experience
00:05:04with Raspberry Pi and trying to get these components to work so uh anyone with more experience I'm all ears the other thing I wanted to show you very quickly was that I can also get the cameras to work somewhat but that has
00:05:20also created its own challenges I'm going to comment out everything except the cameras the other thing that I'm f ING with the Raspberry Pi is that if I unplug these for any reason and plug
00:05:36them back in they could have completely different indexes and I have not figured out a way to programmatically figure out which camera is which yet and I'd also like to learn that so if anyone has any insight on how to do that that would be
00:05:49helpful the other challenge is that when I take a picture sometimes the USB bus goes down I'm no longer able to use the keyboard and mouse and I also can't use the other camera so if I take a picture here the USB bus will go down it turns
00:06:05off the the USB keyboard and mouse and the Python program crashes and won't allow me to take a picture with the other but now that I've commented everything out except the two cameras let's run this and just see what happens
00:06:19it may be exactly what I just said but let's see how it goes so here again you're just getting a bunch of Errors that's saying that the camera is the camera index is out of range I'm not very good with Linux so I'm struggling
00:06:35here a little bit but I know I have this command over here that will allow me to show the indexes of all of the components that are connected to the USB bus um so let's run that and see what I
00:06:49get okay so you can see that these USB cameras have changed their index so it's saying video 4 and video one I'm going to try changing that in the code and just see if we can get some pictures out so we'll change that to one and
00:07:05four save it and we'll run that again and see if we can actually get a picture good so obviously it's out of focus but you can see that the top camera uh was able to take a picture here and I have to hit any key to
00:07:22continue so I'll just hit space [Music] p we'll see if this crashes out but what it should do is activate the second camera and take another picture and it should be bottom camera but again this
00:07:36timed out and shows errors when I typed those errors into Google I couldn't find anything that showed up but when I typed them into chat GPT it said that I might have a loose connection somewhere so in the next video what I plan on doing is
00:07:51soldering all of these components down to the board so that I get good solid connections and hopefully that will help a little bit I know that I'm still going to have power issues on these rails and again I'm looking for any feedback from
00:08:05you all anyone who has more experience with Raspberry Pi power issues I'd really like to hear your comments down below so please help me out if you can but for now that's my two cents thanks for watching everyone