 Gotta make sure the audio works. This right here, as it says on the label, is a stepper motor. And so are these big boys. In this video, we're going to go over how stepper motors work, how to wire them all up, how to connect everything, including the code to make it work on your own projects. Quickly before we get started, if you enjoy these type of breakdowns, where we go over different electronics and build projects and all that, please watch the video until the very last second. It lets the YouTube algorithm know that you're enjoying what you're seeing, and it'll recommend it out to more people. Also, if you subscribe, you can skip that whole process and just get notified right away when a new project comes out. Imagine a stepper motor as a wheel that you can turn in very precise and controlled steps. It works similar to a pen, where when you click the pen, it moves the tip. Stepper motors inside here have little magnets inside, and they work with electromagnets. When you want to move the motor over and over and over and over, you have to activate the closest magnet to turn the spindle, and then again and again and again, and that's how you create a full rotation or any type of precise movements. So when you want to move the motor, you send signals to those magnets on and off in a specific order, and that makes the wheel spin just the right amount step by step. Because of this, you can make the stepper motor move exactly where you want it and be super precise, and that's why these kind of motors are super common in 3D printers, robotics, anything where you need precise continuous motion. These three I actually bought for a kit that I was going to make my own 3D printer, and it came with four motor drivers. That's one thing, unfortunately, with these that you do need a motor driver, there's nothing inside of it like with the servo, or you can't just plug it into a power supply like the DC motor. You do need drivers. So for this tiny one here, we have this little tiny driver here, and for the big boys, we have big stepper motor and big stepper driver. So it really is all about sending the right signals to these things to make the little magnets move the spindle in the right direction into the right location. When it comes to stepper motors, stepper motors offer precise control over position without the need for feedback systems like in the servo motors that we went over before, which is nice because it makes them cost effective and reliable for applications requiring accuracy. So like I said, something like a 3D printer that needs crazy accuracy uses these type of motors. Also CNC machines, but they use ones that cost like thousands of dollars in the size of this table. The choice on which one you should pick is kind of dependent on the application, but in my case, I love to use stepper motors because of their precision, accuracy, and the kind of things you can adjust with them. So we don't need these anymore. For our demo on how to use a stepper motor, you're going to need a couple different things. You're going to need the stepper motor. You're going to need the stepper driver. This is the one that came with mine. I don't know if it actually has a code or number on it, but whenever you search up these generic stepper motors, they usually come with the driver. You can buy them as a kit. You're also going to need a microcontroller. I'm using an Arduino Uno and you're going to need some wires. As always, I'll be sure to put up pictures on the screen of the wiring I'm doing so that if you don't see in the video, you can always follow in the picture. The first step, the easiest one was to take our servo motor and just plug it into our driver. In our case, what's nice is it comes with this little connector. We can plug it right in. Now for the side, I'm not exactly sure, but there's little white tabs here and those are going to fit perfectly into the connector. I'm guessing they're just going to snap in like that. Then we have to connect our driver into our microcontroller. It looks like on the driver on the bottom here, you have this jumper pin and then two pins next to it and it says five volt on the left two, 12 volt on the right two. Since we're plugging this into a microcontroller that supplies five volts, we're going to take that jumper pin out and we're going to put it on the other two for five volts. That's right here. Then we have a bunch of pins on the left here that we're going to have to plug into the board. IN1 is going to go into the Arduino 8 pin. So that's right here. Then we have IN2, 3, and 4. 2 is going to go into 9. I'm guessing then 3 into 10. So that's 2. Then we have IN4, which is going to go into 11. And apparently it's supposed to have a ground pin and a power pin. Oh, oh, I see. So I actually made a little mistake. That jumper pin is not from moving to five to 12 volts. It's actually five to 12 volts, just the range of power you can use. And then that jumper pin acts as an on off switch so you can disturb the flow of electricity. So I was mistaking with that. So move the jumper pin back and then we're going to use the five volt and the negative to go into power and into ground. So I'm just going to jump in on here. There's a plus for your power and that's going to plug into five volts. And then there's a second pin which has a negative under it and that's going to go into the ground. So just to recap, since I made a little mistake, we've got IN1 going into 8, IN2 going into 9, IN3 going into 10, IN4 going into 11. Then we have two pins on the left side of the five to 12 volt. The first one is ground. The second one is 12 volts or five volts somewhere between the two. And those are going obviously into five and into ground right over here. Let's plug all this into the... Let's plug our Arduino into the computer and get started with the code to make this work. For the code as always, we can start with an empty file and in this one we're going to be including our stepper library. Under that we're going to hold a variable called steps per revolution, which is going to hold a value 2038. This is the number of steps we take for a full revolution around the servo motor or stepper motor. Then we need to open up the stepper object and create a stepper variable and input our information and the pins that we're using for our connectors. So this comes back from the image earlier, 8, 10, 9, 11. Then in our setup we can actually skip it for today. We're not reading anything and we don't really need to display anything so we could skip it for now. If we wanted to we can go back here and put a little console thing and open it up and start printing things. Then in our loop we're going to do two different things. We're first going to rotate clockwise slowly at five RPM. Here you can see we're setting a speed. Here you can see we're inputting steps per revolution. Then here we're putting a delay. Then over here we're doing counterclockwise quickly at 10 RPM. So we're doing set speed at 10 and then we're doing negative steps per revolution which is telling it to go the other direction. So it should do a full circle in clockwise or that's actually clock. So it should do a full circle in clockwise and then a full circle in counterclockwise. Since you're not going to see anything from the camera on this little thing I'm going to get a piece of tape somewhere and we're going to tape it up so you can see the actual motion of the spindle. This should be good just so we can see which way the piece of tape is spinning. So select your board, upload the code and then you can see the servo motor starts to spin clockwise at 5 RPM. Vibrates pretty hard which I was not expecting and now you can see it's going double the speed counterclockwise and I'm not actually sure what top speed is so I'm kind of curious what if we put it up to 15 and let's say 20. I know that with the really big stepper motors you can get some crazy speeds but they overheat and you can blow your controllers but you can make them go pretty crazy. So that's 15 in one direction that should be 20 but it's not moving at all so I'm guessing 20 is too quick. Looks like 15 might be the max. What if we go to 18 maybe? I'm going to comment this out. I'll just use this. Oh that's way too much. Oh now at 19 it's not moving at all. Okay so I guess 18 at 5 volts is our maximum speed that we can do. Also if you look on your controller it's a little hard to see. We're not controller but the... Also if you look on the little controller the servo controller board look how the LEDs light up depending on what's happening. So now we have two now we have four. The reason we have two is because it's locking it in position and then four when it's moving freely. It's pretty resistant once it starts moving but when it's in position if I hold it it just starts to panic and freak out. It's a pretty short video but I hope this gave you a good understanding of how stepper motors work and how to use them in your own projects. You could do things like for example connect this to a string, pick things up, move things around. You can put this on a wheel, move the wheel around. You could do conveyor belt. You could do a bunch of different things. If you need any help with your stepper motor stuff check out the Discord. We've got people that can help you out there. Let me know in the comments if there's anything you had problems with or if there's anything you want to see in future videos. I guess that's it for this one. See you.