Introduction: Arduino VGA Game Console
I have done seven Instructables to reproduce some among the most popular old arcade games by means of a bare Arduino and few basic components. The main feature is the generation of a VGA signal, thanks to the VGAx library, published on GitHub by Sandro Maffiodo aka Smaffer.
On the other end any games needed a slightly different configuration, i.e. a different number of buttons and/or potentiometers to drive it.
Finally I decided to build a single game platform, and to correct the codes consequently, for all games, in particular: Pong, Tetris, Breakout, Snake, Bomber and a drawing toy inspired to Etch-a-Sketch.
In this Instructable you can find three codes, (Tetris, Snake and a code for the other four games put together), and the instructions to build a “console” as the one shown in this page.
I decided to split it in two units: one with a potentiometer and four buttons for the single player games, the other with one button and the second potentiometer for the second player (i.e. for Pong).
Thus in total you need 5 buttons, two potentiometers, a VGA connector (DSUB15 female) and, of course, an Arduino! Most importantly, there is no need of supporting IC or special shields!
You can see the complete setup in this video.
The VGAx library allows to use four color with a resolution of 120 x 60 pixels, not many but enough for this retro-game “console”. The graphic is raw but all the games run smoothly. Simple sound effects are included too.
Step 1: How to Build Your Own Arduino VGA Console
List of materials
- an Arduino Uno Rev. 3 or an Arduino Nano 3.x
- a DSUB15 Connector, i.e. a VGA female connector or a VGA cable to be cut
- four resistors: 2 x 68 Ohm and 2 x 470 Ohm
- two 10 kOhm linear potentiometers (similar values are fine too)
- five buttons (Normally Open)
- other five resistors (from 1 to 2 kOhm are fine)
- some piece of cable + breadboard or a strip board
- facultative: a piezo speaker
- one or two boxes in plastic or wood to fix everything togheter, and a cable with at least four wires inside to connect the two boxes
First download MultiGame.ino, Tetris.ino, Snake.ino codes at the bottom of this page and copy it on your PC in a directory with the same name. Then download the Smaffer’s VGAx libraries from this link on GitHub. The easiest way is to copy them in the Arduino software subfolder named "libraries", to be immediately recognized.
IMPORTANT: this library works for Arduno IDE 1.6.4 but it is not fully compatible with elder or newer versions.
Depending on the game you choose to play, uploaded the relative code in your Arduino board (I tested both Uno and Nano). A warning for low available memory is normal. If you do not have other errors everything is ok and you can immediately start to build your own console. For this you need:
- an Arduino Uno Rev. 3 or Arduino Nano 3.x (ATmega328)
- a DSUB15 Connector, i.e. a VGA female connector or a VGA cable to be cut.
- resistors: 2 x 68 Ohm and 2 x 470 Ohm and 5 x 1 to 2 kOhm
- two 10 kOhm linear potentiometers (similar values are fine too)
- five buttons
- some piece of cable
- one or two nice boxes to put all the components.
Facultative:
- a breadboard or a strip board
- a piezo speaker
The schematic is reported at the beginning of this Instructable, together with an overview of the finished “console”.
It shows, as an example, how to connect a button and a potentiometer. More specifically, you need to connect five buttons to pins 5, 10, 11, 12 and 13 respectively. The action performed by each button is described in the upper right table in the schematic (i.e. the four arrows and player one and two start button (P1 and P2). On the left, how to connect a potentiometer is shown (you need two potentiometers to pins A1 and A2).
The speaker must be connected to analog pin A0.
I placed the Arduino board with the VGA connector in a wood box, which holds also the first player potentiometer and four buttons, while the second player potentiometer and his start button are in a separate and smaller box.
If you like this toy and you decide to reproduce it, please vote it for the microcontroller contest! I also appreciate if you write a comment or send a picture in the comment section below.

Participated in the
Microcontroller Contest 2017
18 Comments
Question 3 years ago
Hi, great project, I am building this with my 10 year old son at the moment.
Did you power the Arduino from USB or can you use 5v from the VGA cable?
Answer 3 years ago
No 5v from the VGA monitor, had to power from USB.
4 years ago
Can u plz specify the button circuit...
i mean that in the circuit, the gnd and pin are connected directly... i m new. plz help.
Reply 4 years ago
For a given button (for instance button 2 = UP), you need to connect one side to the pin 5V of the Arduino, and the other side to the Arduino digital input shown in the connection table above (thus UP is digital pin D11). You also need to connect this side of the button to a resistor (about 1 - 2 kOhm), and the other side of the resistor has to be connected to the Arduino GND pin. NB each button needs an independent resistors, thus for five buttons you need five resistors in total.
If you plan to build this console, I would recommend to choose the last version which has five games in total.
5 years ago
Can you post links to websites or places where I can get all of the parts necessary as well as the price of each part? I'm not so good with this stuff but I at least want to try to make this for my boyfriend, but I'm not sure how much it will cost me or where to start as far as where to get the parts and such :/
5 years ago
What kind of cable do I need?
Reply 5 years ago
to connect the main box with the second player one? Any cable with four wire inside...
Reply 5 years ago
thank you
5 years ago
Is there a parts list with links?
Reply 5 years ago
I have now added the part list in the Instructables
Reply 5 years ago
6 years ago
How Hard would it be to get this to work with TV out instead of VGA? http://playground.arduino.cc/Main/TVout
Reply 6 years ago
It is possible but the conversion is not straight
forward, many commands have a slighly different sintax. I already did it for other games. You can find among my other Instructables Tetris in both versions (VGAx and TVout).
Here in #6 you can find Bomber in TVout version.
6 years ago
Awesome project! Will more games fit into the ram?
Flappy Bird, a racer, a jump and run, so many more games that would work in that resolution.
A speaker might also be a nice addition. More buttons for the 2nd player... :)
Reply 6 years ago
Dear krummrey, the real bottle-neck for these games is the Arduino lack of SRAM. The AVR microcontroller has only 2048 bytes available to store and manipulate the variables, and the VGAx library stores the screen variables in a 120x60 pixels framebuffer where each pixel needs 2 bits (4 colors), for a total of 1800 bytes. This means that there are
only 248 bytes left for the sketch variables. Furthermore, in my experience, one should leave at least 100 bytes free to avoid instabilities. Anybody surely can create more games but most likely they cannot join them in a single sketch.
By the way simple sounds effect are already included! Just connect a piezo speaker to pin A0.
6 years ago
Really great !!!, especially for senior citizens hobbists like me. Thank you so much for publishing this.
6 years ago
Awesome
6 years ago
This is very impressive! Congratulations!