Final Project

This page documents my final project updates and ideas.

There are several parts of this projct. It is a prject i am making as part of Fab Academy
The idea
Applications and Implications
Overall preview
Circuit design
Circuit Production
Arcade design
Laser cutting and assembly
Coding and Testing
Operational arcade
Mistakes / Lessons / Future areas of improvements
Downloadable files

Ideas I had

I've had several ideas for the final project that I talked about during the principles and practices week
Principles and Practices week
I settled during that week on creating a retro style claw machine which I thought was really cool, but that was 14 weeks ago. I changed my mind in the mean time and decided to make something else.

The final project idea

I am sticking to the retro theme for this project, However I decided to make something else that i really wanted and thought was interesting. I decided to create a retro arcade gaming machine.
This started from thinking back to old arcade 8bit games. I thought they were interesting and really wanted to create something that I would enjoy using and would include some retro games. I decided to create a mini arcade machine capable of running some 8 bit arcade games. I will be depending on some open source games that already exist with adjusting them to my needs.

Applications and Implications

This section is about the project details, including defining the scope of a project and developing a project plan.

what will it do?

It will be a mini arcade that is able to run some retro 8 bit games using buttons and a joystick as input. It will not be portable, It will be stationary working on a power supply. It will be a single player gaming arcade.

who has done what beforehand?

My arcade machine is based hugly on an open source Arduino library called TVOUT. TVout is a completely interrupt driven library that will output either NTSC or PAL composite. its great becuase it requires very minimal pins to generate sound and video that can be displayed on screens, although it is black and white.

Theere are some games already made that depend on the library to display the game on TV.
What i am planning to do is use the library and the resources avialable to run games on my arcade by using an atmega328 microcontroller and that is running on my screen in an arcade case and with joystick and arcade buttons as inputs.

what materials and components will be required?

To create this project I will need a lot of electronics parts and also material to build the case for the arcade.
Input part:
- tactile buttons for the arcade user input
- joystick
Microcontroller part:
I will be using an Atmega328 as the microcontroller.
- crystal
passive components
Sound output and display:
screen with an RCA plug.
- wood and acrylic for the outer frame

where will they come from?

I ordered the components that I need from digikey after doing the reasearch to select parts for my design.

how much will it cost?

The electronics components i ordered from digikey cost 44 $ This is my digikey cart link Cart
Aside from that, I will use electronics componenet available in the Fab Lab (the micorcontroller IC, resistors and capacitors) with an approximate price of 30$ (There will be a complete BOM), A screen I bought locally that costs 15 BHD (approx 40$). As for the body materials, the arcade will require approx 1/4 sheets of acrylic which costs 6 BHD (16$) and three sheets of cardboard which costs 6 BHD (16$) and some screws and corner braces costing 1.5 BHD (4$)
The total cost is ~140$

What parts and systems will be made?

All the electronics parts will be designed and produced by me. I will be designing and making the body of the arcade and experiment with creating an interface.

What processes will be used?

several processes will be used including:
- electronic production (the circuits)
- electronic design (the circuits)
- input devices (the controller)
- output devices (the screen and sound)
- computer aided design (body design)
- 3d printing (the buttons and joystick )
- computor controlled cutting (arcade body cutting))

what tasks need to be completed?

At this point, most of the tasks are yet to be completed. I havent used almost any of my weekly assignments to complete parts of my final projects which is probably a big mistake and will not leave me with much time. the reason for that is that I remained undecided on the exact details of my final project until very recently.
The task i am mainly concerned about completing is the circuit design, manufactoring and programming. The circuit will contain so many elements as it is one large circuit containing every part of the project and any mistake would mean that i would have to redo it and resolder all the components which is a very time consuming process.

What questions need to be answered?

Will I be able to generate video well? Will I be able to create my own interface? I know that it is possible but I will need to conduct more reaserch and spend more time expirementing.

What is the schedule?

