Learn Make Share!
Throughout this project, we had worked on creating a game controller which is an input device used with video games or entertainment systems to provide input to a video game, typically to control an object or character in the game. It receives inputs from a push button or tilt sensor to control arcade games on a computer screen.
Electronics
Arduino leonardo and micro usb cable
x6 Push button
x2 Tilt sensor
Jumpers
Various
Screws
Nuts
Fabrication
3mm Plywood sheet
Cardboard
Tools
Soldering iron
Drill
Machines
Laser Cutting Machine
Apps
Fritzing
Arduino IDE
Fusion 360
My idea for developing a first time protype was very simple. I had used an old mobile phone box which was made from cardboard as an enclousre for my components. I had sticked another cardboard from inside to strength a weak part on the box. Then i had mounted the arduino board and sensors on the bottom of the box and the push pottoms on the top.
Cardboard Prototype
Cardboard Prototype
Enhancements: For a better experience, curved edges will be more suitable.
I had designed a very similar part to the prototype but i had added some modifications. The design mainly consits of 4 parts bottom, front, back and top. The bottom, fron, and back were very easy and didn't take too much effort. The top was more complicated and includes the left and right sides so that we can have curved edges.
CAD Model
CAD Model
As the deign was going to be fabricated using plywood sheet and laser cutting machine, a living hinges were created at the curvy areas on the top part to make it flexible and bendy. By using the sheet metal approach and flat pattern on fusion 360, i had created the living hinges.
The enclosure was fabricated using a 3.00 mm wood sheet. By exporting the design from fusion as dxf and then impoeting the design to the laser cutting machine software, i was able to fabricate the design and obtain the parts for assembly.
Parts Being Cutted
Laser Cutting Machine video
The idea was that we should have 4 buttons to be used to move in the 4 directions and another 2 buttons to be programmed for other uses. Then we have 2 tilt sensors to be used (Left - Right) or (Up - Down) as gesture direction controls.
The ground path is common for all the buttons and each button is conneected to a specified pin. Each tilt sensor is connected to an digital pin and supplied one of the sensors with the 5v pin from the arduino and the other from the Vin pin that usually 5 volts from the USB connection.
Components
Circuit Schematics
Now, everything is ready for assembly. Let's do it.
Assembly Components
First, i had started by attaching the front and back sides to the top. Then i had attached the buttons to the top in order solder the wires to the buttons. Then i had used the soldering iron to connect the buttons like illustrated on the schematics above. Then, i had attached the arduino to the bottom and connected the wires from the bottons to the specified pins. Also, i had connected the 2 sensors and setted them on the bottom part on opposite directions. Finally, i had attached the bottom to the body and my game controller was ready.
Buttons Attached
Wires Soldered
Arduino and Sensors Attached
Setting all Components
On this stage, we will program the arduino to do the required functionalities. We will first make every mode work separately and then integrate the 2 modes on the same code.
We have 2 modes:
Manual Mode
Inputs: Five Push Buttons as tactile direction controls
Gestures Mode
Sensing: Two Tilt sensors (Left - Right) or (Up - Down)
First, i had started by working on the tactile mode which was with the push buttons.
Manual Mode
The idea was that for each button if the button was pressed then we have to do the same action as the corresponding button on the keypoard does. For example, on the following code, we check if the value of the down button is low (pressed) then this means we have pressed the down arrow on the keyboard and if the button is not pressed then we are not presssing this puttton and so on for all the other buttons. I didn't add a delay method to me implementation because ,on the game that i was testing with, multiple response from the button was not actually a problem.
Up to this step, i had a game controller that works with push buttons.
Gestures Mode
Next, i had tried to integrate the tilt sensor but unfortunately it was not as easy as expected. Although the sensor is a digital sensor not an analog one, it didn't give me a reliable reading. After connecting the sensor like illustrated on the schematic above, one of the sensor didn't give me a readding (high only) and the other was was working but it gsomtimes it gave me unreliable reading and the sensor was taking a while to move from low to high.
Also, in ideal case, the tilt sensor senses a change with 180 degree and not with small changes which makes it difficult or meaniningliess to integrate it in a game controller. So, i beleive may be replacing the tilt sensor type with another type may solve the problem and it is better to replace it with an analog one that gives an angle degree reading so any small change can be sensed.
Playing Video
Final Output
What i had learned
During this module's development, i have refreshed my knowledge about digital fabrication especially the design and fabrication parts. I had dealt with some new components like the tilt sensor. I had also learned some new designing techinques like the living hinge to make the wood more flexiable.
I hope you have liked this project and you will build your own Game Controller so that we can share and explore the World together !
Enjoy !!