Slashdot Mirror


Optical Mice as Cheap Barcode Scanners?

Ikester asks: "I've been evaluating a couple of barcode scanners including the CueCat (which some of you may recall from the failed off- online marketing stint by Digital Convergence) for a cataloging application. However, getting ahold of these 'free' wands is not that easy these days and it occurred to me that an optical mouse's hardware may be able to perform a similar function with the right mouse driver. For example, it could work as a regular mouse until it 'recognizes' a valid barcode. It could then send the code as if the user had typed it. I Googled the web and newsgroups but I didn't find anything relevant. I'm wondering if anybody from the Slashdot crowd has come across such an approach. With the recent proliferation of optical mice I'm thinking this could be the next best input device for linear barcodes. I have limited knowledge about mouse drivers and the actual design of these mice. Is this even possible?"

22 of 72 comments (clear)

  1. How do they work? by Rick+the+Red · · Score: 2
    I've got one, and it works OK, but I haven't a clue how it works -- and I'm an engineer! I thought I knew how it worked until I noticed it seems to work on any surface, including a sheet of plain white paper. What does it see? Perhaps it sees in infrared.

    Anyway, mine works with a mouse pad that's got a picture on it, the desktop, magazines, etc. -- I don't see how it can tell it's now on a barcode and to switch "modes." I think the barcode reader software is going to have to work with the mouse's output and you'll have to manually tell it when it's over a barcode.

    I'd suggest writing an app that logs the stream of mouse movements sent from the mouse driver to your OS, and see what the stream looks like when you pass your mouse over a barcode. It could be made to work, but you'll probably have to do it yourself. Good luck, and let us know if you get it working.

    --
    If all this should have a reason, we would be the last to know.
    1. Re:How do they work? by topham · · Score: 3, Informative

      It takes an image/picture from 300-1000 times per second, runs an algorithm looking for significant features on a very small pixel area, and compares. Very little detail is required to actually work as any contrast at all is enough. (between 2 or more frames)

    2. Re:How do they work? by Rick+the+Red · · Score: 2
      Well, that's what I thought. I guess it can see details in a plain (black or white) surface that my eyes can't.

      After some thought I now retract my earlier statement. I now think this is impossible without hacking the mouse itself. If it works on plain black and it works on plain white, it will simply give a steady stream of mouse movement commands as it passes over a barcode and you won't be able to tell when white ends and black begins, etc.

      --
      If all this should have a reason, we would be the last to know.
    3. Re:How do they work? by crath · · Score: 2

      I agree, it's impossible without severly hacking the mouse; however, the idea is excellent. Now that it's been thrown out on the table, maybe one of the mouse manufacturers will incorporate the concept into one of their mice.

  2. Too bad optical mice don't really work that way... by Speedy8 · · Score: 4, Informative

    Too baad optical mice don't send back data telling the computer the "color" or "opacity" of the serface they are on, they just tell the computer how long it stayed in the same place.

  3. Won't work by Eagle7 · · Score: 5, Informative

    Think about it... when you plug in an optical mouse, you don't need a special driver. So all the optical vs. wheel circuitry must be in the mouse, not the driver. All the mouse is sending over the USB cable is position information, same as a wheeled mouse. All the "take a picture and evaluate the changes" happens inside the mouse.

    As a side note, I'll sell you my Cue Cat for $50.

    --
    _sig_ is away
  4. A Link to start you out. by Merlin42 · · Score: 4, Interesting

    How does an optical mouse work

    I doubt this could be done (at least with any kind of reliability) at the driver level. It definately could be done with a little creative rewiring, but I would not be the right person to ask how to actually accomplish this.

  5. Answer by PD · · Score: 2

    Sorry, no. The mouse would have to scan the data for you, and the hardware just isn't capable of doing that. There's no way to change the way the mouse works with a driver.

  6. Re:Not that easy to get a CueCat? by Rick+the+Red · · Score: 2
    Yeah, right! I wouldn't pay the shipping and handling some of these guys are asking, let alone the minimum bid they want. $5 each for something they got free? No wonder nobody's bid yet! LOL!

    As for the lots of 100, read the auction -- are they lots of 100 or 25? The description is very confusing, and these are not for auction, they're for Buy Now. eBay isn't an auction site anymore, it's a flea market.

    --
    If all this should have a reason, we would be the last to know.
  7. How about a webcam instead? by dozer · · Score: 3, Interesting

    check out SDLcam. I haven't used it yet but it looks sweet.

    Screen Shot

  8. Mature answer? Please? by Ikester · · Score: 2, Insightful
    Thanks for the explanation in the first scentence. However, I don't see why you need to insult.

    You may know about peripheral hardware but based on your "analogy" with OO programming comment, it is clear that you have a lot to learn in that field. I promise that if you ever post a question about OO, I'll give you an honest and mature answer, and I won't call you a moron for asking (even if you are one).

  9. Highly unlikely by TheSHAD0W · · Score: 3, Insightful

    It's a nice idea... Unfortunately, optical mice do all their processing onboard. They don't send any raw data to the PC. I also doubt any use flash memory, and so are capable of a firmware upgrade; and even if they were, it's unlikely they'd have sufficient space to be able to handle both tasks. I suppose the right firmware could make the mouse simply dump raw data upstream and let your PC do the decoding, but that'd also make it incompatible with regular mouse drivers.

  10. Three things. by FreeLinux · · Score: 2

    1. It can't be done with an optical Mouse.

    2. Even if it could be done why all the trouble for a crappy scanner. Do yourself a favor, go to eBay and search for "barcode scanner" find one you like and spend $20.

    3. Just so you know, CCD scanners are Ok. Laser scanners are far more accurate but, they cost a bit more. Oh, don't forget a splitter for your keyboard cable, if it doesn't come with one.

  11. I hate to sound like a commercial, but by jhines · · Score: 2

    Have you tried Pricewatch? It now has a barcode selection for input devices. I find wands with keyboard wedges starting at USD$55.

  12. free cuecat by BigBir3d · · Score: 2

    email me your physical address and i will send it to you, i never did use it for anything. it is still in the original packaging.

    chris at punchit dot net

  13. Modified CueCat by Kizzle · · Score: 3, Informative

    You can get a Modified CueCat for pretty cheap on ebay. They plug into your PS2 port and type out the bar code as plain text as soon as you swipe somthing. No special driver needed, your computer thinks its just a keyboard.

  14. Re:Could work by uradu · · Score: 2

    > Barcode scanners work on the exact same principles as optical mice

    No they don't, unless you mean 2D barcodes. Several posters have already pointed out how modern optical mice work: they compare successive pictures of the mousepad surface, taken many hundreds of times per second. Then they compute motion vectors and transmit those over the wire. You simply have to do the math to see that sending the raw pictures over the wire would overload the bandwidth of the PS/2 connector (PS/2 and USB optical mice send exactly the same type of data over the wire). So no, you couldn't just write a fancier mouse driver, unless you also included your own fancier optical mouse that worked differently.

  15. Re:Ugh by walt-sjc · · Score: 2

    Oh, I HAVE to disagree with you here. Yes, there ARE stupid questions. This one isn't however, and I agree with that point. It's an interesting idea, but would require hacking the mouse hardware which isn't really feasable. But there ARE stupid questions.

    There also are questions where the answer is TRIVIALLY found in Google. Probably at least half the Ask Slashdot questions fall into this category. They have NO BUSINESS being posted. It's stupid to post an Ask Slashdot question if the answer is so easily found in Google.

    Finally, there are the questions that are totally inappropriate for Ask Slashdot, and therefore it's stupid to ask them here. For example, this week someone who apparently was a co-owner in a business was asking an income tax question. HELLO, this is NOT H&R Block! It's News for Nerds! If you are running a business you already HAVE an accountant / tax person who would be the appropriate authority on the subject. Would you REALLY trust a bunch of random nerds to give you good solid advise to an important financial question? Be REAL!

    To sum up, this particular case isn't a stupid question, but we have had a LONG string of really bad / stupid / inappropriate questions on Ask Slashdot lately. The flamming poster is probably just frustrated that the quality of questions has been pathetic and was taking his frustrations out on the wrong person.

  16. Hacked Cuecats are easy to get on eBay for $5 by Smack · · Score: 2

    Which is cheaper than any optical mouse I've seen.

  17. Re:Ugh by Enry · · Score: 2

    The submission process for "Ask Slashdot" should include the warning:

    Have you searched google for this answer yet?

    This question is kinda silly, but at least it isn't one where the answer can be easily found on google.

  18. Easy to do... by cybermace5 · · Score: 2

    ...just not with an existing mouse.

    This would be possible to implement in the mouse firmware.

    I spent last year programming a USB peripheral...the power of USB gives it complexity, but great flexibility. You can configure any USB device to look like a standard HID (human interface device) with minimal effort. Many cheap USB microcontrollers, such as those found in optical mice, have several endpoints available. You can configure a mouse to identify both as a mouse, and a USB keyboard. From there, the mouse just has to find barcodes and send them as if from a keyboard. No special drivers, as HID should be standard for practically all currently used computer.

    On a side note, having programmed a USB device gives you a whole new perspective on peripheral development. I could, if I wanted to, build a Mechwarrior cockpit with two integrated joysticks, system volume control, buttons and switches mapped to keys, all running off one microcontroller and USB port. Maybe someday when I have a LOT more time! :-)

    --
    ...
  19. This is Ask Slashdot in a nutshell: by Wakko+Warner · · Score: 2

    "With the recent proliferation of optical mice I'm thinking this could be the next best input device for linear barcodes. I have limited knowledge about mouse drivers and the actual design of these mice."

    I will let this speak for itself.

    - A.P.

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"