# Need help with a getting a stepper motor to work with a photo interrupter

**URL:** <https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538>\
**Category:** General Guidance\
**Created:** [May 6, 2024, 2:05pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538 "2024-05-06T14:05:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![natefx](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@natefx](https://forum.arduino.cc/u/natefx)\
**Post date:** [May 6, 2024, 2:05pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/1 "2024-05-06T14:05:35Z")

</div>

I am pretty new, and self taught. I'm trying to get a stepper motor to move an object through a photo interrupter multiple times, then stop at a certain count. I don't have a copy of the code to show, as I am currently working on it, and it's a mess. The motor is working, and the sensor is working, but not together. Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [May 6, 2024, 2:07pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/2 "2024-05-06T14:07:41Z")

</div>

For help, please read and follow the instructions in the "How to get the best out of this forum" post.

---

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [May 6, 2024, 2:09pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/3 "2024-05-06T14:09:34Z")

</div>

> [@How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681307/1):
>
> Welcome to the Arduino forum! A guide explaining how to get the best out of this forum is available at the link below. Please read it:

> [@Planning and Implementing an Arduino Program](https://forum.arduino.cc/t/planning-and-implementing-an-arduino-program/252364):
>
> From what I can see there are many tutorials about doing specific tasks with an Arduino but I have not come across any that guide a newcomer through the process of planning and implementing a program to make it easy to understand and debug. The following 9 posts in this Thread are an attempt to fill that gap. ...R

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [May 6, 2024, 2:46pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/4 "2024-05-06T14:46:48Z")

</div>

> [@natefx](#):
>
> he motor is working, and the sensor is working, but not together.

They will only work together if the openings in the photo interrupter correspond to the steps of the stepper motor. Then one must ask, what is the real purpose of the photo interrupter'?

---

<div class="post-metadata">

**Author:** ![natefx](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@natefx](https://forum.arduino.cc/u/natefx)\
**Post date:** [May 6, 2024, 2:58pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/5 "2024-05-06T14:58:17Z")

</div>

@Paul_KD7HB Thank you for responding. I'm basically trying to get a wheel to spin say 10 times, then stop at a specific point. I've only ever used Arduino to operate LEDs, or small motors and servos, but not with sensors.

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [May 6, 2024, 3:03pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/6 "2024-05-06T15:03:50Z")

</div>

Stepper motors,by design, make individual, controlled, steps, which can be counted by the controlling software. When the step count shows the wheel has spin 10 times, then do whatever needs to be done. No sensor needed!

---

<div class="post-metadata">

**Author:** ![natefx](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@natefx](https://forum.arduino.cc/u/natefx)\
**Post date:** [May 6, 2024, 3:13pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/7 "2024-05-06T15:13:46Z")

</div>

@Paul_KD7HB Thank you so much!!! I did not consider that. Being new, I was over thinking it. Thank you again.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 2, 2024, 3:14pm UTC](https://forum.arduino.cc/t/need-help-with-a-getting-a-stepper-motor-to-work-with-a-photo-interrupter/1256538/8 "2024-11-02T15:14:13Z")

</div>

Closed on November 2, 2024, 3:14pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
