# Start stop read encoder

**URL:** <https://discourse.processing.org/t/start-stop-read-encoder/28218>\
**Category:** Electronics (Arduino, etc.)\
**Tags:** homework\
**Created:** [March 3, 2021, 11:41am UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218 "2021-03-03T11:41:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 3, 2021, 11:41am UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/1 "2021-03-03T11:41:09Z")

</div>

Any one explane me howto start and stop read encoder from arduino ?

I read encoder position but i need start and stop from button or proximity  
Who help me please  
Tankyou

PS. when start begin from 0 position.

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [March 3, 2021, 6:05pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/2 "2021-03-03T18:05:47Z")

</div>

Hi @rx015,

Your description is not very detailed, so I’ll guess at the situation. You have something that turns, and you are going to put a micro-switch at each end of the permitted rotation. Connect the micro-switches between 0V and two spare inputs on the Arduino. Set them to pinMode(INPUT\_PULLUP). In your Ard sketch read the digitals and stop the motor that’s driving the rotation. Send the digital values to Processing to put on the GUI. If you post your code I’ll help you do it.

---

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 3, 2021, 7:42pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/3 "2021-03-03T19:42:06Z")

</div>

I have this situation:

- A B gnd  
the encoder is connected to the motor but the motor but the encoder is not used to drive the motor but is used to control a piston that is activated by the encoder steps but once the cycle is over, the encoder must recount from zero and I already do this but I need to start and stop the encoder reading and when the encoder starts counting it must always start from 0

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [March 4, 2021, 3:38pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/4 "2021-03-04T15:38:55Z")

</div>

Your description leaves me with many questions. Maybe a picture would help. Your encoder gives you pulses for forward and back? So you have a position counter in your program? Make a second position counter that you increment and decrement the same. When the end-switch is closed you zero this 2nd position counter.

---

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 4, 2021, 7:22pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/5 "2021-03-04T19:22:22Z")

</div>

I don’t know how to  
Explaneme possible do the encoder any 1000 step set pin 13 on and 1500 off continuously??

 ![encdise](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6b16e872a10b3c9ebfbfd62211bdb77530b657f1.jpeg)

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [March 5, 2021, 11:23am UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/6 "2021-03-05T11:23:44Z")

</div>

How many wires does the encoder have? Did you buy it? can you show link where you bought it?

---

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 5, 2021, 11:32am UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/7 "2021-03-05T11:32:58Z")

</div>

4 wire +AB-

> **[Motore passo passo NEMA 23 STEPPING MOTOR 200 step 5V 1.0A Superior Electric...](https://www.ebay.it/itm/111354209500)**
>
> Le migliori offerte per Motore passo passo NEMA 23 STEPPING MOTOR 200 step 5V 1.0A Superior Electric sono su eBay ✓ Confronta prezzi e caratteristiche di prodotti nuovi e usati ✓ Molti articoli con consegna gratis!

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [March 5, 2021, 12:37pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/8 "2021-03-05T12:37:02Z")

</div>

I can see that’s a stepper motor, can rotate forever without limits. Is this the same situation as this [topic](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/ad4dd3d3d73c51c31ab08ca2a98ea6b4baac5962.jpeg) ?

Do you have link to where you bought the encoder. I want to know if it has 1 data wire or 2 (and 5v, 0v). Can you post your Arduino code please.

---

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 5, 2021, 3:33pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/9 "2021-03-05T15:33:56Z")

</div>

i give you link if you clik on pic to go on ebay it’s have 2 wire to output A,B  
YES motor, can rotate forever without limits.

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [March 5, 2021, 5:21pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/10 "2021-03-05T17:21:33Z")

</div>

Yes, but the encoder, is it the same as the other topic? link? how many wires?

---

<div class="post-metadata">

**Author:** ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)\
**Post date:** [March 5, 2021, 11:52pm UTC](https://discourse.processing.org/t/start-stop-read-encoder/28218/11 "2021-03-05T23:52:55Z")

</div>

Resolved  
Tankyou  
Ciao
