Bluetooth Joystick Controller Cabinet (December, 2017)
by jakeofalltrade in Circuits > Arduino
227 Views, 2 Favorites, 0 Comments
Bluetooth Joystick Controller Cabinet (December, 2017)
This is a project I am particularly proud of, as seeing the design and fabrication of a fully functional joystick like this required me to use and develop a wide range of skills. CAD, woodworking, electronics prototyping, and programming were all a large part of this build.
Imgur.com galleries:
Cabinet Build: https://imgur.com/gallery/dA79q
Finished Product: https://imgur.com/gallery/QlinT
Fabricating the Case
After selecting the joystick and buttons, their layout was drafted in Fusion360. This layout was printed to scale and used to drill out the appropriate holes on the case lid. A simple jig was then constructed to cut and join the cases sides with a box joint. The lid and bottom were made from pine stock while the cases sides were cut from poplar. This build only called for the use of a drill press, a band saw, a table saw, and a sander. The latter was used both for finishing and for chamfering the case's edges.
Before the final glue up, the side walls of the case and decorative button plates were finished with a cherry stain, while the lid and bottom boards were finished in a dark walnut stain. All components were then treated with 2 coats of polyurethane, glued appropriately, and assembled with a few hinges and a cabinet clasp to keep the lid securely in place during gameplay.
The Electronic System
At its core the controller simply acts as a Bluetooth keyboard, which utilizes an Arduino Uno to interpret button presses and send the appropriate commands to an Adafruit Bluefruit bluetooth module.
The system is powered by two parallel Li-Po cells, pulled from an old laptop battery. The 3.7 V cell voltage was stepped up to 5 V using an Adafruit Power-Boost charger. This board contains a boost converter as well as all the circuitry needed to monitor and recharge the voltage of the 2 Li-Po cells safely.
After connecting each button to a common positive rail and a respective input pin, all that was left was to program the arduino to interpret button presses and utilize the bluefruit module properly.
Communicating with the Bluefruit module was far and away the most difficult part of this project, as Adafruit was no longer supporting this module. Any documentation I was able to track down proved to be incomplete and only provided complete guides on sending instantaneous button presses over bluetooth. These commands alone wouldn't allow for a button to be held down, but instead could only report that a held button were being pressed repeatedly. This was obviously unacceptable for most video games.
I was able to solve this issue with the help of Microsofts guide to keyboard key codes, which I found at:
docs.microsoft.com/en-us/windows/win32/learnwin32/keyboard-input?redirectedfrom=MSDN
By using the Bluefruit to send raw data instead of characters, and sending the WM_KEYDOWN and WM_KEYUP in between the ASCII hexadecimal values of the character keys pressed, I was eventually able to achieve a fully functional joystick where all buttons and directions could be truly held down indefinitely.