Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: encoder inside a scroll mouse  (Read 3117 times)

0 Members and 1 Guest are viewing this topic.

antalves

    Topic Starter


    Beginner

  • I have doubts, therefore I am
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
encoder inside a scroll mouse
« on: September 06, 2016, 04:01:35 PM »
I know that the scroll wheel of optical mice is an encoder. I would like to use it as encoder in a stepper motor controller. But... how to identify correctly that encoder insede a mouse?? I'm disassembling a Microsoft Basic Optical Mouse

[attachment deleted by admin to conserve space]

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: encoder inside a scroll mouse
« Reply #1 on: September 06, 2016, 04:41:09 PM »
 like a good project.you must be a hobbyist and you have an application for a stepper motor and you need to find out how far the stepper motor has moved some object. The type of encoder used in the wheel of a mouse uses a counter to count the number of times of real has moved either forward or backward is done optically with a little light and a photo receiver that to count the number of pulses off of the wheel. If you look at the circuit you may notice that it is mostly a single chip device. Are you thinking that the the hook encoder for the real would be separate and distinct from the encoder used for the rest of the mouse?
The mouse itself sends out the data as a stream of serial bytes. Elsewhere the output of the USB mouse is documented and a driver in software interprets the information. What I'm trying to say, is not electrically or mechanically simple. You have to have a rather sophisticated decoder to filter out the pulses with the information coming from the wheel and not the rest of the mouse.
How far do you want to go with this project? Personally I think it'd be easier just to go out and find a simple decoder that will measure linear motion. it's rather pricey. Those things are usually limited for special commercial applications.
I'll try to see if I can dig up some information about this. But meanwhile, tell us what you already know about this then how far you want to go with it.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: encoder inside a scroll mouse
« Reply #2 on: September 06, 2016, 05:12:22 PM »
here is a link I found that has some information about how Rotary encoders are normally used commercially. The basic concept is used for any time you have some kind of a wheel that turns back and forth and you want to know how far it went in either direction. If you look at this article from  National Instruments you will see how the raw decoder works. It is a quadrature decoder with an index. The article below has some diagrams to illustrate how the raw encoder works.

http://www.ni.com/tutorial/7109/en/

now don't let yourself get snowed by the heavy jargon and all the tactical stuff. This type of encoder is pretty straightforward and is used in lot of the industrial designs. Something like that is used inside your typical mouse for the mouse wheel. Now here's the problem. You have to have a counter to count how far forward and how far backwards the wheel has moved. The wheel movement is very precise and exact and it can resolve positions down to a few thousand 7 inch, if you really need to. However, the ordinary wheel mouse has a little indentation and it did cause the wheel to jump in incremental steps and that prevent you from making very precise measurements. You have to accept the stepping acid is unless you want to redesign the wheel.
Now if you decide to go ahead with using the wheel on the mouse, you'll have to begin to some way of decoding the signals that come from the USB cord.
In fact, to make use of the mouse in almost any application you're going to have to have a small computer to count the pulse is from the encoder or else decipher the USB serial data. In other words, you cannot use of real in a simple mechanical counter. You might be better off just designing your own motion detector and calibrating it yourself.
My guess is you want something that's economical, and building it yourself probably would be the best answer. Off the top of my head I don't know of any low-cost method to track the movement of the servo. However, people would build model airplanes and model cars are deep into this sort of thing and they probably have some ideas about how you can measure servo movement and get the information back in some form.
Off the top of my head that's the best I can do for the moment.
It might help if you could tell what your application is and why you need to have some type of linear measurement tool.

antalves

    Topic Starter


    Beginner

  • I have doubts, therefore I am
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
Re: encoder inside a scroll mouse
« Reply #3 on: September 06, 2016, 06:49:23 PM »
I had no idea of the complexity of the subject. Reading the article whose link you sent, I realized that it is subject to grown people, which is not my case ...

In fact, encoders have very affordable price and I decide now buy one to install in the stepper motor controller.  In the end, what I want is to put together a steering system in a toy car

I realize that you understand a lot about those complicated issues ...

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: encoder inside a scroll mouse
« Reply #4 on: September 06, 2016, 08:36:40 PM »
I was not trying to impress you.
Earlier somebody anted interface amuse and had no idea of how the mouse did communication.
Almost anything noways in son the Internet, just Google it.

https://msdn.microsoft.com/en-us/library/windows/hardware/jj128406(v=vs.85).aspx
This has a diagram of the three bytes send by plain computer mouse.
The USB port only has two wires for differential  data. (That is to avoid noise pickup). So at least three bytes rate needed for the full communication.
I didn't know until I looked it up.

antalves

    Topic Starter


    Beginner

  • I have doubts, therefore I am
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Other
Re: encoder inside a scroll mouse
« Reply #5 on: September 07, 2016, 12:48:19 PM »
Any way: I'm well impressed about you. Continue to give support to us, please.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: encoder inside a scroll mouse
« Reply #6 on: September 07, 2016, 02:39:32 PM »
Will do.  :)