1- design and create my control panel (the buttons and the joystick).
2- Experiment with programming and generation video and sound using an external microcontroller board.
3- design and make the microcontroller circuit
4- make the body of the arcade (design using solid works and lasercut).

How will it be evaluated?

There are many elements that the final project can be evaluated on. The major factors are the following:
- Does it work?
- Does it look like an arcade?
- Is it responsive and user friendly?
- How well constructed is it and how are the parts working together?


The final product resulting from the circuit is an arcade. The main controller of the arcade is a centrilized circuit that controlls everything and that is the main line of communication. The circuit connects through an RCA header to a screen and it supplies it with video and audio. The user controlls the game via a controller panel connected to the circuit via GPIO headers. The controller consists of 6 pins and one joystick. The main case of the arcade is made via laser cut acrylic and cardboard.

Circuit design

The circuit is really the heart of the whole project, it basically connects all the components of the project together. The circuit is based on an atmega328 microcontroller with a 16MHz crystal. I designed the circuit using eagle. The needed to use an ATmega328 for its processing power to run the TVout library which is capablie of generating video and sound on a screen.
The circuit consists of the following major copmonents: The microcontroller,a serial header, a power in header, spi programming header, RCA connector and the GPIO headers and that is pretty much it! Its not really the most complex circuit.
I created the scehmatic and pcb board on eagle.

And now it was on to creating the PCB. One of the problems I faced immediately was the RCA connector. It was something my instructor (Salman) found for me locally from a studio repair shop. I tried to find the footprint for this connector online or even a datasheet and had no luck with that. I found similar versions to it being sold on some websites but with no datasheet or spec file. That meant that I had to make my own footprint.

I made my own footprint for components on Altium designer software before, but not on Altium. I knew I had to create something for my header thought if I wanted to use it on my pcb. The first step is to figure out what connects where. The header has six pins that connect to the PCB. I used a multimeter and coducted the continuity test to find the two pins that were connected to ground (the outer part of an RCA header is ground).

A typical RCA cable that connects to a TV or a screen with Audio branches into three different headers normally. one for video, one for left audio and one for right audio. My header has four slots for signal, I was free to use any three of those as long as they connect to the right place on my circuit. To create the footprint, I measured the distance between each of the pins from one another, the size of the body and the size of the pins. The pins themselves are quite large and the footprint has to reflect that. The downloadable eagle library containing the footprint I created is in the downloads part at the bottom of the page. I connected both the left and right audio signals in the header to the same audio signal so it would be repeated in the left and right speaker

You will also notice that in the schematic above, I am using the ATMEGA88 chip and not the ATmega328. I AM in fact using the ATmega328, however, I could not find a footprint that is millable by the 1/64 inch bit that belonged to the ATmega328. The Fab library conains a special "thin" version of the ATMEGA88 that can be milled with such a milling bit. I did not have any smaller milling bits on hand so I had to use this footprint. both chips are the same exact size and are the same package. I just had to be careful and check the pinout to make sure everything is connected to where it should be.
One more thing was the power header, I am using a 1985823 header. I am a big fan of this kind of header becuase I can remove the cables whenever I want and disconnect the power from the circuit. perhaps using a switch is a good idea too but this works just as well. (okay perhaps unscrewing a contact off is slower but hey it works). I found the footprint for this header on the website. (Available in the library linked in the download section)

Aside from that, I basically had everything I needed to create the PCB. I connected all the components. I had to use 3 surface mounted 0ohm Res jumpers and three through hole jumpers that connect on top of the circuit.

Circuit Production

Disclamer: A 0.01 inch milling bit was harmed during the making of this circuit.
When finalizing the design of the circuit, Before realising that the THIN Fab Library IC footprint could be milled with a 1/64' bit, I thought I had to use a 0.01 inch bit to mill this circuit which I had not done before. I am using the monofab SRM20 desktop milling machine to mill my circuit. I used the PNG images that I made of the circuit and the boarders in FabModules online to generate the cutting file. None of the resources that I found online were meant for the 1/64 and 1/32 bits. I used the same settings meant of the 1/64 bits, A speed of 4 mm/s and zjog of 12.

