Stepper Motor Controlled Stepper Motor | Stepper Motor As a Rotary Encoder
by KushagraK7 in Circuits > Arduino
10353 Views, 96 Favorites, 0 Comments
Stepper Motor Controlled Stepper Motor | Stepper Motor As a Rotary Encoder
Have a couple of stepper motors lying around and want to do something? In this Instructable, let's use a stepper motor as a rotary encoder to control another stepper motor's position using an Arduino microcontroller. So without further ado, let's get started!
Get All the Stuff
Here is what you will require for this project:
- An Arduino microcontroller board compatible with Adafruit Motor Shield V2(UNO, Leonardo, etc)
- An Adafruit Motor Shield V2
- A Rotary encoder Stepper motor(Unipolar is recommended)
- A stepper motor to be driven(Unipolar or bipolar)
- 4 male to male jumper wires(For connecting the rotary encoder to the Arduino board)
- 4 male to male jumper wires(For connecting the stepper motor to the motor shield)
- A 5 to 12-volt DC power source(As per the requirement of the driven stepper motor)
Program the Arduino Microcontroller
Install the Motor Shield on the Arduino Board
Align the pins of the motor shield with the headers of the Arduino board and make sure no pins get bent.
Connect the Stepper Motor to the Motor Shield
Connect the stepper motor's coil pair wires to the output terminals of the motor shield marked 'M3' and 'M4'.
Study the Circuit Schematic
Connect the Pushbutton to the Setup
Connect the pushbuttons between 'GND' and 'D12' of the Arduino board.
Connect the Controller Stepper Motor to the Amplifier Board
Connect the Amplifier Board to the Arduino Board
Connect the +ve and -ve pins of the amplifier to +5-volts(or +3.3-volts if using a 3.3-volt logic Arduino microcontroller) and 'GND' respectively.
Connect the output pins of the amplifier board to the digital inputs 'D5' and 'D6' of the Arduino board.
Connect the Setup to Power
Connect the setup to an appropriate DC power source. Here, a mobile phone charger is being used to power the setup through the Arduino board's onboard USB connector.
Test the Controls
If the motor to be driven does not move properly and steps back and forth, tighten the wire connections, and if the problem persists, change the sequence of the stepper motor's wiring connections made with the motor shield.
Share Your Work
If you have got it working, why not share it with the community. Doing so, will inspire others to make the project too. All the best!