Hi, look what I've got here on my table. These all are miniature motors. I'm using these motors in one of my experimental kind of experimental hobby project. And in that project I needed such small motors and I've got these from different sources like eBay from local camera appearing shop and also taken out from my old mobile phones. These could be brush, brushless, stepper or a servo motor but the main requirement was to have small motors like these. And in this video I'm going to show you how to interface these motors with your electronics, how to test them and how to play with them and so that you can use with your electronics. So let's have a close look. You might have seen these motors at some point in your life as these are commonly found in mobile phones and other mobile devices to generate vibrations. This is nothing but just a DC motor connected with an imbalance load to its shaft. And when applied some voltage across its terminals it generates vibrations. So you can apply one to three volts across its terminals and it will start rotating and thus generating vibrations. And I've found that these motors are of no use for me because these are first of all these are not small enough. Secondly there is no enough torque. Also there is no encoder available of size as small as these motors are. So the next option I have are these stepper motors. Okay so on the size of the stator of this motor is the diameter of it is 6 millimeters and the length is almost 5 mm. Almost 5 mm. Yeah these motors these motors are also of no use because there is a tab attached to the stator and I can't use in that project. I've tried to remove this tab but I end up destroying four motors and with no luck. So here is the final contender. These are really small and credibly small and if you have a look at the length of the stator it is almost 5 millimeters. Yeah and diameter is like 4 3.5 or 4 millimeters. So this is really small motor. Let's have a quick look at the setup here. The motor is connected directly to the GPIO pins of the micro controller that is at mega 328p. I'm not using any dedicated stepper driver as there is no need for fancy features here like microstepping, decay mode, overcurrent protection or electrical braking. Current consumption of this motor should be really low. It should be under 10 milliamps so the GPIO should handle it. I'm using this external programmer. This is at male eyes. They call it in circuit emulator. I'm using this to program the micro controller as this is way faster than the one in build and the Arduino board. It takes hardly one or two seconds depending on the core size while Arduino takes 10 to 20 seconds. If you open the Arunews official website and search for stepper you will land on this page and here you will find a lot of stuff related to the stepper motors. You will find different stepper circuit configurations like unipolar and bipolar and you should visit and explore if you are not familiar to the stepper motors. Some functions are given here which we are going to use in our test program like to initialize motor to set the step size and to set the speed of the motor. We're going to use this code stepper1 revolution. In this code motors shaft is going to take one revolution to the clockwise and one revolution to the counterclockwise and we'll wait for some time before every rotation. Here it is given as 500 milliseconds between every move it makes. So the code is very neat and small. Here header file is included then the step size of the motor is declared. Generally stepper motor step size is 200 or 400 steps but in this case it should be a small number because the motor size is very small. Here motor slavery is initialized. Pin number 8 and 9 are connected to the one coil pin number 10 and 11 are connected to the another one. Here the motor speed is given and it is set to 65 default we will leave it as it is. Serial we don't need but I'm going to leave it to as it is. In the main loop we are rotating the shaft to clockwise and then a weight of 500 milliseconds then rotating to the counterclockwise and again a blocking period of 500 milliseconds and repeat. So I'm going to copy it, build it, program it and let's see what happens. Copy, compile, done and program. So let's start program without debugging. Okay, wow. Okay the revolutions are way too much and so does the speed. So like I said before the step size is quite high in the code. Let's change it to 50 and reduce the speed as well so that it becomes visible. Okay, build. Program. Here we go. Wow. Okay, one, two, two and a little more. So okay it's doing two and about half revolutions in one way. So let's further reduce the size of the step to 25 and compile and program it. Okay, this is a little over one revolution. It should be 20 and speed could be a bit more. Let's check now. Perfect. Perfect. Wow, perfect. So finally the motor step size is 20 and this is because the size of the motor size of this motor is way too small to accommodate more than 20 poles. Wow, nice. One more time. Let's increase the speed to 80 and let's see how it does. Nice.