It did not end well. The 0.01 inch milling bit broke a few tracks in. It was only when that happened that I realised that I could in fact just mill my circuit with a 1/64 bit which would get the job done much more efficently.
I redid the cut paths and managed to actually mill the circuit this time.

My circuit was milled, but it was not ready to go. My circuit is quite large, 85.367 x 76.376 mm to be exact. The only PCB boards I had to mill a circuit of that size on, was double sided ones. So on the other side of my circuit, I had another copper layer. That would not be a concern if I was using fully surface mounted components. i would just ignore that side all together, but I had through hole components.
with through hole components, I would have to connect thm on the other side of the circuit, and would copper being there, there would be a chance of the pins or conductive parts of my components on that side to touch the copper and create a short circuit. I had to get rid of the copper layer before I could use the circuit.
I tried using a rough sand paper to sand it off but that did not really work.

I resorted to using a small hand held snading tool to get rid of the layer. It took a while and a lot of work but it got rid of it. The result did not look pretty

Following that, it was finally ready for soldering.

Coding and Testing

The games running in the arcade project is based on the TVout library. Unfortunetly, that means that they run in black and white only.
TVout is a completely interrupt driven library that will output either NTSC or PAL composite. its great becuase it requires very minimal pins to generate sound and video that can be displayed on screens.
I was not always intending to use this library, My intial plan was to use a digital TFT screen with an spi connection. I did some experiments using the adafruit 7.0" TFT screen and RA8875 Driver without much luck. It was too slow to be able to run a game.

Following that, I looked for alternative solutions to run a game successfully on a small screen with a microcontroller circuit of limited capablities until I found and experimented on the TVout library with an arduion uno. it worked perfectly for my purpose

One big challange following that was finding a small screen that is capable of running RCA. analog video is pretty much non existant anymore and is not supported on many screens. I certiently could not find a decent analog tft screan online on digikey.

I looked around locally for a screen that I can use for this purpose. Tha search continued for a very long time. The only small screens I found with analog video were portable DVDs which is not exactly ideal for my purpose. They are big and bulky and the shape just does not work in an arcade unless i take it apart and risk ruinining it.

Until, FINALLY. I found it. Something I did not even know existed but apparently did. Purchased from a small local traditonal bazar market. A portable TV that can pretty much do it all.

I got the 7.5 version of this portable TV. It is capable of running analog video via an RCA cable, playing FM radio stations, playing tv stations and playing videos and music off a usb flash drive. I almost felt bad sticking it in an arcade to use only one of its functions. I hooked it up and it was ready to go in no time

To test the functionality of my circuit and to test the Tvout library, i used games from an opensource gameing system called Hackvision. Hackvision is a simple, retro gaming platform based on Arduino technology that you can assemble and connect to TV. There are muliple games available for it online and are quite fun to test out using an arduino UNO or a similar microcontroller board. hackvision
In order to use my circuit, I first had to bootload my atmega328 to be able to communicate with it using the arduino IDE which is my preffered programming method. I followed the steps in this tutorial and then started uploading to my microcontroller using my programmer.

Arcade design

When designing the arcade, the beggist challange was deciding the easiest and most efficeint way the parts can fit together. I already had a basic idea of how I wanted the arcade to look like. Most arcades look pretty much the same in terms of outside appearance. So that part was not very difficult to figure out.
I created the design of my arcade in Solidworks as a 2D sketch and laser cut it on cardboard and acrylic. Important factors to consider in my design was the size of my screen ( 155mm * 86mm), the size of the controller to allow comfortable usage and the assembly method.
Selecting and implementing an assembly method was the most difficult part of the design process. I had to consider factors like how the parts would fit together, the ease of assembly and the way the arcade would look. It was the most difficult part to impliment in the design.
I am using nuts, bolts and corner metal brackets for the assembly method.

