资源描述
光电鼠标改装成扫描仪有没有想过光电鼠标也可以改装成扫描仪?其实这是可能的,光电鼠标里面有个 CCD 器件,虽然只有 16x16 像素,但是移动鼠标时,就可以“扫描”一整片区域。有个国外的 DIY 狂人就做了这种改装。笔者也想试试这个新奇的想法,就吧鼠标拆了。结果发现不能成功。根本原因:人家用的是Agilent的光电鼠标传感器,但是我用的是OM02的。Agilent 那颗有个 I2C 接口,连几根线到并口上,就可以用 I2C 接口读出里面的内容。OM02 也有 I2C 接口,不过这个接口只能在 test mode 下使用,但是芯片资料上没有写出进入 test 模式的方 法。XY LEDREFBTCLKFront ViewSymbolIODescriptionxbx2?Yi?Y3o_X and _Y axis quacks hire outputsXY LEDoLED controlRBINLED output contiolROSCAfROSCBOil chip oscillator frequency controlvDD5.0 voir DC power supplyGNDSxsteni groundREF扎 REFBhitenial referencePDIPower down pin. active highTCLKISerial port clock for testing modeTIOIOSerial data or resting modenoPDRBZ4VddGNDRQSCAGNDROSCB要是知道怎么进入test mode就可以实现扫描的功能了。Optical mouse camAre you using an optical mouse right now? Ever wanted to see your desktop through the eye on the bottom of it? Me neither, I already know I have to clean my desktop :-)People get bored sometimes, and when I get bored I sometimes open up stuff to find out what makes it tick. One time, I did this with an old optical mouse. Well, a mouse only has 2 chips inside: the optical sensor and a chip for the usb/ps2-interfacing. I looked up the datasheet of the optical sensor (which is an ADNS2610) and it told me the sensor has a tiny 18x18 CCD, which can be read out using the serial port (the one which normally interfaces to the PS2/USB-chip).So I start Visual Basic (I usually do my stuff under Linux, but Im no star at using anything graphical like QT or GTK, so for this quickndirty project I fell back in my old habits) and hack something up using a few wires to the trusty ole parallel port. The result: crisp lo-res b&w imaging :-)As you can see, the mouse was over some text with an e in it.One of the more obvious features of a mouse, however, is that it can detect movement. Combine this with the just-aquired imaging features, and we havea ghetto b&w handscanner. This is a scanned piece of a receipt:I can understand you cant wait to have such a handy scanner yourself. And now, you can! The software is downloadable here. The software works on mice which use an ADNS-2610 optical sensor, recognisable by the eight pins, the sun-like mark and the text A2610. Ive seen this sensor in most cheap optical mice that arent too old. To hook it up, check out the pinout in the datasheeet, then on the PCB cut the traces running from the sensors SCK- and SDIO-pins to the rest of the mouse. Then connect the sensor, using a diode, to a parallel port, like this:pp:25adns-2610:GND12+SDIO5 |-+SCKPlug in the USB/PS2-plug (or apply 5V to the Vcc-pin of the sensor), run the software and you should be OK.I got a few questions about whether it would be possible to get the image from the USB or PS/2-port of the mouse, so you can view the image of an unmodified mouse. Theanswer is: In theory, it could be possible, if the microcontroller between the port and the sensor-IC supports some kind of pass-through-mode so you can use it to talk directly to the sensor. In practice though, I dont know of any chip that supports that kind of mode, so the answer wouldhave to be: Nope,as far asI know, it cant be done.By the way, if you search for datasheets, it seems that Agilent has spun off their optical division to a new company called Avage (Mails about thisJoshua Wise mailed me about an optical sensor chip with A2050 on it. Seems the chip is compatible with the A2051, which in itself isnt directly compatible with the ADNS2610, but the basic idea of reading the pixels of the CCD is the same. Joshua created a program for Linux to read out the sensor. Another note: Some mice have the Vcc of the sensor switched by the microcontroller; if you try this hack with such a mouse youll need to connect the Vcc directly to the sensor chip.Carsten Gross mailed me:Hi,Im working on an university project and Im using your webpage as base for my idea to use an optical mouse as motion sensor for a model car.I removed the original optics of the mouse and replaced it with a lens with f=4,6 mm. To check wether the image of the world (as seen by the mouse sensor) is focussed Im using a modified Linux version of the software downloadable on your page: as my mouse has a ADNS-2610 (and not one of the older chips).Please see the attachmentfor a modifiedversionof the softwareby Joshua Wise now running with the ADNS-2610 and Linux.Using the different optics the focus is now near infinity. This way the sensor can be mounted at a safe place in the model car. Perhaps it is necessary to add specles on the floor ;-)The source of the software is downloadable here.He mailed me a second time:Im the meantime we built our own board with the sensor chip here and use it as movement and direction detector.Please see this for the images of the sensor board and the lens. I connect the synchronousserial port of the ADNS-2610with some simple glue logic to the SPI interface of the Atmel AT91RM9200. This way I can use the Linux-kernelsand microcontrollershardwaresupport for reading the data from the motion sensor.The lens is adjustable and the focus can be adjusted to generate a sharp image and the maximum quality value in register 4.EaterOfPies mailed me: This also works with A1610 / ADNS-1610 sensor IC. It appears to bepin compatible but i couldnt find any documentation on it.I have received several questions about using this device as a barcode-scanner. Yes, that would probably be possible, but one would need the right software for that, and Im not interested in writing it. If you think its a goodidea; knock yourself out; the sourcecode ofmy program is provided in the zip-file :)If you used this information or software in any useful project, I wouldnt mind being mailed about it. One thing: mails containing not much more than It doesnt work here, help! will be deleted.Gnyaneshwar, GSM, India wrote at 1 Jul 2010, 17.30:Hi, I would like to know how get captured the scanned images from optical mouse in to VB. Plz let me know plz send me mail: gnyanuDIZA wrote at 19 Jun 2010, 5.29:Hi, its working. i have used LOGITECH: M-BT96a and its running well. thanks to mark_mmjq. i really respect you sir.A.N.other wrote at 4 Jun 2010, 16.46:Ive tried this. Im using a USB optical mouse (microsoft intelimouse), on a laptop running windows. Im not sure where one of the files should be.GAURAV wrote at 29 Mar 2010, 18.28:hi need some help on spi interface of adns2610 with microcontroller how did u achieve 250ns of hold of LSB address in read cycle plz help my mail address is gauravy06Anonymous wrote at 10 Mar 2010, 5.42:If anyone has a question about the frame rate of that method it is because although the internal image processor has access to the image at 1500 fps the chip was never intended to send that image across the serial line in real operation, that is more or less a debug feature and when you request the raw image it doesnt just store the current image and send it to you, it actually sends you the first pixel of the first image then the second pixel of the next image and so on and so forth. what this means is that its 182 times slower than the actual frame rate which is seen by 1500/182 = 4.629 repeating which is pretty close to the frame rate you observed. AndnowthatIvetypedallofthatIfinallylookedupatthepostdate, ohwellmaybesomeonewillfindmyrantingsuseful.Imactuallythinking about modifying one of these things to mount to the underside of a robot thatlltravelataround10fpssoIfigureifIraiseit12xitsdesigned height and focus it then itll work in counts per foot instead of counts per inch and handle the higher speed.John Draice wrote at 29 Dec 2009, 3.42:Alarming information you have heere. Acknowledgment for sharing.Mr. LirDraice wrote at 27 Dec 2009, 6.30:Great post!Just wanted to let you apperecive you accept a newsubscriberr- me!AHT wrote at 19 Dec 2009, 9.24:good issue thankspeter wrote at 1 Nov 2009, 3.15:hi,I wonder if we use the usb cable,how can we do it,thank you. my email: notbaiduMichael wrote at 3 Oct 2009, 20.50:Ive got a Razer Copperhead( ) and its got a2000dpilasersensor,Idlovetoseewhatitcansee,ithasupgradeable firmware too so it might be possible to hack its software. Ill have to crack mine open when I get back from my travels and see what kind of guts it has.
展开阅读全文