Overview
A few years ago I got this nifty LED glasses kit in an Adabox. The kit comes with a specially-designed nRF52840 BLE microcontroller to drive the LEDs wirelesslly with Bluetooth Low Energy. I wanted to build a simple controller that I could pair with it for easy use, without having to dig out my phone and use an app, so I built a an adapter to essentially convert a Wii Nunchuck into a wireless Bluetooth controller.
This controller doesn't strictly have to be used to control LED glasses though. You can use it to control virtually any gadget with BLE capabilities. The Nunchuck features 2 buttons, an analog stick, and an accelerometer, so it makes a capable and handy input device for many tasks. Since it uses a Feather nRF52840 Express, you can program it in Arduino or CircuitPython to behave just how you want!
Difficulty: Intermediate. Some soldering is required.
Parts
- Feather nRF52840 Express
- Wii Nunchuck adapter breakout
- Mini on/off push-button switch
- 400 mAh Li-Po rechargeable battery
-
Black 2.5mm nylon standoff screw kit
- 4 M2.5 6mm screws
- 4 M2.5 6mm male-to-female hex standoffs
- 8 M2.5 hex nuts
- Wii Nunchuck controller
3D Printing
The 3D files for printing can be found here. The bottom part of the case and the button mount are printed with black PLA. The top part of the case is printed in white PLA as a simple method of allowing the indicator LEDs on the Feather and the nunchuck breakout to be visible with the case closed. The button mount slides into a slot in the bottom case geometry, and the top part of the case snap-fits onto the bottom.
Assembly/Wiring
- Solder wires from the Wii nunchuck breakout's VIN, SDA, and SCL pins to the 3V, SDA, and SDL pins on the Feather, respectively.
- Solder a wire to one lead from the on/off switch. Solder the other end of the wire to the EN pin of the Feather.
- Solder a wire to the GND pin of the Wii nunchuck breakout, and another to the remaining lead on the on/off button. Splice the two wires together, and then solder the spliced end to the GND pin of the Feather.
- Use 4 screws and 4 hex nuts to fasten the Wii nunchuck breakout to the 3D printed case.
- Plug the battery into the Feather.
- (Optional) You may want to use a small bit of double-sided tape (I used VHB foam tape) to fasten the battery to the underside of the Feather to keep it from jiggling around. I positioned the battery to be closer to the micro-USB end of the Feather, away from the antenna on the other end as much as possible.
- Use 4 male-to-female hex standoffs and 4 hex nuts to fasten the Feather to the case. The battery should sit nicely underneath the Feather, thanks to the standoffs.
- Slide in the 3D printed button mount piece into the slot in the case near the nunchuck breakout (it's a tight fit).
- Position the on/off button so that it fits into the hole in the top of the 3D printed case, and then snap the top of the case to the bottom, making sure the side of the lid the on/off button is placed over the button mount geometry, and that the button stays in place in the hole in the top piece.
- Plug the Wii Nunchuck controller into the adapter.
Use the on/off button on the top of the adapter to toggle the power.
What next?
Use Arduino, CircuitPython, PlatformIO, or the Nordic SDK to program the adapter to your specifications. Or...
Custom firmware
I wrote some PlatformIO firmware to interact with custom firmware I wrote for the Adafruit LED glasses kit, available here. You might be able to pair it with another device, but it probably won't do anything without modifications to the code.
Firmware installation
There are two ways to install the firmware: by installing the UF2 binary on the Feather nrf52840 Express directly, or by building from source and installing with PlatformIO.
UF2
For easy installation, you can install the pre-built UF2 file using the following steps:
- Download the UF2 file here
- Plug in the Feather into to your computer's USB port
- Click the reset button on the Feather twice
- The FTHR840BOOT drive should appear on on your computer
- Copy the UF2 file you downloaded in step 1 to the FTHR840BOOT drive
That's it!
Build from source
For this project I chose to use the PlatformIO environment. I recommend using Visual Studio Code with the PlatformIO IDE plugin. Once PlatformIO is installed, you can download the source code for the project from github. Open the project in the VSCode workspace. Make sure your the adapter is plugged in to your computer, and press the Upload button in the top right of the VSCode screen. The code should compile and upload to your adapter.
This page (Wii Nunchuck BLE Adapter) was last updated on September 04, 2024.
Text editor powered by tinymce.