I had to include the location of the brakets in my solidworks design. The design consisits of 11 pieces (design files linked below) that fit together to create the arcade.

Most of the design was made using the line, Rectangle and circle sketch tools. The use of "smart dimension" and "Add relations" tools enabled me to create an accurate design and to make sure that every line amd hole was exactly the right size and at the right place.

Laser cutting and assembly

I laser cut all the parts I designed in solidworks both in acruylic and cardboard. I am using transparent acrylic so was able to layer them on top of each other to create colored sections of the arcade. I went for blue and green as the colors of the outer part of the arcade.

The assembly of the parts was all made using the brackets, nuts and bolts. To keep my screen in place, the screen had areas meant to be used to hang it in place, I used that as part of my design and hanged it in place.


For the controller part of the arcade, the number of buttons needed depends on the game being played. I decided to add a large number of buttons in addition to a joystick to maximize the possible number of games that can be created and played as some might require a large number of buttons to control.
For the layout of the buttons and the distances between them, i went with the arcade layout and measurments of an old arcade found here.

I selected the buttons and joystick for my arcade. They are meant to be used on a PCB and not in an arcade so I had to create a casing for them. I created a 3d design and 3d printed it to be able to use the buttons on the arcade. The design consists of two parts, a housing that the button is placed in and a top part that goes on top of the button. The buttons i am using are Tactile Switch Buttons 6mm and are the tall type with height of 8.25mm from body, 12mm above the PCB.

I soldered wires into the pins of the buttons after fitting them in place in their housings. This step has to be done after putting it in place as the hole in the housing is not big enough to fit the soldered wire.
I soldered two wires to every one of the buttons.

For the joystick part, i am using a 2 - Axis Navigation Switch. I created a 3d file and 3d printed a handle for it to be able to use it as a joystick. (download file linked below)

i soldered wires to every one of the 5 pins of my joystick and use dheat shrink to insure it stays in place. one pin (the middle one) is ground and each of the four others cooresponds to a direction.

To connect the buttons and joystick to my circuit, I used a prototyping board as a connection hub between my circuit and my controller. Using this prototyping board gives me freedom to change the number of buttons, to connect an external controller and to change button allocation without soldering / desoldering my main circuit.

Operational arcade

Mistakes / Lessons / Future areas of improvements

Arcade Assembly method and errors

I chose to use nuts, bolts and corner brackets as the sole method of constructing the arcade, this did work, however it was a rather long process to connect the parts together and assemble the arcade. It does tend to get loose somewhat easily. Assembling it all was quite a time consuming process espically with the tight spaces around the corners and the top inner parts of the arcade. For future versions of the arcade, I would not abandon the nuts and bolts method fully, but i might reduce their number and add some joints in the design to hold everything together better.
The Design also contained some small isues with assembly. The thickness of the acrylic was not accounted for when it comes to tighet areas of the design (3mm acrylic) so I used the cardboard part alone without the acrylic for one of the panels. A future area of improvement would be to account for the thickness of the material in the design. Possibly by adding a parameter that changes the aspect of the design the are affected by the material thickness.

Is it even working?

My circuit contains no LEDs. None. Not one.
I did not even consider that it would be a problem until I soldered everything and powered it on. Nothing happened. I had no way of telling if it was powered on, if my microcontroller was working or anything. I wanted to test my microcontroller with a simple code to check if the timing was accurate and if everything was uploading right. I couldnt do it easily. An led connected to one of my gpio pins would have made that process so much easier.
Dowing this again I would definetly include an LED to indicate the circuit is powered on, and an led connected to one of the GPIO pins for simple debugging purposes.

Downloadable files

Circuit eagle schematic sch file
eagle library containing all the footprints lbr file
Circuit eagle board brd file
Circuit PNG image file
Circuit boarders PNG image file
Arcade design 2D case DXF and solidworks file
Arcade Joystick part 3d print STL file
Arcade button top part 3d print STL file
Arcade button housing part 3d print STL file
game code