Here's the pinout thanks to kako and a PCB picture. The Reset pin is active low, so use a pullup resistor to Vcc. The Wiimote runs the camera with a 25Mhz clock, but it also works with a 20Mhz clock so you might get away with fudging this a bit. The I2C communication is fast 400Khz and the slave device address is 0xB0. Most microcontroller development platforms should include I2C communication capabilities. If yours doesn't, get a better dev kit =o). Desoldering the camera can be hard with so many pins. But, careful use of a hot air gun will do the trick. The first part is to initialize the camera over I2C. Here's the pseudo code for initializing to maximum sensitivity (actual CCS C code in comments):
- write(hex): B0 30 01
- wait 100ms
- write(hex): B0 00 00 00 00 00 00 00 90 //sensitivity part 1
- wait 100ms
- write (hex): B0 07 00 41 //sensitivity part 2
- wait 100ms
- write(hex): B0 1A 40 00 //sensitivity part 3
- wait 100ms
- write(hex): B0 33 03 //sets the mode
- wait 100ms
- write(hex): B0 30 08
- wait 100ms
It's still somewhat mysterious to me what all these mean, but in this mess is the sensitivity and mode settings described at Wiibrew. The above code uses the sensitivity setting suggested by inio "00 00 00 00 00 00 90 00 41, 40 00" experssed in the 2nd, 3rd, and 4th message. The wait times are conservatively long. After you initialize, you can now read samples from it:
- write(hex): B0 37 //prepare for reading
- wait 25us
- write(hex): B1 //read request
- read 8 bytes
- wait 380us
- write(hex): B1 //read request
- read 4 bytes
This yeilds one sample from the camera containing 12 bytes, 3 for each of the 4 potential points. The format of the data will be the Extended Mode (X,Y, Y 2-msb, X 2-msb, Size 4-bits). The wait timings approximate what the Wiimote does. I've called this routine 1000 times per second without ill effect. Though, I doubt this is actually scanning the sensor and instead is just reporting the contents of an interal buffer. But, people claim 200Hz updates are possible. So, you can use that as a suggestion.
Hooking this up to your microcontroller is pretty straight forward. Give the camera 3.3v power using a voltage regulator, ground, a 20-25Mhz clock, and connect the SDA and SCL lines (don't forget your pull up resistors), and pull up the reset pin.
The CCS C Compiler for the PIC18F4550 includes USB-HID sample code. It's simply a matter of stuffing the data you got from the PixArt camera into the input report buffers for the USB. With this, you could actually create a USB mouse profile and make it control the cursor without any software or drivers at all. If set it up as a full speed device, it's possible to get 1ms reports providing extremely low latency updates. CCS provides relatively affordable PIC programmers as well. Explaining how to set all this up is not within the scope of this post, but it should be plenty to get you started. If you want to make a PCB, you can try ExpressPCB which can get you boards in-hand for as low as $60.
Update 9/6/08: Just a note about the clock. Since my PIC was using a 20Mhz resonator, I just piggy backed the Pixart clock pin off the OSC2/CLKO pin of the PIC which seemed to work fine. Also, Kako has more details (in Japanese) on doing this with an Arduino
void initPixArtCam3(void)//max from inio
ReplyDelete{
i2c_start();
i2c_write(0xB0); i2c_write(0x30); i2c_write(0x01);
i2c_stop();
delay_ms(100);
i2c_start();
i2c_write(0xB0);
i2c_write(0x00); i2c_write(0x00);
i2c_write(0x00); i2c_write(0x00);
i2c_write(0x00); i2c_write(0x00);
i2c_write(0x00); i2c_write(0x90);
i2c_stop();
delay_ms(100);
i2c_start();
i2c_write(0xB0);
i2c_write(0x07); i2c_write(0x00);i2c_write(0x41);
i2c_stop();
delay_ms(100);
i2c_start();
i2c_write(0xB0);
i2c_write(0x1A); i2c_write(0x40);i2c_write(0x00);
i2c_stop();
delay_ms(100);
i2c_start();
i2c_write(0xB0);
i2c_write(0x33); i2c_write(0x03);
i2c_stop();
delay_ms(100);
i2c_start();
i2c_write(0xB0); i2c_write(0x30); i2c_write(0x08);
i2c_stop();
delay_ms(100);
}
void readPixArtCam(void){
i2c_start();
i2c_write(0xB0); // Device address
i2c_write(0x37); // Data to device
i2c_stop();
delay_us(25);
i2c_start(); // Restart
i2c_write(0xB1); // to change data direction
out_data[0]=i2c_read(); // Now read from slave
out_data[1]=i2c_read(); // Now read from slave
out_data[2]=i2c_read(); // Now read from slave
out_data[3]=i2c_read(); // Now read from slave
out_data[4]=i2c_read(); // Now read from slave
out_data[5]=i2c_read(); // Now read from slave
out_data[6]=i2c_read(); // Now read from slave
out_data[7]=i2c_read(0); // Now read from slave
i2c_stop();
delay_us(380);
i2c_start(); // Restart
i2c_write(0xB1); // to change data direction
out_data[8]=i2c_read(); // Now read from slave
out_data[9]=i2c_read(); // Now read from slave
out_data[10]=i2c_read(); // Now read from slave
out_data[11]=i2c_read(0); // Now read from slave
i2c_stop();
}
awesome! now what we need is a cylindrical lens to widen the field of view and we could mount it on top of a short throw projector.
ReplyDeleteHey Johnny,
ReplyDeleteIs it possible for you to post a schematic of how the crystal should connect to the IR camera?
Thanks,
NP
Does that camera have hardware tracking as part of the component by it's self? If so, how fast can you get it to track? Are you still limited to the original 100hz over Bluetooth?
ReplyDeleteEven so, that's a very cool camera. If I can get my hands on a Wii remote at GoodWill (not likely) or something, I will definitely give this a try.
The info at WiiBrew is ancient. The Wiimote Project Wiki has much more detailed sensitivity configuration info
ReplyDeletehttp://wiki.wiimoteproject.com/IR_Sensor
Hi,
ReplyDeleteI tried your protocol with the Renesas 2377 using I2c.
However, it keeps returning me with 0xFF.
Is there a initialization sequence before i start writing sensitivity, mode or reading?
Does anyone faces the same problem?
Ken
Hi Jhonny.
ReplyDeleteIm Túlio Cunha from Vitória (Brazil). I Would like to invite you to do a participation with me on the II Biennali of Sea here in Vitória. The proposal of the work are to urban artalong the Avenue Mal Mascarenha de Moraes (http://maps.google.com/maps?f=q&hl=pt-BR&geocode=&q=vitoriA&ie=UTF8&ll=-20.322273,-40.333235&spn=0.00994,0.013819&t=h&z=16&iwloc=addr)
Please contact me for more details: tulio.cunha@hotmail.com or 55 27 92453913.
Please send me or contact too.
Im posgraduating student of urbanism in UFES.
Thank you.
You are well come.
What could you do with the Fitbit Tracker?
ReplyDeletehttp://fitbit.com/faq
hi~~~
ReplyDeletewe can use your idea to build new featrue like the computer technologies in the film "iron man"
HI there like Jianliang i use your code, but i use in a self made board and code in asseembly, and i can only get 255(0xFF) in all responses.
ReplyDeleteDoes some one have any idea of the motive? ps i use a 12Mhz cristal but im almost sure its not the problem.
Hi Johnny!
ReplyDeleteHave tried to use the Pixart cam and the accelerometer together?
I mean, its possible to connect the accelerometer directly to a PIC?
Many thanks from Buenos Aires.
Federico
hi BioBaguear i have done this alot of time white pic's
ReplyDeleteThe sensor is only 3 analog output's
bing 2,5v-0G 5v-3G and 0v-(-)3G
heres an exemple http://www.pyroelectro.com/projects/car_gmeter/
Ricardo thanks for the information.
ReplyDeleteI have another question maybe someone knows. Its possible to connect the wiimote directly to the pc via serial? I need to keep a constant sampling rate, so I think that the bluetooth would be a big problem.
Maybe the best its to take out the cam and the accelerometer and make my own device.
What do you think?
yes thats the best option to the fastest update rate.
ReplyDeleteJust find yourself a pic whit i2c and 3 analog inputs plus usb. Then ask some samples from the website.
Hello !
ReplyDeleteAmazing work !
Does anybody has schematic of the circuit? (Pixart Cam to USB)
Thank you in advance, contact me at milou645@hotmail.com and let's share some experiences ;-)
Emilien
Ken, Ricardo, we ran into the same problems. It appears to be solved by asking for location 0x36 instead of 0x37 (and throwing away the first byte) inside the polling loop.
ReplyDeleteThere is no explanation on why 0x37 doesn't work (while it does work in the polling loop for the Wiimote), yet there it is.
Todo un conjunto de sistemas muy utiles...... y muy interesantes que serian muy buenos en paìses en desarollo.....
ReplyDeleteVisiten estas paginas.....
http://www.kokoa.espol.edu.ec/
http://www.espol.edu.ec/
The schematic would be a great help to everyone looking at doing this :) any chance?
ReplyDeleteThx
SC
Hi all,
ReplyDeleteHas anyone tried to take apart the accelometers from the wiimate and connect them to a microprocessor. It seems like a waist to open the wiimote and just take apart the cam
Thanks
Bobster23
Hi everyone,
ReplyDeleteI´m still working with the camera.
I was able to get data from the camara with the pic, but I don´t know why I get a constant 00h in the X0 data register.
Do you think that it´s a configurational problem?
I´m using C18 instead of CCS like Johnny did.
Interestingly, X0 its the first data after sending the comand for changing the data direction.
Many thanks in advance.
Federico
I don't have much patience working with Assembly Language-like Instruction Set Architectures. You can buy ready to use devices from wholesale general merchandise shops without having to tweak these stuff.
ReplyDeleteLevi jeans
ReplyDeleteDiesel Jeans
Levis Jeans
ed hardy clothes
Wholesale Handbags
babolat aeropro drive
I love your articles, they are really wonderful. And welcome to my blog. We have the same opinions on something.
ReplyDeleteHow do you think of polo cotton shirt? Do you want to be a fashion chaser? In our store online you can chase the most popular ralph lauren women shirts. it can help you increase your attraction.
My friends and I also want to buy excellent tennis prince, and I know there is a perfect store recently, which sells perfect tennis rackets.In order to play the game and search the place where can buy the
tennis racket, we find many places, and finally, we find tennis set shop.
would you want to be more attractive? If your answer is "Yes", you can wear spyder
jackets, you really need a pair of north face jacket. They can make you become the focus.
women's polo hoodies
men's polo shirts
spyder jacket
head racquets
babolat racquets
wilson racquet
ralph lauren t shirt
polo women shirts
black polo
prince tennis accessories
discount tennis racquets
wilson tennis racquets
come comprare cialis
ReplyDeleteapotheke cialis
controindicazioni viagra
levitra rezeptfrei bestellen
vente de viagra
vente viagra
acheter viagra
viagra efectos secundarios
acheter du levitra
como comprar cialis
rezeptfrei cialis
prix levitra
kamagra oral jelly en ligne
ReplyDeletecialis generico
viagra rezeptfrei
comprare kamagra oral jelly
onde comprar cialis
diflucan farmacia
ohne rezept cialis soft kaufen
cialis soft rezeptfrei
comprare kamagra senza ricetta
kamagra bestellen ohne rezept
cialis soft kaufen
comprare clomid
If so, how fast can you get it to track? Are you still limited to the original 100hz over Bluetooth?
ReplyDeleteBuy Dissertation | Buy Essay | Buy Research Paper
I Would like to invite you to do a participation with me on the II Biennali of Sea here in Vitória.
ReplyDeleteBuy Term Paper | Buy Thesis
strattera rezeptfrei
ReplyDeletestrattera rezeptfrei
kamagra oral jelly kaufen ohne rezept
silagra rezeptfrei
lovegra ohne rezept bestellen
viagra soft bestellen ohne rezept
amoxil bestellen
viagra super active rezeptfrei bestellen
prezzo lasix farmacia
ReplyDeletepropecia achat france
acheter pilule
kamagra oral jelly preisvergleich
clomid farmacia online
prezzo tadalis sx italia
lasix farmacia
amoxil bestellen
cialis soft vendita italia
vente clomid en ligne
zyloprim rezeptfrei kaufen
cialis super active prix pharmacie
achat paxil
vendita kamagra oral jelly
strattera bestellen ohne rezept
Prix cipro France
ReplyDeleteVendita kamagra Senza Ricetta
Prix levitra France
Comprare proscar Farmacia
Achat strattera en ligne
clomid Rezeptfrei Kaufen
inderal Rezeptfrei
I was able to get it working on my Microchip PIC24FJ64GA002 using the I2C peripheral libraries.
ReplyDeleteI sent the request command 0x37 as suggested by Johnny Chung Lee and it seemed to work.
I have posted the source code on my website along with a few pictures of problems I encountered:
http://web.uvic.ca/~gleung86/courses/499/tracking/
Hope it helps!
Lose Weight with medicine:
ReplyDeletephentermine without prescription fat 16
phentermine 37.5 without prescription to doctor
phentermine 37.5 no prescription meds
phentermine 37.5 mg pill
phentermine 37.5mg online p
phentermine 37 5 health
phentermine 37.5 slim
anxiety medication wellness
phentermine 37.5 fitness
phentermine 37.5 mg no prescription
Generic Flomax
ReplyDeleteNYC limousine service Pickups is a full NYC limos service Company Serving Tri State NYC- CT and NJ with luxuries sedans, Stretch SUV, and New York city limos. NYCLimopickups is the preferred for individuals who demand personal service and a professional transportation experience at reasonable rates. Limo service nyc offers 24 - hour service with advance reservations. NYCLimopickups is rated #1 as New york city limousine and New York Limousine services
ReplyDeleteThose are best online website , best service , best quality. Good luck to you.
ReplyDeleteed hardy clothing
Chaussures Sport
Tennis Racquet Shop
Cheap Polo Shirts
The North Face Jackets
cheap ed hardy
Chaussures Sport
Tennis Racquet
nike shox r4
ed hardy
cheap ed hardy
polo shirts
cheap polo
Remise Chaussures Sport
nike tn requin
ed hardy clothes
nike femmes chaussures
A lot of very smart people have written in questions and suggestions and wmv to iphone
ReplyDeleteavi to iphone converter I think a lot of them are very clever and worth sharing... and I'd
Breitling Bentley have been the de facto standard for aviators across the entire planet for over 100 years now, and with good reason. Not only do they look the business but Navitimer Watches have a whole range of features built in that just make a pilots life easier. The Navitimer World emergency watch, as well as being a very attractive Montbrillant Datora , uniquely has a built-in transmitter that operates on the international aviation distress frequency of 121.5 Mhz.
ReplyDeleteThe moment you put on Christian Louboutin Sale they go on to become a wardrobe enhancer and put you several notches above on the ladder of success. The wearing of the Christian Louboutin Pumps enables one to anchor and team Christian Louboutin Sandals with the very best of people and things available. Christian Louboutin Boots can be found in different color tones and can be matched just so very right with the entire outfit and the look that you want to portray.
The quality of Coach Wallets is uncompared and your purse will last a life time and look good all through the years. Coach Hamptons are fashionable and can match just about any outfit. The Coach Legacy leather is exquisite, the Coach Luggage locks with a logo letter C and the style is just what every woman wants to have.
Dell inspiron b120 battery
ReplyDeleteDell xps m1210 battery
Dell inspiron xps m1710 battery
Dell inspiron 1100 battery
Dell 310-6321 battery
Dell 1691p battery
Dell Inspiron 500m battery
Dell 6Y270 battery
Dell inspiron 8600 battery
Latitude x300 series battery
Dell latitude cpi battery
Dell 1x793 battery
dell Inspiron 1501 battery
Dell 75UYF Battery
Dell Inspiron 1720 battery
dell Latitude C640 battery
Dell XPS M140 battery
Dell Inspiron E1405 battery
dell 700m battery
dell C1295 battery
Dell U4873 Battery
Dell Latitude C600 battery
Armada E700 Series battery
Compaq 116314-001 battery
Compaq 319411-001 battery
Compaq nc4200 battery
Compaq Presario R3000 Battery
Compaq Presario 2100 battery
Compaq Presario r3000 Battery
ReplyDeleteCompaq Business Notebook NX9000 series battery
HP 395789-001 battery
HP 446506-001 Battery
HP dv9700 battery
HP F4809A Battery
HP nc8000 battery
HP nc8230 battery
HP pavilion zd8000 battery
HP f2024b battery
HP f4812a battery
HP Pavilion ZV5000 battery
HP Pavilion DV1000 battery
HP Pavilion ZD7000 Battery
HP Pavilion DV2000 battery
HP Pavilion DV4000 Battery
HP Pavilion dv6000 Battery
HP Pavilion DV9000 Battery
HP F4098A battery
HP pavilion zx6000 battery
HP omnibook xe4400 battery
HP omnibook xe4500 battery
HP omnibook xe3 battery
Notebook NX9110 battery
IBM 02K6821 battery
IBM 02K7054 battery
IBM 08K8195 battery
SONY VGP-BPS2B battery
ReplyDeleteSONY PCGA-BP1N battery
SONY PCGA-BP2E battery
SONY PCGA-BP2NX battery
SONY PCGA-BP2S battery
SONY PCGA-BP2SA battery
SONY PCGA-BP2T battery
SONY PCGA-BP2V battery
SONY PCGA-BP4V battery
SONY PCGA-BP71 battery
SONY PCGA-BP71A battery
SONY VGP-BPL1 battery
SONY VGP-BPL2 battery
Sony vgn-t2xp/s battery
Sony vaio vgn-s4xp battery
Sony vaio pcg-z1rsp battery
SONY NP-FT1 battery
SONY NP-FC10 Battery
SONY NP-F330 Battery
SONY NP-F550 Battery
SONY NP-FM50 Battery
SONY NP-FP50 Battery
SONY NP-55 Battery
SONY NP-FM70 Battery
SONY NP-33 Battery
SONY NP-F970 Battery
SONY NP-FP90 Battery
FUJITSU Lifebook C2220 battery
FUJITSU Fpcbp63 Battery
FUJITSU Fpcbp68 Battery
Cheap Christian Louboutin Shoes
ReplyDeletecheap air jordan shoes
Ralph Lauren Polo Shirts
Nfl jerseys
Christian Louboutin Sandals
nike air jordan shoes
Polo Shirts
Nhl jerseys
Christian Louboutin Pumps
michael jordan shoes
Mens Polo Shirts
Mlb Jerseys
Manolo blahnik shoes
jordan basketball shoes
Lacoste Polo Shirts
Nba jerseys
Christian Louboutin Shoes Sale
jordan shoes sale
Wholesale Polo Shirts
Authentic Nhl jerseys
Discount Christian Louboutin
Ugg Boots
ugg boots
Christian Louboutin Shoes
discount ugg boots
discount ugg boots
Christian Louboutin Manolo Blahnik
ugg boots sale
ugg boots sale
Christian Louboutin Boots
HP Pavilion DV4000 Battery
ReplyDeleteHP Pavilion dv6000 Battery
HP Pavilion DV9000 Battery
HP F4098A battery
HP pavilion zx6000 battery
HP omnibook xe4400 battery
HP omnibook xe4500 battery
HP omnibook xe3 battery
Notebook NX9110 battery
IBM 02K6821 battery
IBM 02K7054 battery
IBM 08K8195 battery
IBM 08K8218 battery
IBM 92P1089 battery
IBM Thinkpad 390 Series battery
IBM Thinkpad 390X battery
IBM ThinkPad Z61m Battery
IBM 02K7018 Battery
IBM thinkpad t41p battery
IBM THINKPAD T42 Battery
IBM ThinkPad R60 Battery
IBM ThinkPad T60 Battery
IBM ThinkPad T41 Battery
IBM ThinkPad T43 Battery
IBM ThinkPad X40 Battery
Thinkpad x24 battery
SONY VGP-BPL2 battery
ReplyDeleteSony vgn-t2xp/s battery
Sony vaio vgn-s4xp battery
Sony vaio pcg-z1rsp battery
SONY NP-FT1 battery
SONY NP-FC10 Battery
SONY NP-F330 Battery
SONY NP-F550 Battery
SONY NP-FM50 Battery
SONY NP-FP50 Battery
SONY NP-55 Battery
SONY NP-FM70 Battery
SONY NP-33 Battery
SONY NP-F970 Battery
SONY NP-FP90 Battery
FUJITSU Lifebook C2220 battery
FUJITSU Fpcbp63 Battery
FUJITSU Fpcbp68 Battery
FUJITSU Fpcbp77 Battery
FUJITSU Fpcbp78 Battery
FUJITSU Fpcbp79 Battery
FUJITSU Fpcbp95 Battery
FUJITSU Fpcbp98 Battery
FUJITSU Fpcbp121 Battery
FUJITSU Fpcbp151 Battery
FUJITSU lifebook t4010 Battery
FUJITSU lifebook t4020d Battery
GATEWAY NX7000 battery
UNIWILL 258-4S4400-S1P1 Battery
TOSHIBA PA3307U-1BRS Battery
TOSHIBA PA3383U-1BRS Battery
TOSHIBA PA3384U-1BRS Battery
TOSHIBA PA3465U-1BRS Battery
ReplyDeleteToshiba PA2487UR battery
Toshiba A100 Battery
Toshiba Satellite A105 battery
Toshiba A70 battery
PA3062U-1BAT battery
Toshiba Satellite P30 battery
Toshiba PA3084U-1BRS battery
Toshiba PA3098U battery
PA3107U-1BAS battery
PA3107U-1BRS battery
PA3166U-1BRS battery
PA3176U-1BAS battery
TOSHIBA PABAS076 Battery
Toshiba pa3399u-1brs battery
TOSHIBA PA3399U-2BAS Battery
TOSHIBA PA3421U-1BRS Battery
TOSHIBA PA3456U-1BRS Battery
TOSHIBA Pa3356u-1brs battery
Satellite a10 battery
Pa3331u-1brs battery
Satellite m30 series battery
Satellite pro m30 battery
TOSHIBA PA3399U-1BRS Battery
Portege m300 battery
TOSHIBA PA3285U-1BRS Battery
Canon BP-2L5 Battery
Canon BP-508 Battery
JVC BN-VF707U Battery
JVC BN-VF707 Battery
JVC BN-VF733 Battery
JVC BN-V408U Battery
Hello everybody, This is such a great resource that you are providing and you give it away for free. i Would like to thanks to you
ReplyDeletecustom writing service
custom writing
custom writings
professional writing service
professional writing
Very nice article I would like to visit this article. keep posting such a nice post.
ReplyDelete.....Alex
generic viagra
sinema filmleri izle film izle
ReplyDeletesinema filmleri izle dizi izle
lig tv maç izlettir lig tv izle
maç izle lig tv izle lig tv izle
canlı maç dinle izle canlı maç izle
Canlı maç izle canlı maç izle
sikiş izle sikiş izle
sikiş izle sikiş izle
sikiş sikiş
sikiş izleme sikiş
sex izle sex izle
sikiş yeni sikiş filmleri
redtube sikiş redtube sikiş
sikiş sikiş
sikiş yeni sikiş filmleri
sikiş amatör sikiş
sikiş gizli sikiş
sikiş kızlık bozma
sikiş sikiş
porno porno izle
porno porno izle
sikişsikiş
sikiş izle sikiş izle
sikiş izle sikiş izle
sikiş amcık
great article. keep posting.
ReplyDeletehardian
Looking for luxury watches?replica Movado Watches on sale,fashion TAG Heuer Watches sale online,new Panerai Watches for sale,cheap TAG watches sale with high quality.Burberry discount at Burberry bag shop burberry4handbags.com. There are lots of Burberry bags and Burberry handbags.
ReplyDeleteThese kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here
ReplyDeletein the post..
Thanks for sharing me...reptile answers