Log in

View Full Version : Wiring "3-pin" Shaft Encoder.


Joel J
25-02-2004, 02:25
Hey everyone. We ordered a few of these (http://embrace.grayhill.com/embrace/IMAGES/PDF/e-33-34.pdf) shaft encoders from http://www.newark.com and are having a heck of a time trying to figure out how they should be properly wired. Does anyone have suggestions or experience with this unusual encoder?

Mark McLeod
25-02-2004, 03:01
Hey everyone. We ordered a few of these (http://embrace.grayhill.com/embrace/IMAGES/PDF/e-33-34.pdf) shaft encoders from http://www.newark.com (http://www.newark.com/) and are having a heck of a time trying to figure out how they should be properly wired. Does anyone have suggestions or experience with this unusual encoder?
Did you purchase the quadrature version rather than the BCD or Gray code versions?
It looks like it's a quadrature encoder with the quad signals on A & B, power on C. I'll have to verify with another electrician in the morning to see if he's had personal experience with this model before.

Joel J
25-02-2004, 03:07
Did you purchase the quadrature version rather than the BCD or Gray code versions?
It looks like it's a quadrature encoder with the quad signals on A & B, power on C. I'll have to verify with another electrician in the morning to see if he's had personal experience with this model before.Yes. Thats how it is supposed to be setup. How do we go about porting that to the digital inputs? Should there be a ground connection somewhere? We connected A to the signal of one digital input and B to the signal of another digital input and C to the +5v on the digital input. We are getting a constant 1 as the input of the encoders no matter how many times the wheels rotate (it does not go through each state). I conclude that this is happening as a result of the pin pulling itself to high (since thats how IFI set things up), because its not getting any input, which hints at an improperly wired system. Is this the case?

Mark McLeod
25-02-2004, 03:18
Yes. Thats how it is supposed to be setup. How do we go about porting that to the digital inputs? Should there be a ground connection somewhere? We connected A to the signal of one digital input and B to the signal of another digital input and C to the +5v on the digital input. We are getting a constant 1 as the input of the encoders no matter how many times the wheels rotate (it does not go through each state). I conclude that this is happening as a result of the pin pulling itself to high (since thats how IFI set things up), because its not getting any input, which hints at an improperly wired system. Is this the case?
Yes, I also believe it's the IFI pull-up that's defeating you. It's high when the circuit is open and high when it's closed by the encoder.

You should be able to connect A/B to signal as you are doing and C to ground. Then the digital input will be high when there is no circuit and low when signal is passed through the encoder to ground.

Joel J
25-02-2004, 03:30
Yes, I also believe it's the IFI pull-up that's defeating you. It's high when the circuit is open and high when it's closed by the encoder.

You should be able to connect A/B to signal as you are doing and C to ground. Then the digital input will be high when there is no circuit and low when signal is passed through the encoder to ground.Aha! I switched the C connector from the +5v pin to the ground pin, as you suggested, and it works properly now. Thanks.

Jay Lundy
25-02-2004, 03:31
Actually the pull-ups are internal to the PIC. You can disable them using a register.

But yeah, try connecting C to ground. It should work then.

[Edit] Hm.. looks like I'm a bit too slow.

Kevin Watson
25-02-2004, 12:55
Actually the pull-ups are internal to the PIC. You can disable them using a register.Well, yes and no. The 18F8520 does have programmable weak pull-ups, but only on port b, which is mapped to digital I/O pins 1-6 on the FRC-RC and interrupts 1-6 on the EDU-RC. IFI has also included 100K pull-ups on most, if not all, I/O pins.

-Kevin

gnormhurst
27-02-2004, 17:21
That encoder advertises a life of 100,000 cycles. I think it is designed to be an electronic knob, and connecting it to a spinning shaft might rack up the cycles pretty fast.

On the other hand, it doesn't have to work for ten years. :)