+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 25

Thread: Rotary Encoder not working as expected...

  1. #1
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default Rotary Encoder not working as expected...

    I purchased a couple quadrature incremental rotatory encoders (ACZ16NBR1E-20KQA1-12C) and they're not responding as I had expected.

    To test them, I connected phases A & B to 5V through LEDs and Common to ground. Yes, I know it'll damage my LEDs, but I just wanted to see the encoder work for the first time. I expected to see each LED light up 2 times for every 4 positions of the dial.

    Instead, I see very erratic behavior. Typically the LED only lights up half-way through a position change. Sometimes the LED will stay on after I reached a position, but it occurs much less often than 50% of the time.

    This is my first encoder experience. Please help!


  2. #2
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    Quote Originally Posted by ignisuti View Post
    I purchased a couple quadrature incremental rotatory encoders (ACZ16NBR1E-20KQA1-12C) and they're not responding as I had expected.

    To test them, I connected phases A & B to 5V through LEDs and Common to ground. Yes, I know it'll damage my LEDs, but I just wanted to see the encoder work for the first time. I expected to see each LED light up 2 times for every 4 positions of the dial.

    Instead, I see very erratic behavior. Typically the LED only lights up half-way through a position change. Sometimes the LED will stay on after I reached a position, but it occurs much less often than 50% of the time.

    This is my first encoder experience. Please help!
    hi,
    Have you a sketch showing how you have wired the encoder.?

    Using a 5v supply, you MUST use a series resistor to limit the current thru the LED and switch contacts!

    EDIT: look at this image
    Attached Images
    Last edited by ericgibbs; 17th August 2009 at 04:58 PM.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  3. #3
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    I've just connected them like this as a temporary setup so that I can verify the operation of the rotary encoder. 5V through the LED will GREATLY reduce the LEDs life, but it should last long enough for me to finish this quick test. As for the contacts of the switch, it should handle 5V just fine.

    I don't have a schematic, but it's simple enough to explain. Pins A & B are connected to 5V through an LED and the common pin on the encoder is connected to ground. So as the quadrature encoder moves 4 positions, I expect to see each LED light up twice.

    EDIT,
    Eric, I see the diagram you posted. My setup is just like that minus the resistors.
    Last edited by ignisuti; 17th August 2009 at 05:00 PM.

  4. #4
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    Quote Originally Posted by ignisuti View Post
    I've just connected them like this as a temporary setup so that I can verify the operation of the rotary encoder. 5V through the LED will GREATLY reduce the LEDs life, but it should last long enough for me to finish this quick test. As for the contacts of the switch, it should handle 5V just fine.

    I don't have a schematic, but it's simple enough to explain. Pins A & B are connected to 5V through an LED and the common pin on the encoder is connected to ground. So as the quadrature encoder moves 4 positions, I expect to see each LED light up twice.
    hi,
    OK.
    Its NOT the 5V thats concerns me, its the current thru the encoder contacts!
    Last edited by ericgibbs; 17th August 2009 at 05:01 PM.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  5. #5
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    Quote Originally Posted by ericgibbs View Post
    hi,
    OK.
    Its NOT the 5V thats concerns me, its the current thru the encoder contacts!
    So, are you saying that my setup is invalid for verifying that the rotary encoder works the way I expect it to? If so, please explain.

  6. #6
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    Quote Originally Posted by ignisuti View Post
    So, are you saying that my setup is invalid for verifying that the rotary encoder works the way I expect it to? If so, please explain.
    Have you looked at that image I posted.?

    The switching pattern of the encoder is taken from the datasheet of the type you have posted. I added the small diagram how it should be connected.

    Is your circuit the same as the image, also be sure that you have correctly identified the 'C' pin.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  7. #7
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    Quote Originally Posted by ericgibbs View Post
    Have you looked at that image I posted.?

    The switching pattern of the encoder is taken from the datasheet of the type you have posted. I added the small diagram how it should be connected.

    Is your circuit the same as the image, also be sure that you have correctly identified the 'C' pin.
    Yes, my setup is the same minus the resistors. I would have to disagree if you argue that the resistors are critical for me to see what I'm trying to see.

    Now, you may be onto something by questioning the C pin. I'm very confused if the C pin is on the left or right side. The datasheet shows the pinout with the switch positioned upside down which I find very odd. Eitherway, I've tested with Common being on both left and right and the results seemed the same.

    Hmmm.... Maybe the datasheet is completely wrong and the Common is in the middle!? I'll have to test and report back...

  8. #8
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    Quote Originally Posted by ignisuti View Post
    Yes, my setup is the same minus the resistors. I would have to disagree if you argue that the resistors are critical for me to see what I'm trying to see.
    I'll have to test and report back...
    If you read my posts I have not said that the fact you are not using a current limiting resistor will stop seeing what you are trying to see.!

    What I keep repeating is, without a limiting resistor and the fact that you are using a 5v supply, if an LED fails short circuit you will most likely damage the encoder contacts.

    I am puzzled why you dont want to fit a simple resistor in series with each LED, say 470R.

    Perhaps some other member will help you with this problem.
    Last edited by ericgibbs; 17th August 2009 at 05:53 PM.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  9. #9
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    I've always wondered why some folks just don't like resistors.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  10. #10
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    Resistors are fine. I just made the decision that I'd rather throw away $0.20 worth of LED's versus spend the extra 30 seconds to add resistors for my quick one-time test.

    I don't see how 5V would damage these contacts. They're rated for 5V.

  11. #11
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    Quote Originally Posted by ignisuti View Post
    Resistors are fine. I just made the decision that I'd rather throw away $0.20 worth of LED's versus spend the extra 30 seconds to add resistors for my quick one-time test.

    I don't see how 5V would damage these contacts. They're rated for 5V.
    Your NOT listening, its NOT the voltage thats the problem its the possible high current!
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  12. #12
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    There probably not meant handle more then 10ma of power
    He just knocking off part of his 100,000 cycles maybe have 10 left.
    Rated for 5V don't mean it can can sink a amp
    Burt

  13. #13
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    I think I had the pinout right. Maybe I did do some damage as my results just aren't turning out right.

    I added the resistors as suggested and am now seeing both lights light up with EVERY position change. They only light up during the transition and don't stay lit afterwards. Now I did notice that one light #1 lights up a moment before light #2 while spinning clockwise and light #2 lights up a moment before light #1 while spinning counter-clockwise.

    Although I could write some code to handle this situation, I don't think it's the expected behavior. Am I wrong?

    I ordered a 2nd encoder just incase, but can't seem to find it now!

  14. #14
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,848
    Blog Entries
    13

    Default

    hi,
    Look at this image to see the sequence you should observe.

    The design of the quadrature signal phasing is so that its possible to determine which way the shaft is being turned and by how many indentations. [steps]

    Quadrature of the two signals means they are shifted in phase by 90deg relative to each other.

    The 'detent' stability points on the signals are where the mechanical indents in the switch mechanism are located,, ie: at rest.

    A point to remember is that if switch contacts are subject to switching currents higher than the maximum rated value the contacts can be damaged.
    This damage will cause intermittent closures creating multiple signals to the external equipment.
    Attached Images
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  15. #15
    ignisuti Good ignisuti Good
    Join Date
    Sep 2008
    Location
    Gardner, KS, U.S.A.
    Posts
    51

    Default

    Eric, Thanks. I found your post very helpful.

    This is consistent with my previous understanding. So, looks like I must have damaged the encoder.

    Now if I could only find the backup encoder that I ordered, or I might have a downtime of a few days...

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Identifying and using a rotary encoder, help!
    By dec_lan in forum General Electronics Chat
    Replies: 3
    Latest: 11th August 2009, 03:55 AM
  2. Rotary Encoder
    By vk6kci in forum Electronic Projects Design/Ideas/Reviews
    Replies: 6
    Latest: 20th May 2009, 11:57 PM
  3. PPR for rotary encoder
    By engkeat in forum Robotics Chat
    Replies: 0
    Latest: 23rd December 2008, 04:03 PM
  4. Rotary Encoder with Switch
    By Mike, K8LH in forum Datasheet/Parts Requests
    Replies: 3
    Latest: 24th March 2005, 02:28 PM
  5. Magnetic rotary Encoder
    By sarang1_in in forum Datasheet/Parts Requests
    Replies: 1
    Latest: 28th February 2005, 03:13 AM

Tags for this Thread