Introduction: Arduino LCD Game

Making a great many things is very easy with Arduino microcontrollers. This Instructable tells you how to create a simple 1-button video game made from a handful of parts in the Arduino Basic Kit from 123D Circuits. It is a side-scrolling jumping game. This serves as a good starting point for creating your own games from simple maker electronics.

Parts list (all can be found in the Arduino Basic Kit):

  • 1 x Arduino UNO
  • 1 x LCD screen (16 x 2 character)
  • 1 x Electronics breadboard
  • 1 x 220 Ω resistor
  • 1 x Pushbutton switch
  • Solid-core hookup wire
  • 1 x USB cable

Step 1: Assembling the Parts

The parts needed are shown in the picture above.
Start off with the Arduino unpowered. Do NOT plug in the USB cable. That will happen in a later step when it is time to program it and try the game out.

Use a long hookup wire to connect the 5V signal on the Arduino to the far left of the red row at the top of the breadboard.

Use a long hookup wire to connect the GND signal to the far left of the black (or blue on some breadboards) row at the top of the breadboard.

The LCD (Liquid Crystal Display) module has a 16-pin male header on the underside. Plug this into the breadboard as shown in the picture. All of the electronic signals that power and control the LCD go through this header.

These pins are (from left to right):

  1. GND - power ground signal
  2. VCC - positive power signal
  3. V0 - contrast adjust
  4. RS - register select
  5. R/W - read/write select
  6. E - operation enable signal
  7. DB0 - data bit 0 (not used here)
  8. DB1 - data bit 1 (not used here)
  9. DB2 - data bit 2 (not used here)
  10. DB3 - data bit 3 (not used here)
  11. DB4 - data bit 4
  12. DB5 - data bit 5
  13. DB6 - data bit 6
  14. DB7 - data bit 7
  15. LED+ - backlight LED positive
  16. LED- - backlight LED negative

Using short hookup wires, connect GND and LED- (pins 1 and 16) to the black row at the top.

Similarly, connect VCC (pin 2) to the red row at the top with a short hookup wire.

Bend the wire leads of the 220 Ω resistor (red-red-brown colored bands) and connect it between LED+ and the red row at the top of the breadboard.

Use longer hookup wires to make the remainder of the connections:

  • Connect DB7 to Arduino pin 3
  • Connect DB6 to Arduino pin 4
  • Connect DB5 to Arduino pin 5
  • Connect DB4 to Arduino pin 6
  • Connect E to Arduino pin 9
  • Connect R/W to Arduino pin 10 (or to black row at top of breadboard)
  • Connect RS to Arduino pin 11
  • Connect V0 to Arduino pin 12 (or to black row at top of breadboard)

Plug the pushbutton somewhere to the left of the LCD screen, straddling the channel running along the center of the breadboard (see picture above). Connect one of the top two pins of the button to the black row at the top of the breadboard using a short hookup wire. Connect the other pin at the top of the button to pin 2 of the Arduino.

Step 2: Programming the Arduino

At this point, you should be ready to program the Arduino and test it out.

Start by making sure that you have the Arduino software installed on your computer. Download the LCD_Game.ino file on this page to your computer and open it in the Arduino software. Make sure the board is set properly for programming (Tools → Board →Arduino Uno).

Connect the Arduino to your computer using the USB cable. This will provide power to the Arduino/game and allow you to upload your program to the Arduino.

At this point, the screen of the LCD display should light up.

Program the Arduino by selecting File → Upload (or press the right arrow button at the top of the Arduino software).

If all goes well, the LCD screen should now show the game start screen like in the picture above.

Step 3: Changing Things and Making an Arduino Game Shield

At this point you have everything working, so what more is there to do?

If you want to change the way the game works, or make a cool printed circuit board for this project that plugs directly onto the Arduino and replaces of all those messy wires, here's how to get started.

I developed this game entirely using the very cool (FREE!) online electronics simulator 123D Circuits. I actually had the game fully working and tested before ever taking the Arduino out of the kit. Here's the virtual circuit for the Arduino LCD game.

You can actually play the game right in your browser without ever having to put together any actual electronics ("Oh, now you tell me"). If you want to make any changes to the game, or explore what's going on, you can copy the virtual circuit using the "Duplicate Project" button. You can then edit the source code and try out changes right there. There's also a full-featured debugger where you can step through the program line-by-line and see what's going on!

