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?
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?!
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.
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.
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.