Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Hardware

Optical Mice as Cheap Barcode Scanners? 72

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?"
This discussion has been archived. No new comments can be posted.

Optical Mice as Cheap Barcode Scanners?

Comments Filter:
  • 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.

    • Re:How do they work? (Score:3, Informative)

      by topham ( 32406 )
      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)
      • 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.

        • 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.
          • That's more in line with what I thought when I posted. Not that it would make a great scanner, but that if it becomes ubiquitous, new and cool applications could be devised for barcodes at the consumer level. Getting people to install yet another peripheral just to scan barcodes doesn't work, as proven by the CueCat. But if the functionality is there, it will be used!
  • by Speedy8 ( 594486 ) on Thursday August 22, 2002 @06:51PM (#4123046) Journal
    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.
  • Actually, it sounds pretty cool.

    However, is the mouse too unwieldy? I can't imagine putting it up next to some of those bar codes on the side of small packages or on some that isn't flat.
    • The mouse is so unweildy that I can't imagine being able to navigate it over a large flat piece of paper with a barcode--The "optical" part of the mouse isn't the whole bottom of the mouse, and because the mouse is so big, it's difficult to mentally picture where the mouse must be in order to scan the code.

      Of course, if there were "guide lines" on the mouse, that would make it easier.

      After the failure of similar devices, why would a manufacturer want to jump into a project like this? Perhaps because a mouse is something everyone has, you wouldn't have to put down your mouse and hunt around on your desk through the clutter to find a little stick that would scan the code--just grab and slide under your mouse..

      It's definitely an interesting idea. Don't know if I'd buy into it, though. I'm pretty comfy with my ancient logitech mouse. =]

      -Sara
  • Won't work (Score:5, Informative)

    by Eagle7 ( 111475 ) on Thursday August 22, 2002 @06:52PM (#4123052) Homepage
    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.
    • Just wait for someone to come out with a "WinMouse" with a 10 meg driver and no smarts inside.
    • You don't need a special driver in most cases, but nothing is stopping you from writing one. Barcode scanners work on the exact same principles as optical mice, and all the hardware is there; it's just a matter of writing a driver that'll do the trick.
      • > 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.
  • by Merlin42 ( 148225 ) on Thursday August 22, 2002 @06:52PM (#4123054)
    How does an optical mouse work [howstuffworks.com]

    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.
  • by PD ( 9577 )
    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.
    • 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
      Well, the hardware in any optical mouse IS capable of doing this - it's the firmware to actually do it thats lacking - unfortunately, I don't think that any optical mouse's firmware is accessible for rewrite, even with a hardware hack - I presume that being unable to rewrite the firmware is what you mean by being unable to change the way the mouse works with the drivers.

      If the firmware were rewritten by any means, though, the way that the mouse interacts with the driver wouldn't have to change, either - it would be sufficient to provide an extra 'button' signal (button 6 maybe - definitely not 'middle') that corresponds to whether the center of the sensor area last became lighter or darker.

      The addition of such a 'button' singal would be sufficient for application software to determine the presence and content of any barcode - assuming that the user was able to move the correct portion of the mouse over a valid portion of the barcode.

      Frankly, though, the easiest device to turn into a barcode scanner would be a simple top-of-the-monitor type webcam :)
  • Tried an Auction Site?

    I make 34 entries on [ebay.com] alone. 24 individual sales, 2 lots of 2, 2 lots of 5, 1 lot of 8, 3 lots of 10 and 2 lots of 100. Ranging in price from around a buck each to 5 bucks each.

    How many do you need? More than 276?

    • 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.

      • 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.

        I didn't think it was that hard to understand. They have 25 lots of 100 CueCats each. Am I missing something?

  • Ugh (Score:1, Troll)

    by Wrexen ( 151642 )
    I think this is proof that the function representing the quality of "Ask Slashdot" questions over time is a strictly decreasing function
    • Re:Ugh (Score:1, Insightful)

      flame on 1. There are NO stupid questions. 2. Your answer is less helpful and creative than the post your griping about. 3. This post is exactly within /.'s mode of operation. He wants to take object A and make it do X function outside its normal operation. The purpose of function X is irrelevant, as is the time/effort factor. 4. You were unkind to the poster who did nothing to you, and sought to build yourself up by taking him down. Every geek hates this, has dealt with this, and I, to name one geek, won't sit quiet for it. /flame
      • 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.

        • by Enry ( 630 )
          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.
        • by Hast ( 24833 )
          "There are no stupid questions; only stupid people" - Dogbert.
  • Now even if it could work (which it wouldn't) It would be cheaper buying a scanner then writing the software to so this sort of thing.
    • It would be enormously cheaper; and has been done hundreds of times over already http://www.microimagesys.com

      There are a few specialized (very) small businesses out there; this being one, that do this type of work for inventories, workflows, invoice cataloging, ad infinitum. Mr. Lunglhofer happens to do a lot of this with DocuShare and (*gasp* don't hurt us please) SharePoint in mind, but it is good stuff. If you have any $100 MFD out there in Wal-Mart or OfficeMax you should be able to find a cheap or free barcode reader for it. I have a few here [but I won't share - I don't work for or even with MIS right now but I have great respect for them].
      • The original was invented at Xerox PARC. I learned this five years ago as a Docutech Production Publisher technician. You can still see them - old blocky looking things - attached to those big 1500 'aircraft carrier' looking machines. Some of the earliest "desktop publishing" concepts came from the Docutech, from what I've read, learned and heard.
  • If an optical mouse was programmed to be a barcode scanner...it would be a CueMouse of course! That is assuming that the fat cats who run the CueCat company don't sue...
  • I worked for a P.O.S. Company (in more meanings than one) Ill sell you a few or just go Borrow a couple a couple from your locale c-store.
  • by dozer ( 30790 ) on Thursday August 22, 2002 @07:55PM (#4123394)
    check out SDLcam [raphnet.net]. I haven't used it yet but it looks sweet.

    Screen Shot [raphnet.net]
    • I does look sweet. I've seen this approach and, although very cool, I think optical mice have a much higher potential of becoming ubiquitous peripherals than webcams (even though you can get a cam for as little as $20-$30).
  • Highly unlikely (Score:3, Insightful)

    by TheSHAD0W ( 258774 ) on Thursday August 22, 2002 @08:24PM (#4123567) Homepage
    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.
    • I agree. Getting the raw data would probably be the most likely scenario. I wonder what kind of bandwidth we're talking about. Integrating the decoding function done by the hardware in the mouse driver itself will probably be too resource consuming. But if it's possible, the driver would have to accomplish both tasks: decode movement AND barcode data (if present).
  • Your optical mouse works by reflecting the light from the LED to the surface and getting a reflection (angle of incedence, etc) from the surface. It works on paper but not on a perfectly smooth surface. It "sees" bumps and irregularities in surfaces and interprets their movements as mouse movement. Unfortunately, not all printing methods produce any irregularities that can be read by a mouse. Try this: set your mouse on a large barcoded printout. Move the mouse very slowly past the bars and see if it jumps as it crosses a bar. Unfortunately, I tried it and it didn't jump. This means that there are still enough surface anomalies for the mouse to see. It just ignores the barcode. Disassembly of the mouse is your best bet. Change the angle that the LED strikes the paper with. It's a good idea, and can be made to work, but it'll probably make the mouse a little jumpy.
  • 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.

    • Regarding #2, I didn't think about it as a replacement for a good scanner. But it could be a way to get barcode scanning to "the people". Instead of asking people to install a crappy piece of hardware that drains miliamps most of the time, get them to install crappy software :)

      If it ever got massified, barcodes could have a renewed life for consumers.

  • Don't listen to the nay-sayers Bubba. You will probably have to perform your own mod to the hardware, but the general optical hardware would work EXTREMLY well as a scanning platform .. for roll over or scan over uses. You will probably have to write your own USB driver, or if you could get the specs on the cue-cat you will have to mod the hack the mouse to emulate the cue-cat and use it's driver.

    "Anything is possible, its all just a matter of time." - me
    • Agreed, this isn't a stupid question at all. Maybe the USB mouse could expose two devices to the USB controller (generic mouse plus barcode scanner). A problem is that they usually only scan when the mouse is pressed down on a surface (there is a microswitch on the base) and I think the IR beam is fixed, so you would have to run it over the barcode fully rather than wave the barcode in front like is done with a normal barcode scanner. It's gonna be a hardware / firmware mod but isn't a big development and would be a unique selling point - maybe one of the smaller taiwanese companies will develop it.

  • Have you tried Pricewatch? It now has a barcode selection for input devices. I find wands with keyboard wedges starting at USD$55.
  • 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
  • Modified CueCat (Score:3, Informative)

    by Kizzle ( 555439 ) on Thursday August 22, 2002 @10:57PM (#4124204)
    You can get a Modified CueCat [ebay.com] 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.
  • What's the point of using a mouse? I've seen Barcode scanners for around AUD$15, where as the cheapest optical mouse i've seen is AUD$35 or so. Seems to be easier and cheaper the buy the wand and get the driver, rather than buy a mouse and kludge it together. It's like using a hairdryer to dry dishes, it might work but a hairdryer costs more than a tea towel!
  • I would bet it is a lot easier to design software for either a webcam or a handheld scanner and they would be much cheaper and accurate.

  • Yes, the optical mouse just sends "movement" information, but it might be possible to write a driver that would recognize a special, purposely-erroneous set of movement data and then begin interpreting the following data as barcode information which it (the driver) then, somehow, types like a keyboard. It would probably need to be a mouse/keyboard driver pair.

    Yes, no?
  • Which is cheaper than any optical mouse I've seen.
  • I Googled the web and newsgroups...
    *Snicker*
  • Realistically, what is the point of even trying this hack? Just to see if you can do it? Why not just spend the 50 or so dollars it would cost to buy an actual barcode scanner? They are simple to use, and simple to install. All you need to do is plug the thing into a PS/2 keyboard port. You can even connect your keyboard at the same time. Scan a barcode when you need to, and type when you need to. I don't know how much an optical mouse is worth these days, but I would imagine it is probably the same cost as a cheap barcode scanner.

    Obligatory link - www.pscnet.com [pscnet.com]

  • Why the hell would you even want a barcode scanner?
  • ...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! :-)
  • I dont think this would work, an Optical Mouse works on a tiny area, where as if you look at bar code scanners, they need to see the whole bar code in one go, (Which is why they can work out if you scan upside now, or at an angle as well).

    What might work is one of those old hand scanners people had before flatbed became cheap for all. Perhaps, Im not sure but it seems more likely then a mouse.
    • WRONG.

      Barcodes are not read that way. Laser scanners sweep a beam across the barcode, and read the changes in reflected intensity serially.

      Handheld barcode wands use a LED, and read the data, using algorithms to adapt to the changing speed at which the user passes over the barcode.

      Technologically, an optical mouse is _very_ similar to a barcode wand. The only limitation would be the mouse firmware. Optical mice don't send the raw data back to the PC, just the decoded data. You would need to modify the mouse's firmware to have it be capable of decoding barcodes.
  • "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.

Real Users know your home telephone number.

Working...