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
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.
- 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.