Arduino VGA Games 4-in-1




After the publication of the Arduino VGAx library on GitHub done by Sandro Maffiodo aka Smaffer, I have reproduced and published on Instructable some of the most famous classical games. Recently I decided to put four of them together, in particular: Pong, Breakout, Bomber and a drawing toy inspired to Etch-a-Sketch.

The hardware is simply the same of my first Instructables: VGA Pong with Arduino Uno.

The only needed components are two potentiometers, two buttons, few resistors and a DSUB15 (VGA) connector. As usual, no supporting IC or special shields!

You can see the 4-in-1 games in action 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, thanks to the use of the potentiometers, the games run smoothly. Simple sound effects are available too.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: How to Build Your Own "4-in-1 Games" With Arduino

First download " ArduinoVGAgames" code 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.

Uploaded then the code in your Arduino (I tested Uno and Nano). A worning 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 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)
  • two buttons other two resistors (from 1 to 2 kOhm are fine)
  • some piece of cable + breadboard or a strip board
  • facultative: a piezo speaker

The schematic is reported at the beginning of this Instructable, together with an overview of the finished “console”. 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 second player potentiometer and button, while the main player potentiometer and button are in a separate and smaller box.

If you decide to reproduce this toy, I appreciate if you write a comment or send a picture in the comment section below.

Step 2: Some Final Comment

Joining four games in one was challenging, due to the Arduino lack of SRAM, the real bottle-neck of the VGA performances.

The AVR microcontroller has only 2048 bytes available to store and manipulate the variables. On the other hand 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.

Only 248 bytes are then available for the sketch variables but, in my experience, one should leave at least 100 bytes free to avoid instabilities.

The VGA standard has been officially put in retirement in 2015, for being substituted with HDMI, and nowadays is almost impossible to find a new monitor or TV that implements it.

The question is then: does it make sense to produce an Arduino game for this standard? Well, I believe the answer is yes! For this reason, nowadays, almost everybody has an old and unused VGA monitor, eventually 4:3, still working fine, since it has been replaced with an HD one. If you, as I do, feel sorry to throw in the waste a working yet obsolete device, you can convert it in an old style retro-gaming station by means of a bare Arduino and few other components.

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    17 Discussions


    2 months ago

    I only have one thing to say:
    I will do this, I will buy the components, get a VGA (video graphics array) monitor and hope it works well.

    Rob CaiDIY Circuits

    Reply 2 years ago

    Do you mean "composite video"? In my understanding having a composite color video output (RGB) for the Arduino exceeds its capabilities.

    chanovRob Cai

    Reply 2 years ago

    What about TVOut version, possible?

    Rob Caichanov

    Reply 2 years ago

    Yep! See my reply above, to DYI Circuits

    DIY CircuitsRob Cai

    Reply 2 years ago

    Yes, I meant composite video, but I don't think that RGB is necessary just black and white composite video, there should be even a library for that.

    Rob CaiDIY Circuits

    Reply 2 years ago

    Ok, then for B&W you can use the TVout library. My games can be converted for that but the conversion is not straight forward, many commands have a slighly different sintax. I did it (for instance) for tetris. You can find both versions here, among my other instructables.


    2 years ago


    I want try do this project , it's amazing !

    But the problem my screen is completely disformed like you can see on the picture above.

    I try another monitor and another power but the problem was the same

    Perhaps it's because i'm working for the moment with a breadbord ?

    Thanks for you attention :-)

    4 replies

    Reply 2 years ago


    i find myself the solution of my problem ...

    I change my version of Arduino , i try the version of this instructable (1.6.4) and it's working fine !

    Perhaps a picture of my versio coming soon ...

    Rob Caifredlb

    Reply 2 years ago

    dear fredlb,

    for my curiosity, which version where you using before?

    A picture will be very appreciated!

    fredlbRob Cai

    Reply 2 years ago

    Hello ,

    I use the latest version of Arduino 1.8.1 and i try also an old version like 1.5 , but only the 1.6.4 version works .

    For the picture , are you talking about the problem ?

    Rob Caifredlb

    Reply 2 years ago

    Dear fredlb, thank you for the comment, I did not realize before that the latest Arduino software version (IDE 1.8.1) is not compatible.

    About the picture, if you decide to build a game consolle, such as the one below, if you like you can show it here with a picture.


    2 years ago

    This is amazing i can show my daughter how it was done in my ages :)