Building a Wii “Sensor” Bar project

I meant to post this a few days ago but I was exhausted… but here it is today.

Introduction

Inspired by the hacks and videos on the InterWeb about being able to use a Nintendo Wii Remote (Wiimote) controller on a PC, I bought a Wiimote a few months back so that I can use it on a PC via Bluetooth and hopefully dev some games that utilizes its motion based interface. (Side note: I haven’t been able to pick up a Wii system yet as it’s still pretty hard to find a unit without camping out. :( ) I’ve finally had the time to get started on using it. First step though is to create a homebrew Wii “Sensor” Bar. It’s really not a sensor bar as the name implies; all it really is is a bunch of infrared LEDs on the both ends of a bar - an infrared emitter if you will. The Wiimote controller itself has the IR receivers which it can use to act as a pointing device.

Warning: some technical mumbo jumbo below.

Research

Sunday evening last week was day 1 when I first started. I spent the first day doing some research on net, on the forums and wiki of WiiLi.org and WiiBrew.org. Most people on this thread made their own bar using only four IR LEDs bought from Radioshack (part #276-143) but I decided I wanted more than four. Since I plan to use the Wiimote on my PC, I wanted to get power from the USB port which will always be available as long as a PC is around.

Design

On the following Monday I spent most of the day coming up with the circuit I wanted. For electrical engineer majors, this step is probably a no brainer, but I’m not in electrical engineering and I’m still new to circuit theory. I came up with a few designs and verified if it was correct with a couple of kind folks at AVRfreaks.net (thanks!). I ended up using the following parts in my design:

  • 6 IR LEDs (part# LTE-4208 - 940nm, 1.4V @ 50mA, 20º angle)
  • A prototype board apparently made by “Lab-Easy”, easy to cut with scissors(!).
  • 18 ohms 1/4W resistor
  • USB type B receptacle
  • ~20 AWG gauge multi strand wires (for easy soldering)

And here’s the very simple circuit diagram:

USB Wii Sensor Bar schematic diagram

A little bit of circuit theory: It’s important to note that by default the USB port can only supply a current up to 100mA on the power line. This circuit, in theory, will draw up to the maximum 100mA provided since there are two series of IR LEDs in parallel. Drawing anymore could cause some power problems on the USB network…

Aesthetics

For the aesthetics, to make it look somewhat good, I used these from Active Surplus on Queen St. in downtown Toronto: 2 glass containers that will enclose the IR LEDs on each side and a foot long tube thingy made out of hard glue (I think). In the picture I’ve already cut the plastic tube down to about 19 cm, which is roughly the distance between the left and right group of IR LEDs on a real Wii sensor bar. I also made a cut on the right side which is where the USB connector will go.

USB Wii Sensor Bar - glass & plastic tubes

Building it

Tuesday and Wednesday were spent putting and soldering the circuit together. I first cut out two rectangular pieces of the prototyping board with scissors. I made them small enough so that each of them can easily fit inside each of the glass containers with the IR LEDs on it. Then I soldered on an 18 ohms resistor and three of the IR LEDs all in a series for each board. One one of them I added the USB connector. This is what the two parts look like afterwards:

USB Wii Sensor Bar - Circuit boards 1

Just like on the real sensor bar, the two outer IR LEDs in each group are angled outwards while the ones in between are straight. I slightly bent the two outer IR LEDs on each side so that they’re angled while leaving the middle ones straight:

USB Wii Sensor Bar - Circuit boards 2

Once that’s done, all that’s needed is to to finish the circuit is to connect the ground and +5V lines from both boards to the USB’s ground and +5V line with wires through the plastic tube to get this:

USB Wii Sensor Bar - Circuit boards 3

For the board with the USB connector on it, I stuck that into the plastic tube first on the side with the opening for the USB connector and then I put some hot glue around it so that it would stay in place.

USB Wii Sensor Bar - USB connector

After that I glued on the second board on the other side. And finally I carefully put on the glass containers on both sides and hot glued them onto the plastic tube. Now all I needed to do was connect a USB cable to it and voila!

USB Wii Sensor Bar - Finished

It’s done!

Even after plugging it in, the naked human eye can’t see anything different but if you look at it through a camera you can see a faint purple-ish glow emitting from the LEDs - it works!

USB Wii Sensor Bar - It’s on and it works

I tested the Wii remote with this sensor bar using a test application that comes with ManagedWii Wiimote driver library and I was able to pick up IR reception from as far away as 4 metres. I also tried using the IR Windows mouse cursor script included in the GlovePIE driver and it worked pretty nicely. The Wiimote was able to move the mouse cursor across my entire 1280×1024 desktop. I was worried for a bit that the 20º angle range was too small but it doesn’t seem to be the case, at least not yet…

What’s next?

Now that I have my sensor bar, it’s time to learn some C# and dig into XNA!

Comments 9

  1. Martin Zwigl wrote:

    Hi there

    50mA on the LEDs. On the other hand 18 ohms resitors. Doesn’t that bring it down to 44mA.
    Am I missing something?

    Greetings from Austria,
    Martin

    Posted 05 Dec 2007 at 6:38 pm
  2. Martin Zwigl wrote:

    Hi there.

    Seems that my comment yesterday has not reached you. So I’ll ask again.
    I am a newbie at electronics. What is this with the 50mA on the LEDs and the 18 ohms resistors. My calculation shows that if one puts in 18 ohms resistors that leaves just 44mA on the LEDs. Is this on purpose?

    Thanks for clarifying.
    Martin

    Posted 06 Dec 2007 at 5:16 pm
  3. Thuan wrote:

    Hi Martin,

    You’re comment has reached me. :) I’m not sure how you got that calculation - can you provide some steps as to how you got that? In any case, you’ve asked a good question because I also stumbled upon something similar to this.

    When dealing with LED circuits, one should use this formula as mentioned in Wikipedia (http://en.wikipedia.org/wiki/LED_circuit):

    R = (Vsource - Vled_drop) / Iled

    In my case, (Vsource - Vled_drop ) = (5V - 3 * 1.2V) = 0.8V and Iled = 0.05 A (should be measured in amperes) for each string of LEDs. This will get you R = 16 ohms, but the electronics store that I bought the resistors from didn’t carry 16 ohms resisters if I remember correctly. The next resistor step up that they had were 18 ohms, and using those is generally a little safer than something less than 16 since it provides sufficient resistance to power the LEDs.

    Posted 07 Dec 2007 at 2:14 am
  4. Martin Zwigl wrote:

    Thanks for answering.

    I used the same calculation and got the same result with the 16 ohms.
    Do you still get enough output power on the LEDs for the controller.
    That’s, why I’ve been asking. (Well I asume so, since you wouldn’t have posted it elsewise)

    Cheers, from Austria

    Posted 08 Dec 2007 at 5:43 am
  5. Thuan wrote:

    Yes. I’ve been able to get it to work as far as metres and beyond.

    Posted 08 Dec 2007 at 10:16 am
  6. JXABC wrote:

    Hmm. Doesn’t the math work out to be (5-3*1.2)=1.4 volts, therefore 1.4/.05= 28 ohms?

    Posted 01 May 2008 at 2:11 am
  7. EagleEyed wrote:

    I think Thuan meant
    (Vsource - Vled_drop ) = (5V - 3 * 1.4V) = 0.8V
    seeing from the spec that the LEDs are rated at 1.4V

    Posted 19 Dec 2008 at 8:52 am
  8. prince wrote:

    i appreciate your work

    Posted 30 Mar 2009 at 1:05 pm
  9. eyeonthewinner wrote:

    Nice work, i’m gonna make mine right away!!

    Posted 07 Jun 2009 at 1:06 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *