Hacking the Wiimote IR camera

You can connect to the Wii remote over bluetooth or use an Arduino to send peripheral data to the Wiimote, but what if you want to interface directly with the Wiimote's IR camera? The sensor is particularly good at tracking coordinates for 1 to 4 points—it could be a simple way to add sophisticated tracking capabilities to your own project.
David Cranor writes,
There is a great site about hacking the wiimote IR camera to interface it with a computer - but it's all in Japanese! Perhaps you could post these links and see if anybody could translate it?
This page details how to desolder the camera itself and build a standalone circuit for it so that it can be connected to an I2C bus, and subsequently a computer (i think, anyway - the schematics are in English, and there's a video).And this page talks about how to connect the camera to an Arduino via some of I2C shield that he's built.
I'd really like to have access to this information for my projects, so if somebody would be able to translate these pages, that would be awesome!
A quick run through Google's Japanese to English translator yielded a reasonably understandable result:
Wii IR sensor connection details
Connecting the Wii IR sensor to Arduino
The second link contains a wealth of information on talking to the IR sensor over I2C, including some details on adjusting sensitivity parameters. The translation is a little rough, but combined with some of the sample code, I think I have the gist of it:
To initialize the IR camera, you have two options: 1) a simple, default initialization or 2) an initialization that allows you to specify 4 configuration parameters that affect the sensitivity of the device.
Simple Initialization:
Just write the following byte sequences, with a small delay between writes (assumes a successful ACK). The first byte on each line is the register you are writing to.
0x30 0x01
0x30 0x08
0x06 0x90
0x08 0xC0
0x1A 0x40
0x33 0x33
Initialization with sensitivity setting:
The author defined 5 sensitivity levels, and there are four parameters (p0, p1, p2, p3) that are adjusted for each level. Here are the settings:
Level 1: p0 = 0x72, p1 = 0x20, p2 = 0x1F, p3 = 0x03
Level 2: p0 = 0xC8, p1 = 0x36, p2 = 0x35, p3 = 0x03
Level 3: p0 = 0xAA, p1 = 0x64, p2 = 0x63, p3 = 0x03
Level 4: p0 = 0x96, p1 = 0xB4, p2 = 0xB3, p3 = 0x04
Level 5: p0 = 0x96, p1 = 0xFE, p2 = 0xFE, p3 = 0x05
Quoting the Wiimote Wiki IR sensor page, these parameters correspond to:
p0: MAXSIZE: Maximum blob size. Wii uses values from 0x62 to 0xc8
p1: GAIN: Sensor Gain. Smaller values = higher gain
p2: GAINLIMIT: Sensor Gain Limit. Must be less than GAIN for camera to function. No other effect?
p3: MINSIZE: Minimum blob size. Wii uses values from 3 to 5
Either pick your own custom settings for the parameters, or choose them from one of the 5 levels above, then send the following data to the device:
0x30, 0x01
0x00, 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, p0
0x07, 0x00, p1
0x1A, p2, p3
0x33, 0x03
0x30, 0x08
The author also links to the following source, which serves as a helloworld for reading sensor data directly from the IR camera:
Wii Remote IR sensor test for Arduino
Wii Remote IR sensor test for ATMEGA168
Finally, since the IR sensor is a 3.3v device, you'll want to do a little voltage conversion before interfacing it directly with a 5v device like your typical Arduino (Arduino Pro users don't have to do a thing). Sparkfun has a guide for using 3.3v electronics with 5v microcontrollers, which should be all you need. It makes me wonder if anyone sells a pre-built 3.3v shield.
Hopefully this is all you'll need to get things working. Make sure to send us a tip if you make something cool using the Wii IR sensor.
Previously:
HOWTO: Make a Wiimote peripheral
Hook your Wii nunchuck up to an Arduino
Posted by Jason Striegel |
Nov 22, 2008 05:59 PM
Electronics |
Permalink
| Comments (0)
Recent Entries
- Minty soldering jig
- Selecting row number in MySQL
- iPhone 3G software unlock
- Python on Android
- Controlling Sony camcorders with the Arduino
- Gradient text effect in CSS
- Retro gaming emulators that include (legal) ROMs?
- Das DereLicht - ham radio transmitter from a CFL bulb
- Using Google App Engine as a personal CDN
- Route-me - Open Source mapping library for iPhone
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- Android
- AppleTV
- arduino
- Astronomy
- Baseball
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Design
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- Online Investing
- OpenOffice
- Outdoor
- Parenting
- PCs
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Security
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- User Interface
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
Recent Posts
- Minty soldering jig
- Selecting row number in MySQL
- iPhone 3G software unlock
- Python on Android
- Controlling Sony camcorders with the Arduino
- Gradient text effect in CSS
- Retro gaming emulators that include (legal) ROMs?
- Das DereLicht - ham radio transmitter from a CFL bulb
- Using Google App Engine as a personal CDN
- Route-me - Open Source mapping library for iPhone
www.flickr.com
|






Leave a comment