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.

I only skimmed but... wow... not sure where to begin here. That collection of files is confusing because it looks like Arduino code, with strange file extensions (.i is non-standard and the file mixes together typical header contents with code)

You might consider that you're attempting too much in too short a time. I don't think anyone is going to do your project for you. But if you want to learn, you might find it easier to overcome your obstacles by using the Arduino programming environment, I think.

Either you have to go buy an arduino-compatible board or you'd need to figure out how to set up your ATmega8 for use with Arduino. Normally Arduino-compatible boards have an ATmega with a bootloader on them. Which means you have to be able to flash a bootloader onto your ATmega8. Then you can program with a usb to serial adapter that breaks out 5v, rx, tx, and dtr (for reset)

http://arduino.cc/en/Hacking/Bootloader?from=Main.Bootloader

Once you have that, you can program in the Arduino IDE and make use of built in I2C libraries, etc.

http://www.arduino.cc/en/Reference/Wire

There are a number of cheap Arduino clones available but not sure what is possible for you to obtain in Jakarta whether thru internet or locally or whatever else.

http://arduino.cc/en/Main/Hardware

actually, the .c file that you need to look. the other was product after i built this program...

but okay.. i've done by upload the bootloader.hex file and set the fuse via atmel avrprog with codevisionavr and yes, atmel avrprog didn't recognize by arduino... so, i'll try with paralel port later... thx before

Ok, I admit ignorance regarding your IDE. Sounds like you are much farther along than I originally thought. Sorry.

Where is the I2C library?

Hopefully the parallel port programmer will work.

If it compiles then I guess you are good to go. The code looks like it'll do what it needs to do I guess?

okay... i hope this will be the last question. actually, i can't find the oscilator also ( only around 10mhz ) in jakarta, and it say that need to be order first and will take 3 months (duh) so i use the crystal with capasitor and of course, i use kako schematic for my ir camera driver with little modification so the vcc will be drop to 3.6v and put a pull-up res in sda and scl. the question is... is it still can be use? sorry for my bad english...

Kako's clock signal circuit should work fine -- I used the same circuit for a TTL-based oscilliscope calibrator (http://www.bot-thoughts.com/2009/08/oscilloscope-calibrator-part-1.html)

As for supply voltage, I ran mine off 3.3V, never higher. I don't know what the max ratings are for the camera. I'd think 3.3V would be safest. What is powering the AVR? Can you put another linear regulator in parallel or in series?  Even a restor and 3.3V zener might work.

ok.. its kind of confusing... i modified again the signal circuit so the vcc for camera about 3.2v using 220 ohm and 470 ohm voltage devider, using this 3.2v to pull up the SDA and SCL using 4k7 ohm... set the scl to analog input 5 (PC5) and SDA  to analog input 4 (PC4).. set my avr910 to serial... opening wiiblobtrack... nothing happen

i though that my camera was already dead, and buy another wiimote... take the camera, and again... no respond... using wii ir sample from here.. cannot connect to wii blob track.. opening serial monitor on arduino... no respond..

take back the camera to wiimote... the wiimote works well... 

my question

1. is there something wrong with my pin configuration?

2. How to use serial monitor?

thx

 

note : i try use this program, because include serial print to test using serail monitor.. 

http://www.instructables.com/id/Wii-Remote-IR-Camera-Hack/step6/Using-the-camera-to-control-something/

Using a voltage divider as VCC for the sensor is not a good idea. Better use 2 diodes in series, as shown in the schematic.

Did you use a 74x04 together with the crystal quartz as shown in Kaku's schematic?

Any chance to see a photo of your work?

edit again my schematic.

i use 74ls04 with normal crystal 24mhz

3 series diode ( because it still 3.9v if just using 2 )

here the scematic and PCB for it

http://www.mediafire.com/download.php?4vgj7mnl3rrkwbc

5v for 74LS04, 3.2V for IR Camera

use the sample program from here...

the thing is... when i connect SDA and SCL pin to my micro, the flow data from serial read is stop. not giving zero data, but just stop.. connect to the driver without camera... the flow is stilll going... when put the camera.. the flow is stop....

here the video

http://www.youtube.com/watch?v=ks5ce9vyM_0

question again :

1. Somethings wrong with my schematic?

2. What makes the flow is stoped when i connect the SDA and SCL line?

2. My original wiimote is korea version... is this the problem?

 

note : put this camera back to my wiimote... and it the wiimote is works fine...

>>1. Somethings wrong with my schematic?

I encountered 2 problems.

1. The 74LS04 is a different logic family than 74AC04. FIrst is lower power shottky, second is advanced CMOS. This may cause problems to make the crystal oscillator swing. Better use the recommended 74AC04.

2. In general all unused input pins of ICs must be tied to a defined logic level. Let them open will lead to floating inputs that works like antennas catching noise. CMOS ICs will die because of the latchup effect. In this case Pin 3,5,11,13 should be connected to GND or VCC (via Pullup resistor).

>>2. What makes the flow is stoped when i connect the SDA and SCL line?

I2C is using a simple state change protocol. It's not a plug & play bus like USB. Connecting/disconnecting of devices in a running system will cause problems like this.

>>2. My original wiimote is korea version... is this the problem?

nope.

err... sorry to give a bad news... can't find oscilator, 74ac04 and get 74F04 as subtitute... grounding pin 3, 5, 11, 13

the data is still zero..

1. Is it only clock that make my driver didn't works? if it's true, can i just take off the oscilator from wiimote board? it smd, but i guess i pull out the wire from it.. can you share the pinout from it?

2. 74AC04 is cmos not gate type... and i have cd4009. its cmos to and not gate.. can i use this?

3. it is silly but, is there any change i get the data from wiimote directly? from camera pin directly?

the condition is.

1. VCC from AVRprog is 5v directly from usb port

2. VCC after camera is put on the driver is 2.8v

3. using 5 v as vcc for pull-up 4k7 resistor, because i though 2.8 v not enough to pull-up

4. wii camera works fine, test by put to wiimote back again and use it in wii and dolphin emulator

5. all connection on camera is connected fine

here's the preview

http://www.youtube.com/watch?v=Zzk1xAw6Ymc

and part

http://www.mediafire.com/download.php?a5lmq4u3quhwjpq