USB Optical mouse as motor encoder


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    65

    Wink USB Optical mouse as motor encoder

    Last friday an idea came to my mind, I just wanted to share an original idea [maybe not original, who knows maybe someone has already done it.. who knows..]

    It is to use an ordinary USB Optical mouse as an optical encoder. Some obvious benefits are:
    -it tracks direction
    -it tracks speed
    -it's high resolution
    -it's dumb cheap and hyper easy to get
    -it's all ready to use/ circuit made/ nice components
    -no mechanical or optical high precition stuff to calibrate.
    -no need of hard to find absolute or progressive rotary discs, nor printing them.

    NOTES:
    -must not rubbing (for obvious reasons)
    -It has to be really near to rotary surface, AT MOST 1 milimeter.
    -surface must be opaque, uniform and clean.
    -ideally be in dark environtment (inside a box or whatever)
    -for more resolution, just move away from center.
    -for less resolution, come closer to center.

    I began my mouse lab experiments connecting it to my PC with some C++ and API software stuff to intercept mouse data, and I got incredible presition. A limitation is high speed sensing.

    Up to now, I've achieved some 1000 RPM's without problems, comparing to my standard quadrature encoder in a PIC16F628A. over 1000 there are differences...

    I don't know wich is the faulty, if my PC optical mouse or my 16F628 optical encoder [show data on LCD]

    My next experiments will be:
    -test with other motors I have with included quad.encoder at different speeds

    NOW I want to do the NO PC versión. Here is PicBasic Pro in action. I'm actually goring my mouse guts and trying to experiment with data and it's speed limits with a PIC18F4550 and trying to conect it. I just begun PIC version some hours ago but can't read data from mouse to PIC.

    Any suggestion?
    I'll share my advances as soon as they happen.

    (I'm addicted to it... USB has some hypnotizing powers that can't almost let me sleep, been all weekend in it, even I've dreamed with USB TX/RX, female connectors, well, whatever. In fact, here in my country it's now 5:43am and I haven't slept.)

    [sorry my english]
    regards,
    Rodrigo
    Santiago - CHILE
    Last edited by RodSTAR; - 31st October 2007 at 09:56.

  2. #2


    Did you find this post helpful? Yes | No

    Default The part i dont get about USB yet

    Hola Rodstar

    Well i'm sure you have worked around USB devices a lot more than i have since i just made my first steps, and must surely i am wrong, and you can clear a black hole in my mind but..... USB is not as simple bidirectional comunication as RS232. What i mean is that you might need a USB host controller in order to connect USB devices to it (PC brings one), with PIC micros you can only make devices to be connected since it doesnt have the host controller, so you can't connect a USB mouse to a PIC and expect to receive the data.

    On the other hand it would be really usefull to emulate someway the controller behavior with the pic since you can find tons of ideas where a USB device is controlled by a uC. I am just considering USB cameras(cheap), uSB keyboard, MOUSE, USB memory for storage, etc. I had this same question in the USB demo by mister_e asked sometime ago, someone there proposed a small device that could be used to control USB things but it was external and far away from Colombia and Chile .

    check this:
    http://dataweek.co.za/news.aspx?pklN...lCategoryID=34
    Last edited by Josuetas; - 31st October 2007 at 13:48.

  3. #3
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Josuetas View Post
    Hola Rodstar

    Well i'm sure you have worked around USB devices a lot more than i have since i just made my first steps, and must surely i am wrong, and you can clear a black hole in my mind but..... USB is not as simple bidirectional comunication as RS232. What i mean is that you might need a USB host controller in order to connect USB devices to it (PC brings one), with PIC micros you can only make devices to be connected since it doesnt have the host controller, so you can't connect a USB mouse to a PIC and expect to receive the data.

    On the other hand it would be really usefull to emulate someway the controller behavior with the pic since you can find tons of ideas where a USB device is controlled by a uC. I am just considering USB cameras(cheap), uSB keyboard, MOUSE, USB memory for storage, etc. I had this same question in the USB demo by mister_e asked sometime ago, someone there proposed a small device that could be used to control USB things but it was external and far away from Colombia and Chile .

    check this:
    http://dataweek.co.za/news.aspx?pklN...lCategoryID=34
    'Hola' Josuetas,

    Well, capturing USB mouse data into a PIC is just what i'm wondering to get, and it's just what I'm going to try to do as I get back in afternoon into my home-lab.

    Since mouse is only UNI-directional (luckylly much simpler than your link) and this is my really experiment- i'm trying to intercept, to capture data before it gets into USB layer, not as USB data, just as some standard (serial?) data thread from PIC to PIC (mouse to PIC) as to communicate with some kind of HSERIN or something by the kind/style. Theese are just raw ideas maybe just dumb but that's just what I want to prove and test if possible or not.

    Maybe all this is an obvious and simple thing, or just an impossible idea...
    I don't know why but I fell optimistick about this. I want to run home just now to experiment.

    Any suggestions/ideas be welcome

    regards,
    RodSTAR

  4. #4


    Did you find this post helpful? Yes | No

    Default i Have Never seen one inside

    I am so tempted to open the one in my hand..... mmm....

    Good luck

  5. #5
    Join Date
    Oct 2005
    Location
    New Zealand
    Posts
    171


    Did you find this post helpful? Yes | No

    Default

    Anybody done any more with this? I'd love to use an optical mouse for speed measurement - but havent figured out whether the mouse figures out what is happening - or if it just sends out 'dumb' data (series of rough pictures) for the mouse drive installed in the pc to figure out, would love to hear from anyone who's made any progress

  6. #6


    Did you find this post helpful? Yes | No

    Default

    RodSTAR- I have played around some with the "guts" of a mouse! Inside, you will find something similar to this: http://cp.literature.agilent.com/lit...988-9774EN.pdf There are many different types of parts made by Agilent that can be used with a PIC. You are correct with what you say about using the sensor. You see this particular part has a serial output.

    I need to get back to my own experimenting, and I am anxious to see how your project progesses. I will share any of my "revelations"!

  7. #7


    Did you find this post helpful? Yes | No

    Default

    And then there's the ADNS-2051 that also has quadrature outputs. I'm thinking this would be good for applications that do not require "imaging" or X AND Y measurements, but only simple linear speed and/or distance measuring.

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 14:43
  2. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 21:17
  3. Using the optical sensor from a ball mouse
    By lsteele in forum General
    Replies: 5
    Last Post: - 5th September 2007, 17:45
  4. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 18:39
  5. USB on Macintosh (mouse)
    By ronf in forum USB
    Replies: 2
    Last Post: - 19th October 2005, 15:29

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts