Wiimote mouse
September 8, 2007 - 2.18Since succeeding in connecting the Wiimote to my PC, I’ve been thinking of using it as a mouse. At first I tried using the force or acceleration values which results from the rotation of the Wiimote to control the cursor position. That turned out to be a failure. Plus rotating your hand to move the mouse wasn’t exactly what I had in mind. I wanted to use simple pointing motions. However for that I needed a sensor bar. For transferring data, Wiimote uses Bluetooth. But in order for the Wiimote to generate data on its movement (note, not rotations), it needed to have other point to relate to. This is where the sensor bar comes in. The sensor bar is basically just a set of LED lights. The infrared sensor on the Wiimote picks up these infrared signals and calculates the positions of the light from the Wiimote. Since Wiimote is the reference point, when it moves, the position of the light changes and based on that change we can deduce where is it pointing to now.
Well I couldn’t use the sensor bar from the Wii console so I have the option of either purchasing a wireless one or make one myself. I chose the latter. It’s actually pretty easy to improvise. The Wiimote respond to a lot of light actually. People had used candles for such purpose. I decided to use red Christmas lights. Recall my USB motor project? I’m going to make it lights this time. I happen to have taken off the Christmas lights around my room today. It’s one of those wall outlet powered multi-coloured lights. I needed to turn it into USB power. Remembering my power surge incident last time, I needed to make sure the lights doesn’t take more than 5V of power. I cut off a four light bulbs section from one end. I then replaced the first and the fourth slots with red lights. The middle two slots were cut off and re-wired. It was time to test it out. I plugged the USB cable from my motor experiment into a USB port. I slowly let the two wires from the light strip touch those of the USB cable. It lit up! I unplugged the USB cable and properly attached the wire ends together. Next I found a strip of cardboard and punched two holes in it. Stuffed the two light bulbs through the holes and there I had a self made USB powered sensor bar. Pictures of the result here.
With the sensor bar working, I started testing out the light position data and created an algorithm that will translate light position to a cursor position. Even though I made a sensor bar with two lights, I’m only using data from one of them. It limits the motion detected but easier to start with. Anyway, I was able to have a semi-working Wiimote mouse.
There is, however, a problem due to my monitors set up. My laptop screen has a different resolution than my external monitor. Therefore, the Y positioning (up / down) is tricky and I haven’t figure out a solution for that yet. Next I’m going to try use both lights and see if I can generate smoother results.