Rotary encoder types question

Hi All, I have question about rotary encoders.

I have some that have a pcb attached and the pins clk, dt,sw,+,gnd. I have it working fine. I've seen some that come without the pcb, are these a different type?

And I read, that there are incremental and exact encoders, which is best for use with Arduino? Or is it more application depending?

Thank you.

Very hard to make a guess but generally the PCB versions might be easier to make connections to.

PCB versions most often use the same component.

Exact/absolute versions tell you where you are as soon as power is applied.

An incremental encoder is the most used version for hobbyists using the Arduino.

The cheap one are most cases mechanical and need debouncing. Then you have the electronic/optical ones like the Bourns M14.


The encoders that come on module PC boards usually have pullup resistors on the module somewhere. If you have just the encoder, or if the module doesn't have pullups, you will have to either add your own, or configure the Arduino pins as INPUT_PULLUP.

Are those the resistors I see mounted on the underside of the pcb?

I actually want ones without the pcb due to space saving. The ones I see have seen have the connections. Output a, output b, switch, and 2 grounds. But I can’t see a + input?!

Omron makes a line of industrial absolute encoders. Good stuff. Built in backup, no position loss if moved while off.

Drawback is you need a di for every bit. 14 bits, 14 di's

Yes.

Where is the 5v in on these?

Thanks

Thanks

If you activate the pull up resistor in the Arduino, there is no need for the pull up resistors. In the other way you must connect them with a 5V point on your Arduino.

If you use the optical encoders, there isn't need for pull up. The outputs are 1 ore 0. Not undefined.

So in the above image. I use input as a pullup and just connected ground, and A & B?

1 Like

You can also get absolute encoders with a serial interface:

If your encoder module has pullup resistors on it, then they are connected to the module's "+" pin, or whatever it is named. If you don't connect 5V to that pin, then the A and B pins are connected together through the pullup resistors. Results can be unpredictable. So if you have resistors on the module, you probably should connect 5V to it too. Then on the Arduino the pinMode() would just be INPUT.

So how do I wire this via pull-up to arduino?

Thank you

Where do you see the pull up resistors on the image from post #9?

I was referring to the pictures in post #4. I don't actually know which one he has.

The Out-A, Out-B, and Switch pins are connected to three Arduino data pins, and both GND pins are connected to the Arduino ground. If you use pinMode() INPUT_PULLUP on those pins, you don't need to add external pullup resistors.

I'd suggest you look for videos on Youtube that explain how the hardware is connected up, and what to do about software.

Thank. I’m ok with writing the code just wanted to understand the pin outs. I have the ones with pcb but want to change to ones without pcb for space saving.

Thanks everyone for you help.

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