Author Topic: Weird rotary encoder behavior  (Read 592 times)

0 Members and 1 Guest are viewing this topic.

Offline magborresenTopic starter

  • Newbie
  • Posts: 3
  • Country: dk
Weird rotary encoder behavior
« on: July 24, 2021, 08:02:42 pm »
First post, so forgive me if I'm am in the wrong category.

I am doing a project which involves a rotary encoder. A piece of hardware that I haven't worked much with before but I get how it works.

So I am doing some hardware debouncing using a RC filter, schematic is attached. I have changed the filter resistor to 220 ohm and the cap to 0.22 uF as that was the smallest cap I had on hand.



Both pins have been pulled up to 5V by 10k. When I probe over the filter and turn the encoder in either direction, I see pin B going to 0 but pin A barely reaches 4V. I have no idea why this is happening and I cannot for the life of me get it to work. When I probe directly on the encoder output it works perfectly fine, although with the bounces.

1239108-1


Any ideas as to what is happening?

Any ideas?

 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1108
  • Country: lt
Re: Weird rotary encoder behavior
« Reply #1 on: July 24, 2021, 09:09:59 pm »
I also notice that your channel 2 shows very sharp rising edge, not like channel 1. If pullup is 10k and capacitor 0.22uF I don't think that such edge is possible. Logic level of 4V volts means that voltage divider is somehow formed. There is no other way how such in between voltage can be produced. So something is wired wrong. It happens to all of us. Sometimes we are just blind and can not see obvious things. The fast rising edge means that either pullup is very small, there is no capacitor or capacitor is very small. 4V low level means that some resistor is in series with encoder contacts.

Have you tried to measure contact resistance of encoder? Have you tried to switch A with B, but leave everything else same?
 

Offline magborresenTopic starter

  • Newbie
  • Posts: 3
  • Country: dk
Re: Weird rotary encoder behavior
« Reply #2 on: July 25, 2021, 06:43:06 am »
That was my conclusion as well. I just cannot figure out why that voltage divider forms, since I can measure the pull up on the "faulty" pin to be correct. I'll try to switch stuff around again.
 

Offline magborresenTopic starter

  • Newbie
  • Posts: 3
  • Country: dk
Re: Weird rotary encoder behavior
« Reply #3 on: July 31, 2021, 06:40:20 am »
So the pin I was connected to on the uC was shorted to VCC with 23 ohms of resistance. This was what created the voltage divider. Check your pins. Works perfectly after switching the pin around
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf