Let's Make Robots!

Wii IR camera as standalone sensor

Using the Wii Remote IR camera directly with an Arduino
AttachmentSize
Wii-IR-Camera-schem.pdf11.63 KB
Wii-IR-Camera-board.pdf11.3 KB
wii_remote_ir_sensor_sample.pde2.5 KB

The Wii Remote became a very intersting tool for hacking and other uses where it not has been mentioned for. After the first hacks appears in the internet a lot of people are doing great stuff with it.

This tip&walkthrough is about  using the IR camera from the Wii Remote as a standalone sensor. It is based on hack of a japanese guy named kako. There also exists a Make article

This sensor is great for tracking infrared sources. It can track upto 4 sources independently and give out the coordinates and the strength ob each tracked object. The IR camera has an I2C interface which can be easy accessed by a microcontroller. Here an Arduino board has been used. 

3625806085_61cc9ba881.jpg

Wii Remote disassembling:

To get the IR camera out of the Wii Remote, the Wiimote must be disassembled. A Tri-Wing screw driver has been used for this task. The IR camera is on the front of the board. To get the IR sensor out a hot air gun is been usefull.  

This walkthrough only works for an original Wii Remote. There exists some Wii Remote clones, which are cheaper than the original one but they have different sensors with unknown pinout, so be warned!

Schematic:

The schematic slightly differs from Kako's aproach, it has been taken form the CC2 ATM18 project. A quartz oscillator has been used. A frequency bettween 20..25MHz will work. Unfortunately the sensr is a 3.3V device. Some level conversion must be done before connecting it to a 5V Arduino board. The sensor gets it power source from 2 diodes in series with a 5V from the arduino board which give roughly 3.6V. 2 pullup resistors on the I2C pins limits the voltage down to 3.6.

Schematic and a board layout is atached to this article.

 

Partlist:

  • Wii Remote IR Camera (from a original Wii Remote, not a clone!!)
  • 24Mhz quartz oscillator (or 25MHz, but not a resonator!)
  • 2x diode 1N4148 or equivalent
  • 2x elecrolytic capacitor 10uF
  • 1x ceramic capacitor 100nF
  • 2x resistor 2.2kOhm
  • 1x resistor 22kOhm
  • perf board 60 x 25 mm
  • pin bar 1x4
  • pin bar 2x4
  • bar jack 2x4

 

Software:

The Arduino control software is also based on Kako's sources. It simply initialise the IR camera sensor and sends the readed blob information to a PC: The sourcecode has been slightly modified to work with the PC software.

The PC software is also taken from the CC2 ATM18 project and can be downloaded here.

An Arduino sketch is attached to this article. At the moment I am working on a processing sketch for graphical represantation of the Wii IR Camera output.

 

 

To be continued...

 

 

 

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Sorry for the late reply.

I think my sensor is dead already. My pin configuration is wrong XD

I used this oscillator http://philippines.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=5475588. Is this good enough? If not what can you suggest for me to use.

Hi,

sorry, but I will not sell my sensor. Maybe you will find a defect Wiimote at eBay.

This oscillator will be ok for this purpose.

Yes, you can use the 3.3V from Arduino to power the sensor. But you will need 5V for the oscillator, or you maybe find a 3.3V oscillator.

 

what i mean for the voltage is to directly use the 5V of arduino to the oscillator as well as the 3.3V for the sensor 

Yes, that will work. The diodes are not needed, than. Not sure about the capacitors.

Has anyone found a source for the camera?  I mean, other than hacking appart a Wii remote?

not really, BUT I've just bought 2 of these

http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=160568614704&ssPageName=STRK:MEWNX:IT#ht_2443wt_1002

and at least the 1st one that I've opened, seems to be working...

 

You can find more details, including plenty of pictures :) and C# code for a .NET micro framework board, on my blog here:

http://trandi.wordpress.com/2011/04/03/the-wiimote-and-fez-domino/

 

Hope this helps...

dan

 

 

Dear Robotfreak, I'm not sure if my E-mail/post of earlier today reached you, but anyway, this is to tell you that thanks to your help the camera is now (finally) running with a Picaxe microprocessor! We're now able to track a robot carrying an ir-led on the screen of the PC.

Finally, the tracking problem is solved !!

Thanks again for sharing your information and schemes with the forum and for your additional help.

Best regards,

Ronald.

For those interested in connecting the Wii to a picaxe, here´s my program±

pause 1000
i2cslave 0xB0, i2cslow, i2cbyte
pause 500
 
 
writei2c 0x30, (0x01) ; camera on
pause 100
writei2c 0x30, (0x08)
pause 100
writei2c 0x06, (0x90) ;sensitivity part 1
pause 100
writei2c 0x08, (0xC0) ;set sensitivity part 2
pause 100
writei2c 0x1A, (0x40) ;set sensitivity part 3
pause 100
writei2c 0x33, (0x03) ;set the mode
pause 100
writei2c 0x30, (0x08)
pause 100
 
 

 

writ:

writei2c (54)

readi2c (b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12)

b0=b4
w10 = bit7*2
w10 = w10+bit6
w10=w10*255
w10=w10+b3

w11 = bit5*2
w11 = w11+bit4
w11=w11*255
w11=w11+b2

sertxd (" ",#w10," ",#w11," ",13,10)

pause 1500
goto writ

That's great. Now we have Arduino and Picaxe working with the Wiimote camera. Looks like Gareth is working on a Propellor port at the moment.

Dear Robotfreak, I'm a Picaxe user and when I saw what you achieved with the Wii-camera, I immediately decided to build the same project with the following purpose: if I attach the Wii-camera on the ceiling and if I attach a (or better: 3) IR-leds to the robot vehicle I use (small robot car) that would forever solve the problem of knowing where the robot is located. The camera would simply detect the leds and tell the computer the exact x- and y- coordinates of the robot.

That would be a really usefull achievement !!

BUT: I don't get the camera to work. I'm used to soldering and the print with 24 MHz oscillator, a few resistors and a condensator was build and checked (and rechecked) in an hour (taking out the camera took more time !!) If I use the Picaxe's I2C read commands, I see a coherent row of numbers passing by, but the waving of a candle or an IR-led does not change the output (Both Picaxe and camera runn well on 3.3 V).

My (somewhat stupid) question to you now is: is it necessary to initiate the camera first? I regrettably don't understand that much of the program that you provided (I'm used to the extremely simple Picaxe language), although there is something about initiating the camera. What I did is the following: I used the I2Cwrite command of the Picaxe to send the bytes to the addresses that I understood from your program, but that does not change anything in the readout!

So I'm "stuck in sight of the harbor"as we call it.

Could you please explain in a few simple words if initialisation is necessary at all, and how it is exactly done?

Thanks very much in advance for your efforts.

Kind regards,

Ronald

Hi Ronald,

I've no PICAXE programming expirience, but I can give some pseudocode about the program. Yes, the sensor needs to be initialized, otherwise it will not work. One important thing about the I2C slave adress. For the Wii this is 0x58 these are the upper 7 bits. The lowest bit is the R/W bit. Don't know about how PICAXE handles the I2C adress. Very often a 8-Bit slave address is used (including R/W Bit). In this case the I2C Write Adress is 0xB0 and the Read Address 0xB1.

Here is the pseudocode:

Setup:

Initialize I2C, Slave Address 0x58

Write I2C 0x30, 0x01

Delay 10ms

Write I2C 0x30, 0x08

Delay 10ms

Write I2C 0x06, 0x90

Delay 10ms

Write I2C 0x08, 0xC0

Delay 10ms

Write I2C 0x1A, 0x40

Delay 10ms

Write I2C 0x33, 0x33

Delay 10ms

 

Loop:

  Write I2C 0x36

  Read I2C <16 Bytes>

End Loop