If you are so inclined, you can also make a circuit board to nicely connect your electronics to the Arduino. The project has a "Download Gerber" button that will get you the files necessary to give to a printed circuit board (PCB) manufacturer to have a custom printed circuit board made. You can see what this PCB look like by clicking the "PCB View" button toward the upper right of the circuit. Here's some useful info on getting that PCB made.



cliptwings made it! (author)2016-05-24

Thanks so much for developing this project. I used it and modified it for a geocache I just placed. Once the finder gets at least 50 points, the LCD displays the coordinates for the final stage of the cache.

Run, Geocacher, Run!.MOV
deeppws (author)cliptwings2017-02-01

That's brilliant

TimC211 (author)cliptwings2017-01-31


joshua.brooks (author)cliptwings2016-05-24

That's brilliant!!!!

FABIOB14 made it! (author)2017-07-24

I made it with my son for his school's science fair. We changed the code to work with the I2C library. We also added a button to double speed, another button to turn it on and off, and an internal cel phone battery whith a module to recharge it. The case was made from the cover of an old notebook.

BhaskarP6 (author)2017-06-08

really cool one, thanks for the tutorial

BitterweedDK made it! (author)2017-04-19

Finally made it work on the IC2 :) It is such a simple setup with that display (Once you code it the right way). Thankyou for a simple, but "hard to figure out" project :)


hi , can you send me the code ?? please :D

MarcC105 made it! (author)2017-05-11

Hi my name's Marc and I've just copyed this game for a little school free arduino project. While I was doing it i got an idea. How can I change the characters (little guy, and squares) to animals or other things? (thanks for your help).

aaronlionheart (author)MarcC1052017-05-23

hi marc , do you have the arduino code with lcd i2c? can you send me pliz?

joshua.brooks (author)MarcC1052017-05-11

The display allows you to customize eight 5 pixel x 8 pixel characters. Look in the source code around line 43 for something like:
// Run position 1









This is where the program defines the custom characters using binary values for each of the horizontal pixel lines of the characters. Each line that begins with 'B' defines a binary value. The following 5 characters are either '0' if the pixel shold be off or '1' if the pixel should be on. I hope that this helps.

DaveC216 made it! (author)2016-10-04

What a fun project! I converted the LCD to use the I2C library, which was very simple and much simpler hookup. Very creative and an excellent use for a spare Arduino and LCD. I'm thinking I'll write another version somewhat like Centipede where the blocks come in from different directions. Thank you for the inspiration. This is going to be a LOT of fun!

Diogo Nery (author)DaveC2162017-03-22

Can you send the game code?
SaltanatM (author)DaveC2162016-11-22

where did you changed your code in order to make it work

SaltanatM (author)DaveC2162016-11-22

Hi)) I saw form your picture that you connected the lcd to analog input , that's fimiliar to my situation, but I can not get the image of the game on lcd. Please give me some advice , i want to try it too...

DaveC216 (author)DaveC2162016-10-04

p.s. I love the autoplay option. Very entertaining to just let the thing run by itself.

TimC211 (author)2017-03-17

somehow I managed to get over 395

EvripidisM made it! (author)2017-02-20

very good!!

viber image.jpg
gogoguy (author)2016-03-30

I got 91

zubeyr (author)gogoguy2017-02-15

İ am 10 years and I got 147 my dad got 256

lukecorcoran (author)gogoguy2016-05-01

i got 104

Melih_16 (author)2016-11-13

Acil yardim edin arduino atinca programi boyle hata veriyor acil yardim edin

zubeyr (author)Melih_162017-02-15

abi hatanı copy edib at böyle göremedim.

joshua.brooks (author)Melih_162016-11-14

Maalesef sorunu tamamen anlamıyorum. Ayrıca, Türkçe bilmiyorum. BareMinimum örnek programında olduğu gibi çok basit bir programı derleyebiliyor ve yükleyebiliyor musunuz?

Wiz3x (author)2016-12-26

Doesn't work for me. I checked the wiring 3 times and it didn't work anyway. The LCD turned on but it shown just a white line at the top. what can I do? Please help me.

