1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Using a mouse optical encoder

Discussion in 'Robotics & Mechatronics' started by shehry, Feb 1, 2006.

  1. shehry

    shehry New Member

    Joined:
    Mar 27, 2005
    Messages:
    22
    Likes:
    0
    hi,

    i was trying to use the digital optical encoder in a mouse to calculate the rpm of my motor. i was trying to see what kind of output do the IR sensors send to the mouse controller em84510ep. but giving common ground to the oscilloscope tends to hang the mouse.

    does anyone know how to use the ir sensors in a mouse. the mouse has a white and black transmitter and receiver. the transmitter has two pins and the receiver has three.

    now two pins (one each of transmitter and receiver) are connected to gnd. the other pin of the transmitter is connected to the mouse controller via a resistor. and the remaining two pins of the receiver are connected to X1 and X2 of the controller.

    can anyone help
     

    Attached Files:

  2. olly_k

    olly_k Member

    Joined:
    Jul 5, 2003
    Messages:
    236
    Likes:
    1
    Location:
    UK
    I can't see your pdf for whatever reason???

    The mouse has probably 'hung' because you have effectively grounded the control signals through the common eath connection between PC and scope. You will need to isolate the oscilloscope or PC earth to make any readings? - Just realise any safety / static etc... implications if doing this! - Do you have an isolation transformer - somthing to consider if you own a scope!!!
    Can you not attach an external (5V?) supply to the mouse while not attached to the computer?

    The sensor is a twin jobby with common junctions hence three leads - how do you think the mouse knows which way you want to move the cursor???
     
  3. panic mode

    panic mode Well-Known Member

    Joined:
    Nov 8, 2003
    Messages:
    1,637
    Likes:
    38
    Location:
    mississauga
    simplest and safest way to fix your scope is to use isolating transformer but you might opt to just remove ground pin from the ac plug.
    as for mouse, it's simply consisting of two quadrature encoders (one for vertical and other for horizontal movement of the mouse).
    sender is one led (not nececarily visible light) which is two wire device.
    on the other end you have two receivers (photo transistors for example).
    this is why there are three wires (one is common). i'm sure you will find tons of examples on how quadrature encoders work or how to use them.
    in fact it's very simple. led shines light at two receivers. when encoder disc (wheel with holes for example) moves in between, you can count pulses and measure position. the nice thing with quadrature is (this is why you need two receivers per channel) that you can determine direction of rotation (often just using pair of D-flip-flops). this means that you will know position very precisely even if encoder wheel vibrates in position. without quadrature, your counter would go loco and keep on counting.

    http://claymore.engineer.gvsu.edu/~jackh/books/model/html/model-182.html
    http://www.engr.colostate.edu/~dga/mechatronics/figures/9-10a.gif
    http://www.engr.colostate.edu/~dga/mechatronics/figures/9-16.gif
    http://lims.mech.northwestern.edu/~design/mechatronics/2000/Team24/encoder_circuit.html
    http://www.armory.com/~rstevew/Public/Motors/Quadrature/Dig_Knobs.gif
    http://www.armory.com/~rstevew/Public/Motors/Quadrature/QuadDecoderCounter.gif
    http://www.seattlerobotics.org/encoder/200304/servo_speed_control.htm
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. shehry

    shehry New Member

    Joined:
    Mar 27, 2005
    Messages:
    22
    Likes:
    0

    i disconnected the ir receiver and transmitter from the mouse and placed them on the bread board. the ckt was something like this. the thing on the left is the transmitter. on the right is the receiver.

    +5 ---(500 ohm)-----|__ __
    gnd -------------------|__| |__|---------gnd
    | |
    | |------------(output)
    (1 Kohm)
    |
    +5

    i think that this circuit should work. but it doesnt. whether obstructed or not, the output is a constant high no matter what. i left the 3rd pin of the receiver open because all i need to calculate is the revolutions not the direction. most probably the bias resistor of the receiver is too low and pulls the output to a high.

    can anyone guide?
     
  6. panic mode

    panic mode Well-Known Member

    Joined:
    Nov 8, 2003
    Messages:
    1,637
    Likes:
    38
    Location:
    mississauga
    aww cmon.... you have to do better than that...
    either use Code button or paste as picture.
    i just found one old pcb of what used to be wheel mouse so it has
    three sets of sensors.
    emitter is just clear LED. electrodes inside it are different length.
    shorter one is anode according to silkscreen and orientation of caps.
    receiver (3-wire thingy) has middle pin connected to V+ (and pin1 of the chip) while the two other pins (quadrature outputs) go to chip which is obviously controller.
    Google helped in finding datasheet for TP8472BP (pins 12,13 for one axis, 14,15 for second and 3,4 for wheel):
    http://www.mikrocontroller.net/attachment.php/60727/TP8472+ps2_.pdf
     
  7. panic mode

    panic mode Well-Known Member

    Joined:
    Nov 8, 2003
    Messages:
    1,637
    Likes:
    38
    Location:
    mississauga
    after glancing datasheet, i've found diagram on page 21 of 23 that shows what i suspected all along - receiver is pair of NPN transistors with common collector.
     

    Attached Files:

Share This Page