Whac-A-Button With Arduino

Whac-A-Mole like game with Arduino and Arcade style LED buttons


This is a very simple version of the Whac-a-mole game, where a button lights up and waits for the player to hit it. If the correct button is hit the score is updated and a new button lights up. The player is not punished if they hit the wrong button. Only one button lights up at a time. Time to hit the button reduces each game cycle.


5 LED buttons
All required wires, screws and nuts
Arduino nano
Laser cut acrylic panels
4 digit 7 Segment display TM1637
USB cable

DXF files available at Thingiverse

Download the code from GitHub – Whack-a-button


Start by adding the display and buttons. Make sure the display pins are pointing inwards, the colour arrangement of the buttons is up to you.


Use 2 screws to secure the display in place.


Keep all buttons in the same orientation – it will make wiring easier.



Wiring might look messy but it’s very simple.


Connect all grounds together using the daisy chain 2.8mm crimp connectors. Again if all buttons are in the same orientation it will be much easier. The end with a jumper wire connect to the Arduino GND.


Now connect the rest of the pins as shown in the images below:




Connect the display.

Display –  Arduino

CLK    –   Pin 8

DIO     –   Pin 7

GND    –  GND

5V        –  5V


Use jumper wires to connect all LEDs to the Arduino pins.

LED1 – Pin9

LED2 – Pin10

LED3 – Pin11

LED4 – Pin12

LED5 – Pin13


Now use jumper wires to connect all buttons to the Arduino pins. Make sure that if you’ve used for example the green button for LED1 you’ll have to use it as Button1 as well.

Button1 – Pin2

Button2 – Pin3

Button3 – Pin4

Button4 – Pin5

Button5 – Pin6


Tape the wires together to keep them from disconnecting.


Once everything is connected test if it works before assembling the panels.



Download the code from GitHub – Whack-a-button and upload it to the Arduino.

At start the game will be in waiting for input where all LEDs will be flashing until one of the buttons is pressed and that’s when the game will start. After the game ends it will return to the waiting for input state while still showing the latest score and it will stay like that until a button is pressed and new game starts.

After you’ve checked that everything is connected correctly assemble the rest of the panels.



Leave the right panel last as that’s where the usb cable will be coming out.



Enjoy your play.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

Create your website at WordPress.com
Get started
%d bloggers like this: