You are currently going to examine another sort of motor called a stepper motor. Make it move a set separation, and change the pace and heading. Stepper motors are not the same as standard motors in that their turn is isolated up into a progression of steps. By making the motor turn a set number of steps, you can control the rate of the motor and the amount it turns decently exactly. Stepper motors come in diverse shapes and sizes and have four, five, or six wires.
Stepper motors have numerous uses; they are utilized as a part of flatbed scanners to position the examining head furthermore, in inkjet printers to control the area of the print head and paper.
Another venture in this section makes them utilize an motor shield with equipped DC motors to control a robot base. You’ll wind up getting the robot to take after a dark line drawn on the floor!
In this tutorial, you will associate up a stepper motor and after that get the Arduino to control it in diverse headings and at distinctive velocities for a set number of steps.
- Stepper Motor
- L293D Motor Driver IC
- 0.01uf Disc capacitors – 2x
- Resistor 470
Verify the Arduino is associated with an outer DC power supply so as not to over-burden it. The capacitors are discretionary and help to smooth out the current and avert impedance with the Arduino.
These go between the +5v and Ground and the motor power supply and Ground. You can likewise utilize low esteem electrolytic capacitors, however verify you associate them effectively as they are enraptured. I found that without them the circuit did not work.
You might likewise oblige a present constraining resistor between the Vin pin on the Arduino and the force rail supplying the L293D chip. The Vin pin will give whatever voltage you give from an outside force supply so you may need to drop this voltage down to whatever the motor requires.
Advanced Pins 4, 5, 6 and 7 on the Arduino go to the Input 1, 2, 3 and 4 pins on the motor driver. Output pins 1 and 2 of the motor driver go crosswise over loop 1 of the motor and output Pins 3 and 4 to loop 2. You should check the datasheet of your particular motor to see which shaded wires go to loop 1 and which go to curl 2. A unipolar motor will likewise have a fifth and/or a sixth wire that go to Ground.
The 5v pin on the Arduino goes to Pin 16 (VSS) of the motor driver pin and the 2 chip repress pins are likewise attached to the 3.3v line to make them go HIGH.
The Vin in on the Arduino goes to Pin 8 of the driver IC (VC). Pins 4, 5, 12, and 13 all go to Ground.
// steps value is 360 / degree angle of motor
#define STEPS 200
// create a stepper object on pins 4, 5, 6 and 7
Stepper stepper(STEPS, 4, 5, 6, 7);
Verify that your Arduino is controlled by an outside DC power supply before running the code. At the point when the representation runs, you will see the stepper motor turns a full.
The code for this undertaking is again decent and basic, on account of the stepper.h library that does the greater part of the hardwork.. To start with, you incorporate the library in the sketch.
At that point you have to characterize what number of steps the motor requires to do an entire 360 degree.
Normally, stepper motors will come in either a 7.5 degree or a 1.8 degree assortment yet you may have a stepper motor with an alternate step edge. To work out the strides, simply separate 360 by the stride edge. In the instance of the stepper motor I utilized, the stride edge was 1.8 degrees, significance 200 stages were obliged to complete an entire 360 degree.
Commonly, stepper motor will come in either a 7.5 degree or a 1.8 degree mixed however you may have a stepper engine with an alternate step edge. To work out the strides, simply partition 360 by the stride point. In the instance of the stepper engine I utilized, the stride point was 1.8 degrees, significance 200 stages were obliged to do an entire 360 degree rotation.
Thank you and stay updated..