I have a very basic Arduino setup :

  • Arduino Uno
  • Rotary encoder
  • Nema 17 stepper motor + A4988 driver

How can I control the rotation of the motor with the rotary encoder? How can I get it to make one full rotation (200 steps) if I make a full rotation of the encoder (20 pulses)?

UPDATE : I managed to get the driver + motor setup going using this diagram and the code on this page : https://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-arduino/


Now all i need is to properly wire the rotary encoder and add the code for syncing the motor with the encoder.

Can someone help me out with a diagram and a piece of code ?

  • so you can control the motor with commands from Serial Monitor. you can print to Serial Monitor the position of the rotary encoder. but you can't put it together? – Juraj Oct 11 '18 at 11:51
  • Juraj, i am a complete noob when it comes to arduino, i have followed tutorials but none of them have exactly what i need... – Jordan Oct 11 '18 at 11:56
  • can you control the motor with commands from Serial Monitor? – Juraj Oct 11 '18 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.