HoloLens input device based on Wii Nunchuk controller.
- Adds two buttons and joystick functionality
- Wireless connection over Bluetooth
- Low latency, reaction time < 1/20 second
- Easy to use in Unity, no external dependencies
- Arduino board reads button state from nunchuk over I2C protocol.
- Arduno translates key press events in USB HID codes and sends them to EZ-Key board over serial interface.
- Bluefruit EZ-Key board appears like an external keyboard in the list of available Bluetooth devices on the HoloLens.
- Standard Bluetooth pairing, no PIN required. If something goes wrong there is Pair button on the EZ-Key board to restart the connection.
- For Unity scripts the HoloControler looks like normal key press events coming from a keyboard.
First prototype
Part | Price in EU | Comment |
---|---|---|
Wii Nunchuk | 10 € | Got one in perfect condition on Ebay |
Arduino Mini 3.3V/8MHz | 9.50 € | Reads data from the Nunchuk |
Bluefruit EZ-Key | 21 € | Bluetooth HID Keyboard Controller |
You will also need FTDI cable to program Arduino Mini. It's also possible to use regular Arduino as programmer.
Wired version
It's also possible to make it completely mobile by adding LiPo accumulator and charge controller, but then you'll need a 3D printer to print bigger case.
Arduino stacked on the top of EZ-Key board. I put a piece of plastic between boards for electrical isolation.
Nunchuk board pinout.
Electronics nicely fits into original nunchuk case.
Arduino sources are in the "Arduino" folder.
The easiest way to program Arduino Mini is using FTDI cable. It's also possible to use USB<->Serial adapter or Arduino UNO as programming device.
Be sure to choose correct board type in the Arduino IDE
The controller simulates keys strokes on a Bluetooth keyboard. Joystick directions are translated in A, D, W, S keys. Z button is mapped to Return and C button to Escape.
You can get key state with the standard UnityEngine.Input class:
if (UnityEngine.Input.GetKey(KeyCode.A))
{
// Joystick left
...
}
if (UnityEngine.Input.GetKey(KeyCode.D))
{
// Joystick right
...
}
Demo Unity project is included.
Still needs cable for power supply (USB plug A).
Adds LiPo accumulator and charging controller.
Coming soon.