How to Sync Arduino Board and stepper motor with my experimental setup?

Hi, I am using elegoo UNO R3 board with 28BYJ-48 stepper motor. I have a experimental setup which is synced with the help of TTL signal. I can control the the UNO board and stepper motor. Now I want to sync the board and motor with my experimental setup in a way that A trigger in my setup triggers the stepper motor and stepper motor moves certain number of steps and then moves back after a delay. And again moves when next trigger comes in from the experimental setup I have searched a lot, I wasn't able to get the answer. I am new to arduino.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html

If you are using a stepper you need to sense that the stepper is positioned at the start point. You can do this by having a limit switch turn on when the stepper shaft is in the start position.

That way, Everytime you turn your project ON, In void setup(), - If the stepper is not in its start position, that is limit switch is OFF. - Then rotate the stepper backwards til the limit is ON. - If limit is ON - Continue to void loop()

In void loop() - Wait for the trigger - Step forward required number of steps - Wait - Step backward till limit is ON

Can you tell us your electronics, programming, Arduino, hardware experience?

Hope it helps.. Tom.. :)

Hi Tom,
I have just started using arduino 3 days back, so my experience is really less
I understood your reply.
But Can you help me with following more questions

  1. How do I wait for trigger?
  2. On which pin of arduino, I should connect my trigger from external setup? Can I connect it to any pin in the board?
  3. What kind of trigger would be fine for arduino? In terms of duration of pulse and shape?
  4. What is limit switch and how do i turn it on?

The code I use right now is fairly simple and I have attached it. How can I modify it to implement the functions you suggested

If i need to increase the speed with which my motor moves, what type of stepper motor I can use? The motor i currently use has 15 rpm speed, i need rpm speed of around 100. Please help me with that as well.
How can I move my current motor at maximum speed?

I know I have asked a lot of questions in single reply. Please help me with answers

Stepper_back_and_forth.ino (451 Bytes)