Sorting out a rotary encoder?

Discussion in 'The Projects Forum' started by GRNDPNDR, Feb 2, 2013.

  1. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    I just took apart a printer and it had a nice little motor/encoder assembly in it, but there are no numbers on the encoder to look it up.

    it looks to have 5 pins, and if it's at all possible I'd like to hook it up to my arduino and play with it a bit.

    Anyway to figure out which pins do what?

    [​IMG]

    [​IMG]
     
    Last edited: Feb 2, 2013
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Check with a DMM.

    I'd guess the pins are something like

    Motor Power
    Ground
    Encoder LED/Transistor power
    Encoder A out
    Encoder B out

    Something like that, It may just be a single slot interrupter/counter, rather than a quadrature encoder (counter + direction), in which case there might be a signal ground and one output instead of 2 outputs and sharing the motor ground.

    I didn't trace the board out completely, too much flash bounce on bottom, and not a good view on top, but that should give you a rough idea of what you are looking for.
     
  3. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    The motor pins are dedicated and are the two large traces on the board.

    I removed this from the scanner portion of the printer, so it has to be bi directional.

    What test could I do with a DMM to determine which pin was which for the encoder portion?
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Use diode check, the right two pins are probably the LED, I'm unsure what the left 3 pins are, but on Diode check, you should get an idea.

    If it is a phototransistor, you'll need to apply power, assuming you have the wiring harness for it an know which lines were power and ground?
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    Can you tell us which printer it came out of? I might have one too.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    It's a standard 5 pin pinout for a dual sensor encoder with one LED. The left 3 pins are the dual optosensors, the middle pin is always ground.

    That middle pin is also connected to the ground (cathode) of the LED (the right 2 pins is the LED).

    Connect the LED to 5v through a 330 ohm resistor, and connect the top and bottom pins of the two sensors (their 2 outputs) to 5 through 33k resistors.

    Then you will get quadrature signals at logic level from the two opto sensor output pins.

    (note) That PCB already looks to have the LED resistor on the LED anode, and two pullup resistor on the two opto sensor ouputt pins. So if you want to use that opto sensor on that motor it is already wired up you just need to apply 5v to the plug and two pins with be the logic level outputs.
     
  7. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    Awesome thank you.

    what I don't understand is why I would put 5V to the outputs of the encoder.... or did I misread something?

    The motor looks to be driven by it's own two pins.

    The middle pin is ground and the two outer are the outputs?
     
  8. KnRele

    New Member

    Jan 7, 2013
    20
    8
    From what it looks like, the resistor marked R1 is for the emitting diode, and the resistors R2 and R3 are for the two detectors.

    The detectors are photo-transistors that conduct when they are illuminated (by the emitting diode) and do not conduct when in the dark.

    Think of them as similar to single-pole single-throw switches, that connect the ouput line to the GND (zero volt) line when they are illuminated and ON, and they act as open switches when in the dark, and their output lines are not connected to anything. To ensure that the voltage here will be predictably High (near the level of the +5V supply) when the switches are open, resistors (your R2 and R3, from the picture) are connected between them and the +5V line -- that way, the voltage on the outputs will be readable by a subsequent circuit in all cases.

    By turning the shaft of the motor slowly by hand you should be able to see the variations in the output voltages on a multimeter.
     
  9. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I think you have misread something, but it's not your fault.

    It makes sense if "you just need to apply 5v to the plug and two pins with be the logic level outputs."

    was meant to be

    "you just need to apply 5v to the plug and two pins WILL BE the logic level outputs."
     
  10. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    That would explain the 6 pins.
    2 grounds
    2 Vss
    2 outputs.
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,647
    2,346
  12. GRNDPNDR

    Thread Starter Member

    Mar 1, 2012
    435
    7
    I'm familiar with encoders, gray code and such, it is just incremental, but is also bi-directional.

    It was just for making a scanner head from an HP PSC-1210 printer go back and forth.
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Yes, the fault was mine it was a typo! :)
     
Loading...