Jerrick's Bar

Final Project


In this section, I will be documenting the process of my final project for the module. For this project, I wanted to create something that would meet the requirements of this project and also help benefit me with my gaming experience. As such, i decided to create an Osu! 2-mechanical switch keypad. However, many of such products already exist out in the market, therefore i wanted to add in another fucntion to it, which is to add a clicks per second counter and have it display on a lcd screen above the keypad.

Location of raw files



Bill of materials


Item: Quantity
Arduino Pro Micro 1
Cherry MX Speedsilver Mechanical Switches 2
I2C LCD Screen 1
White Acrylic Sheet 1

Prototyping Phase

One of the earlier problems that was identified was how to place the LCD screen in a position so that it would not affect the wiring of the switches and the LCD screen itself, while giving ample space for the switch to be placed in a comfortable spot.

The solution thought up for this was to design the keypad in "levels" of acrylic plating so that if more space were needed, another plate can just be added in between.

Another problem was how to position the Arduino Pro Micro so that the connection can be easily accessed and that the wiring will have sufficient space to be in. This also ensures that the connection from the switches and LCD screen to the Pro Micro will be secure.

To fix this, I decided to 3D print an Arduino Pro Micro housing that will be lodged in between the base plate and the other acrylic platings. The housing is basically a very thick plating with a support that extends out of one side. The Pro Micro will be placed on the suppoprt and there would be a hole in the plating so that the wire can be plugged in. The support would be located under the mechanical switches to give more space for the LCD screen wiring to go through while saving more time in connecting the switches with shorter wires.

One more other problem that I thought of later was that how to hold up the LCD screen so that it would be floating above the Pro Micro. I needed the LCD to be floating as it gives much more space for the wiring and so that it would make my life easier when soldering the wires to both the LCD and the Pro Micro.

To solve this, I wanted to put smaller acrylic plating around the LCD screen to separate out the space for the switches and the screen. The smaller platings also have a hole that would be cut out to be friction fit for the LCD screen to be placed in, and have smaller screw holes around the corners so that we can screw in the LCD screen in place to the top acrylic plating.

3D Modelling

Once I had a clearer idea, I started to 3D model out the parts in Autodesk Fusion 360.

A glimpse of how the final 3D model looks like.

After much consideration, I decided to 3D print the Arduino Pro Micro housing and laser cut all of the other acrylic plates, as well as the base plating.

3D Printing


As stated earlier, only the Arduino Pro Micro housing would be 3D printed.

Settings used for the print
Layer Height 0.2mm
Infill 15%
Print Speed 80.0mm/s

Base Box

Result of the print

The first print was almost perfect, the Pro Micro could fit into the mount perfectly and the print was of good quality. However, there was some warping on one corner of the print, which causes the edges to be uneven. Fortunately, it was small enough that a little sanding did the job.

Base Box

Above is an image of the Pro Micro mounted onto the print.


Laser cutting

Laser cutting was pretty straightforward. All the pieces were very similar and easy to lay out in the software to be laser cut.

However, during the first attempt of the laser cut, some of the pieces did not properly cut through. I was not aware of this until I made my way back to the Fablab, where i had no choice then but to try and cut out the pieces by hand using a penknife. This unfortunately did not work out as some parts of the pieces were still to thick to cut through.

This then led me to have to laser cut the piece on a different day. At first, I thought that this was valuable time wasted and that I had to put in extra effort just to finish up this simple part of the project. However, when i got home, I found out that there was another problem with the design of the project. I had to forget to put into consideration the cable for the Pro Micro, and when i tried to plug in the cable, the wire could not be plugged in fully into the arduino. This lead me having to redesign the 3D print and add a small indent in the usb hole part.

In the end, I had to reprint the mount and laser cut the parts on a different day, but this time the results were good and everything went well.

Electronics

The wiring of the project was also very straighforward and simple, not much complicated connections to do and not many connections to solder as well.

Base Box

Code for Arduino

In this section, I will briefly expalin how the main parts of the code work and how it relates to the main fucntion of the project.

Base Box

This part of the code includes the keyboard library so that the keypad can actually work as a keyboard, and then the bottom two lines are just to assign the switches to the respective soldered pins.

Base Box

This part of the code is to set the state of the switches to be high

Base Box

To summarise this part of the code, it is just to assign what key the switch is inputting when the switch is actually pressed down

Base Box

In order for the LCD and counter to work, these two libraries needed to be installed. The LiquidCrystal library is for the LCD as the LCD is comes with an I2C, which basically simplifies the connections of the LCD down to 4 pins only. The library is needed in order for the LCD to work. The next library is for the CPS counter, in which it helps to calculate the average CPS within the entire session.

Base Box

This line of code is to set the LCD address to the correct one as different LCDs have different addresses.

Base Box

The code that was used to identify the address of the LCD is as stated as above.

Base Box

This part of the code is for the counter, where the counter is counting the key press when the switch is released.

Base Box

This is one of the more important parts of the entire code, where the content being displayed on the LCD is decided. First, the LCD screen is completely clearly to a blank state, and then the cursor is set to 2 spaces from the top left corner of the screen, where the average CPS is printed. After that, the cursor is set again to the tile below that, where the total amount of clicks is printed.

Final Product

After putting all of the parts together, and then screwing the plates together to secure it, the final product is complete.

Base Box

Putting the switches into the switch plate

Base Box

Base Box

Final Product with 2 different views


Base Box

Above is the one page slide for the project.

Attached above is the final project video.