Arduino LCD Game

131,302

414

83

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 and Tinkercad 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:

  • 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 Tinkercad 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. Here's some useful info on getting that PCB made.

Enjoy!

38 People Made This Project!

Recommendations

  • Hand Tools Only Challenge

    Hand Tools Only Challenge
  • Modify It Speed Challenge

    Modify It Speed Challenge
  • Remix Contest

    Remix Contest

83 Discussions

0
dohiistvan
dohiistvan

Tip 2 months ago

If you can't see from above you can add a potentiometer from arduino pin 12 to lcd pin 3(V0 - contrast adjust).The 220 ohm resistor is for lcd backlight only.

0
craiganderic
craiganderic

3 months ago

My display seems too bright when looking straight on. Is this normal? I tried replacing the 220 ohm resistor with a 1K ohm. That reduced the
overall brightness, but I still can't see the game display when viewing
directly from above. It seems fine (with either resistor) when viewed
from a low angle (off to the side). Is this a common artifact of the
Arduino LCD? Mine is an LCD 1602 module (with pin header) included in
the Elegoo Starter Kit.

1
CYNAlDE
CYNAlDE

2 years ago

the brightness is too much how should i reduce it.

0
craiganderic
craiganderic

Reply 3 months ago

I seem to have a similar problem. Display is too bright when viewed from above, but game is visible when viewed from a low angle. Is this to be expected?

0
midashi16
midashi16

5 months ago on Introduction

My lcd 1602 isn't turning on. Is it the same thing for a 830 pin breadboard or is it different?

WIN_20200423_13_53_07_Pro.jpg
0
SleepyAvi
SleepyAvi

Question 6 months ago

Please help, the "player" keeps jumping repeatedly regardless if i press the button or not, how do I fix it?

0
sirfitzalot
sirfitzalot

Question 9 months ago

help me!! please I've troubleshooting for hours and all it does is blinks the top row of blocks on the lcd screen. BY the way I'm using the genuino starter kit

0
Yashvanth kumar
Yashvanth kumar

10 months ago

This is so so so so so so so so gooooooood !!!!!!!!!!!!!!!!!!!
you should post in instructables contest

0
thomaspeng0720
thomaspeng0720

Question 11 months ago

how to do this with the lcd with i2c

0
Timmacht
Timmacht

11 months ago

Super LCD Spiel. Habe dieses LCD Spiel gebaut und an meiner Schule gezeigt. Alle waren nur noch erstaunt würde ich weiterempfehlen. :)

0
JohnShute
JohnShute

Question 1 year ago on Step 3

Hello, This is amazing. I wanted to look at the code so I could learn more about coding LCDs but when I click on the .ino file it just tries to install the Arduino.ide which I already have installed

2
shloimie6
shloimie6

Question 1 year ago on Step 2

is there any code for lcd with i2c thank you

0
nathan123
nathan123

Question 1 year ago on Introduction

During the upload he wrote to me: An error occurred when transferring the sketch why?
thank you

0
BasilS10
BasilS10

1 year ago on Step 1

you have to add the schematic through fritzing or something buddy inexperienced people dont know how to assemble it but thanks

0
Jankec12
Jankec12

1 year ago

good projectbut little bit to easy for me

0
gamersl1
gamersl1

Question 2 years ago on Step 3

need help wiring.

cant understand the layout

0
Vortetty
Vortetty

2 years ago

can you post a better pinnout (cant really understand this one)