Game Controller
Iteration Two
Iteration Two
Let's show how to minimize the low fidelity game controller!
A lot of wires.
Huge size.
Tilt sensors were not accurate.
Big components.
No smooth finishing surface.
Outstanding screws and nuts.
It is a developed version of the low fidelity prototype. in this documentation, you can make a game controller like in the video with your own custom keys... and then have fun by using it.
We will use some technologies to develop the disadvantages of iteration one:
- Deal with microcontroller direct.
- PCB design.
- Small component integrated on this PCB.
- Use 3D printed parts and acrylic.
- Use a press and fit or snap-fit.
Finally, you can fabricate a game controller like this one in the video.
Components:
ATtiny85 / micro controller.
8-Pin IC Housing.
7 x Push Button.
2 x Tilt Sensor Module.
2 x 100 Ω Resistor.
1 x 560 Ω Resistor.
7 x 1 kΩ Resistor.
1 x 1.5 kΩ Resistor.
2 x 3.3 V Zener Diode.
1 x Schottky Diode.
1 x 22 uF Cap.
1 x 10 uF Cap.
3 x LED.
The ATtiny85 is a microcontroller in a similar vein to the Arduino, but with much fewer IO pins, smaller memory, and a smaller form factor. In fact, when we talk about the ATtiny85 we refer to the IC itself rather than the board. The ATtiny85 can be used as a bare chip on a breadboard, as long as you can supply the correct power for the device without using any voltage regulator circuits.
ATtiny85 IC
ATtiny diagram
To use the USB cable with ATtiny directly you must use this configuration and then burn the bootloader on it to accept coding from the USB.
By using the voltage divider concept we can get a range of analog values from every click on each button in the circuit.
We make voltage divider circuit and connect the output voltage node with analog pin at the ATtiny85 which is pin 7 (port 1), So when click on any buttons we will get different analog values for each button.
We use a digital tilt sensor so we will use two digital pins for the two sensors. So we conect pin 6 and 5 with the output of the sensors.
After we finish the wiring schema we click switch or generate board then all this comonents will shown at rhe board.
We can make this steps to make the our fast pcb:
Determine the board profile.
Oeder the components behind other related to the air wires.
Set the layout design standard parameters.
Make GND plate.
Then click auto-routing and choose the highest percentage connecting paths.
Try to decrease air wires manually if found by changing components place.
After extending the Gerber files you show them on the Gerb Viewer software and extend pdf files for the bottom copper and the profile.
Then I import it on the GIMP program and isolate the drills, profile, and paths.
Now we have the three images of layout paths, drills, and profile. By using the FAB module we import the first image for paths, select paths then set the origin and axis parameters, the drill's diameter and the diameter of the path, then import the drill's image and finally the profile image then we got our PCB.
Important Note: To use the USB configuration without errors you must make the path from the diodes and USB equal.
To be a professional soldering person you must follow these steps on the photo to get a good quality node:
Now all components are on the board and it is ready to burn the bootloader and prepared for the programing.
When I start to design I assume that the thickness is 3mm and complete whole enclosure in this thickness that is not all things but when we come to fabricate that part we put it in a vertical orientation to make the snap-fit more strength but the enclosure became distortion and at last the thickness is so week so I develop the design with more thinks 4mm and edited the orientation to be horizontal.
I edited my design to be capable to put at the horizontal orientation and edited the thickness of the whole enclosure to be 4mm and add a snap to the whole top and bottom face to be fit the acrylic parts.
In this enclosure we have different materials which are 3D printed parts and acrylic, So we wanna different extension files STL for the 3D parts and the DXF for the acrylic parts.
I made a game controller sketch then made offsite out 4mm then make extent top then I made a power screw place to make the PCB be fixed and then make extrude cut for the usb of the board.
After creating the solid part we extend a .stl file from Fusion 360 and import it at Cura to slice the part and generate the G-Code to the 3d printer machine.
Then create the top sketch and consider the holes of each button of the game controller. To fabricate it we extend .dxf files to import it on the laser work in the laser cutter.
We must make synchronization between the enclosure design and PCB design to fit two designs with each other so after sketching the top I make the new sketch and make offsite in by 0.3mm as accuracy and then import it at the Eagle.
Ant after finishing the design at eagle I push it at fusion 360 software design to get the actual holes of the PCB design and integrate it at the same enclosure.
My Final Output Of The Fabrication
To make ATtiny available to upload code on its chip we must burn the bootloader which allows us to upload code on the chip.
Then we wanna upload arduino as a SPI to prepare to burn the bootloader
Now our arduino ready to burn the bootloader on the chip, We download the bootloader files from github link https://github.com/ahmedibrrahim/Attiny85-Bootloader-Files affter downloading we must move them to arduino main directory.
then make the run as administration after connecting the Arduino with the laptop and be aware to update the com with its current.
All is Done! Now our board can be connected with the laptop directly and upload code as Digispark board.
My code is divided into 4 blocks of code:
I defined the variable of the pushbuttons pin and tilt sensors pins.
Then at the void setup function, I determine the pins as input pins.
then the main code at the void loop we have two main modes the first one is the manual mode and the second one is the automatic mode. So I made one button from the six to toggle from the two modes which are action button one.
In the manual mode, I made Keyes up, Down, Right, Left, and one space.
at the auto mode we use the movement of the game controller right and left and sec action button for the up key.
I depend on Digispark Library my in code to use the keyboard interface with the ATtiny85 microcontroller chip so I include it in the first line of my code.
Initial variables and pins mode
2. Void setup function
3. Buttons mode
4. Motion mode
At the buttons mode especially we use one analog pin with voltage divider circuit so we will get different values at click each button of the came controller so we determine all values then make action for each click like up, down, right, left, space, and so on.
Finaly I enjoied so mach with this iteration as working on minimaze the frist iteration game controller through learning and go in deepth on:
Deal with new microcontroller which is ATtiny85.
PCB design and principle design.
Differant fits with differant material and how make a mixed enclosure.
Soldring as profitionals :).
Some electronics circuits and concepts.