Stepper Motor Controlled Stepper Motor | Stepper Motor As a Rotary Encoder

8,532

92

8

Introduction: 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!

Step 1: 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)

Step 2: Program the Arduino Microcontroller

Step 3: 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.

Step 4: 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'.

Step 5: Study the Circuit Schematic

Step 6: Connect the Pushbutton to the Setup

Connect the pushbuttons between 'GND' and 'D12' of the Arduino board.

Step 7: Connect the Controller Stepper Motor to the Amplifier Board

Step 8: 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.

Step 9: 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.

Step 10: 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.

Step 11: 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!

Be the First to Share

    Recommendations

    • Robots Contest

      Robots Contest
    • Space Contest

      Space Contest
    • Lamps and Lighting Contest

      Lamps and Lighting Contest

    8 Comments

    0
    anjoze
    anjoze

    1 year ago

    Thanks for sharing, very interesting.

    0
    KushagraK7
    KushagraK7

    Reply 1 year ago

    Thank you.

    0
    cdavenport
    cdavenport

    Question 1 year ago

    What kind of application would I find this useful?

    0
    KushagraK7
    KushagraK7

    Answer 1 year ago

    This project has two parts:
    1. Using a stepper motor as a rotary encoder, and
    2. Using a rotary encoder to control the position of a stepper motor.

    1. Stepper motor, when combined with appropriate circuitry, can be used as a rotary encoder with smoother performance than the commonly available ones at a very low cost.
    2. Using a rotary encoder to control a stepper motor's position can find a use in a wide variety of position-control applications. For example, adding one or two rotary encoders and stepper motors more to the setup can help one build a robot arm.

    0
    hichm
    hichm

    1 year ago

    Thank You for sharing your knowledge, is that system can work with ESP82? because i think to implement this system as IoT to control things using smart phone

    0
    KushagraK7
    KushagraK7

    Reply 1 year ago

    Using a stepper motor as a rotary encoder, any microcontroller with 2 digital inputs can be used to read the inputs from the rotary encoder board.

    0
    JohnA25
    JohnA25

    1 year ago

    Reminds me of a synchro (google it!).

    0
    KushagraK7
    KushagraK7

    Reply 1 year ago

    Interesting.