dcontractor1 (author)Wiz3x2017-02-03

I am getting the same line on the top


I've not encountered this particular problem. In the picture from the first person, it looks like the backlight resistor is not 220 ohms. It might be possible that the circuit is drawing too much current, so the LCD panel isn't able to properly initialize. Try removing the backlight resistor or that wire to ground, and see what happens after resetting the Arduino.

orkunza made it! (author)2017-02-01

Great project? Works nicely!

TimC211 (author)2017-01-31


TimC211 (author)TimC2112017-01-31


TimC211 (author)2017-01-27

I think you need to add some more images

sunlitho (author)2017-01-24

The Arduino IDE will not open the sketch. Can you send a text file?

joshua.brooks (author)sunlitho2017-01-25

The .ino file is actually just a text file. Try changing the .ino to .txt or just open it with a text editor and copy and paste the text into a new Arduino project.

Fiaz IslamB (author)2017-01-20

My LCD backlights arent glowing. how do i fix it ? i did everything exactly as mentioned.


Some LCD panels don't have a backlight installed. It is the (often) trapezoidal shaped part immediately to the right of the panel. If yours does have the backlight installed, it could just be faulty. It's like any other LED, so if you at any point you connected it without the resistor, it could have broken because of too much current through it.

Screen Shot 2017-01-23 at 10.42.28 AM.png
RyanS374 (author)2016-12-26

This was super fun and easy. This was my first project on my new arduino and I made it with almost no problems

SaltanatM made it! (author)2016-11-22

Your project is really great! It inspired me to try it too! But in my lcd i have 4 pins: vcc, gnd, sda,scl and i have been connecting them to arduino board 's analog input in order vcc-5v,gnd-gnd,sda-A4,scl-A5. And i have changed in code LiquidCrystal_I2C
lcd(12, 11, 5, 4, 3, 2); to LiquidCrystal_I2C
lcd(0x3f,16,2); and there is no picture(( Please, help me .

joshua.brooks (author)SaltanatM2016-11-29

I've never used an I2C module, but there are a couple of possibilities that I see here. It appears that you may have the row/column parameters swapped. According to this page (, the # of rows should be the second parameter and the number of columns the third. Also, are you absolutely sure that the I2C address (the first parameter) is correct?

ProZockermt2 made it! (author)2016-11-02

really great and easy, i build it myself and well... one tip for new ones solder your wires into the lcd properly and you wont get any flicks it will work perfectly.

Also i will code some other Games for this Layout maybe a multiplayer for this game ;)


Instructables_Lcd game.png
'DrackuinM (author)2016-10-22

very good. but now I also want to control everything from a mobile application made in app inventor. you can help me?

joshua.brooks (author)'DrackuinM2016-10-24

I've no pactical experience with app inventor, so I can't help directly. How do you plan to send the button pushes to the Arduino?

RobodiaR (author)2016-10-20

Thanks for sharing this amazing project!
While checking the code, i did not understand this line.
Can you plz explain , what this line do?

Thank you!

RobodiaR (author)RobodiaR2016-10-20

And can you plz tell me where Arduino pin 1 (TX pin) connected to?
From the schmaticDiagram, it seems like it is connected to Ground(GND) pin.

joshua.brooks (author)RobodiaR2016-10-20

That pin is connected to a second, secret "cheat" button.

Screen Shot 2016-10-20 at 7.39.09 AM.png
joshua.brooks (author)RobodiaR2016-10-20

You are very observant! You found the easter egg. If a second button is connected between PIN_AUTOPLAY and the normal button pin, when it is pressed and held, the hero automatically jumps at the correct time. It's the game cheat button!

AndreD91 (author)2016-10-04

Loving all the comments in your code.......

HeinzA1 (author)2016-09-22

Cool project :D

Very nice game! The only thing that could be added is a Highscore ;-)

KonstantinosT4 made it! (author)2016-07-28

this game is very very nice

KonstantinosT4 made it! (author)2016-07-28

this game is very very nice

KonstantinosT4 made it! (author)2016-07-28

this game is very very nice


About This Instructable




More by joshua.brooks:Pogo pin programming connectorHand-held zoetrope sculptureNeopixel Night Light
Add instructable to: