Start stop read encoder

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.

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.

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

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.

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

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

4 wire +AB-

I can see that’s a stepper motor, can rotate forever without limits. Is this the same situation as this topic ?

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.

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.

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

Resolved
Tankyou
Ciao