A DIY LED Strip GameBox

by Mr_Electronaut in Circuits > LEDs

73 Views, 0 Favorites, 0 Comments

A DIY LED Strip GameBox

DIY LED GameBox
GameBox - Arcade

I have always loved playing arcade games. Whenever I visited places with arcade machines, I enjoyed trying different games, but playing them regularly can sometimes be expensive, and you can only play them where the machines are available. That got me thinking: what if I could build my own arcade gaming system that is affordable, portable, and fun to play anywhere?

That idea led to DIY LED GameBox — a simple, DIY gaming system built using an addressable LED strip, a microcontroller, and a few buttons. The goal is to make gaming easy to build and accessible to everyone, whether you're indoors, hanging out with friends, or enjoying a picnic outdoors.

The best part is that the same hardware can run multiple games. You can race cars, shoot approaching enemies, challenge your reflexes, and create entirely new games without building a new device from scratch. You can start with a simple setup and gradually expand it with more LEDs, displays, sound effects, new controls, and more complex game mechanics.

With DIY LED GameBox, I want to show that you don't need an expensive arcade machine to have fun. With a little electronics, some creativity, and code, you can build your own gaming experience and keep adding new ways to play!

Supplies

WhatsApp Image 2026-10-11 at 7.49.20 AM.jpeg

One of the main goals of DIY LED GameBox was to make it affordable and easy for anyone to build. I used cheap, readily available electronic components that are commonly found in maker projects.

  1. XIAO ESP32C6 (or You can use any Arduino or ESP Microcontroller board)
  2. WS2812B Led strip - 2 m, 120 LEDs
  3. TM1637 4-Digit LED 7-Segment
  4. A Passive Buzzer
  5. Push Buttons (Self Reset or no latch type)
  6. Plastic housing or Plastic Pipe
  7. A plastic box with lid
  8. Wires
  9. Soldering iron

Circuit Diagram

diy_led_gamebox_schematic_cover_16x9.jpg

The DIY LED GameBox uses an ESP32-C6 microcontroller to control the addressable LED strip, read button inputs, generate sound effects, and display the game score. The circuit is designed using simple, readily available components to keep the setup affordable and easy to reproduce.

A 5V DC adapter powers the LED strip and the ESP32-C6 development board. The LED strip receives 5V directly from the adapter.

The individual LED segments are controlled by the ESP32-C6 through its GPIO data output. The board's 3.3V supply is used for the low-voltage logic and button circuitry as required.

Important: The WS2812B strip should receive its power from the 5V adapter, not from the ESP32-C6's 3.3V pin. Connect the grounds of the adapter, LED strip, and ESP32-C6 together. Check the exact development board's power-input requirements before wiring.

WS2812B LED strip - D1

Player 1 / Red button - D7

Player 2 / Green button - D8

Passive buzzer - D6

TM1637 display CLK - D5

TM1637 display DIO - D4

Note: These are the pin labels used in the Arduino sketch. Verify that D1, D4, D5, D6, D7, and D8 map to the intended GPIOs on your specific ESP32-C6 board.

Assembling the Modules

WhatsApp Image 2026-10-11 at 7.49.19 AM (2).jpeg
WhatsApp Image 2026-10-11 at 7.49.19 AM.jpeg

After completing the connection diagram, the next step is to assemble the ESP32-C6 development board and the TM1637 four-digit seven-segment display on the top lid of the DIY LED GameBox enclosure.

The ESP32-C6 acts as the brain of the system, running the game logic and controlling the LED strip, buttons, and buzzer. The TM1637 display provides a simple visual interface to show the player's score, lap counts, or other game information.


Wiring

WhatsApp Image 2026-10-11 at 7.49.18 AM.jpeg
WhatsApp Image 2026-10-11 at 7.49.19 AM (1).jpeg
WhatsApp Image 2026-10-11 at 7.49.19 AM (3).jpeg

With the ESP32-C6 and TM1637 display mounted on the top lid, the next step is to complete the wiring and assemble the DIY LED GameBox.

First, I connected the WS2812B LED strip, two push buttons, passive buzzer, and TM1637 display to their respective pins on the ESP32-C6, following the connection diagram. A 5V adapter supplies power to the LED strip and development board, with a common ground shared across the circuit.

After completing the connections, I organized the wires to keep the setup neat and prevent loose connections. I then powered up the system and tested the LED strip, button inputs, buzzer, and display to make sure all components were working as expected.

Code & Working

WhatsApp Image 2026-10-11 at 1.40.26 AM (1).png
Screenshot 2026-10-21 220038.png

The main idea behind DIY LED GameBox is to use a single addressable LED strip to create multiple games. Instead of building separate hardware for every game, the same ESP32-C6, LED strip, buttons, buzzer, and display can be reused by changing the program.

For the initial version, I am developing two games.

Game 1: LED Racing

In LED Racing, two players compete against each other on the LED strip. Each player uses a push button to accelerate their car, represented by a group of illuminated LEDs. The first player to complete the required number of laps wins. The TM1637 display shows both players' lap counts, and sound effects provide feedback during the race.

Game 2: Color Blaster

Color Blaster is a reaction-based shooting game. A four-LED gun is positioned at one end of the strip, while red and green enemies approach from the opposite end. Players press the corresponding color button to fire a projectile of that color. Successful hits increase the score, while enemies move faster and arrive in larger groups as the game progresses.

The TM1637 display shows the total score, and the buzzer provides shooting and hit effects.

This game is a planned extension of the platform and can be implemented using the same hardware.

Other Games You Can Build:

The hardware is not limited to these three games. Since each LED can be controlled individually, the strip can act as a flexible gaming display for many different ideas.

  1. Snake: Control a growing snake made of LEDs and avoid collisions.
  2. Whack-a-Light: Press the button corresponding to a randomly illuminated target.
  3. Memory Challenge: Remember and repeat a sequence of colored lights.
  4. Simon Says: Follow increasingly complex color patterns.
  5. Pong: Use the LEDs to represent the ball and paddles.
  6. Target Chase: Chase moving targets along the strip to earn points.
  7. Two-Player Duel: Compete to react first when a target color appears.
  8. Rhythm Game: Press buttons in time with a sequence of lights and buzzer sounds.

These are possible future game modes, not all features included in the initial version. More buttons, displays, or sensors can be added when a game requires additional controls.

Setting Up Arduino IDE

I use Arduino IDE to write, compile, and upload the game code to the ESP32-C6.

Step 1: Install Arduino IDE

Download and install Arduino IDE from the official Arduino website. Connect the ESP32-C6 development board to the computer using a USB data cable.

Step 2: Install ESP32 Board Support

  1. Open Arduino IDE.
  2. Go to File → Preferences (or Settings, depending on the version).
  3. Add the Espressif ESP32 board package URL to the Additional Boards Manager URLs field if it is not already present.
  4. Open Tools → Board → Boards Manager.
  5. Search for esp32 by Espressif Systems and install it.

Select the exact ESP32-C6 development board configuration under Tools → Board. The available board name depends on the module or development board being used.

Step 3: Select the Port

Connect the board and select its COM port from Tools → Port. If uploading fails, check the USB cable, port selection, and upload speed. A lower upload speed, such as 115200, can help troubleshoot communication problems.

Step 4: Install the Required Libraries

Open Sketch → Include Library → Manage Libraries and install the following libraries:

  1. Adafruit NeoPixel: Controls the WS2812B addressable LED strip.
  2. TM1637Display: Controls the four-digit seven-segment display.

The standard Arduino functions handle button inputs, timing, random number generation, and buzzer tones, so no additional game-specific library is required.

Understanding the Main Code

The code is organized into smaller functions so that each part of the game can be understood, tested, and modified independently.

At the beginning of the sketch, pin definitions identify the LED data line, player buttons, buzzer, and TM1637 display connections. Constants define the number of LEDs, gun length, enemy limits, and timing values.

LED Racing

Functions such as draw_car1(), draw_car2(), displayLaps(), and start_race() handle car animations, lap counts, race countdowns, and display updates. The speed and distance variables determine how each car moves around the track.

Color Blaster

  1. spawnEnemyGroup() creates groups of enemies with random colors and lengths.
  2. fireShot() creates a projectile when a player presses a button.
  3. enemyInterval() controls how quickly enemies advance.
  4. calculateSpawnInterval() controls how frequently new groups appear.
  5. checkHits() detects projectile collisions and checks whether the colors match.
  6. updateGame() moves enemies and projectiles, updates difficulty, and checks for game-over conditions.
  7. drawGame() renders the enemies, projectiles, gun, and recoil animation on the LED strip.
  8. resetGame() clears the previous game state and starts a new round.

TM1637 Display

The display functions initialize the display, show the current score or lap counts, and update the digits as the game progresses. The same display can be reused for timers, countdowns, and high scores in future games.

Sound Effects

The buzzer functions use different tones to provide feedback for shooting, successful hits, mistakes, and game-over events.

How the GameBox Works

When the GameBox is powered on, the ESP32-C6 initializes the connected components and begins running the selected game. The addressable LED strip becomes the playing area, with individual LEDs representing cars, enemies, projectiles, targets, or other game elements.

When a player presses a button, the ESP32-C6 reads the input and updates the game state. In Color Blaster, for example, pressing the red button creates a red projectile, while pressing the green button creates a green projectile. The projectile moves along the strip toward the approaching enemies.

The program continuously checks for collisions. If a projectile hits an enemy of the matching color, the enemy disappears, the score increases, the buzzer plays a sound, and the TM1637 display updates. If an enemy reaches the gun, the game ends and the player can restart.

As the score increases, enemy movement becomes faster and groups appear more frequently, making the game progressively more challenging.

The same hardware can run other games by changing the software. LED Racing uses the buttons to control acceleration and tracks the number of completed laps, while a Reaction Game can use the strip to display targets and measure player responses.

Expanding the Platform

One of the biggest advantages of DIY LED GameBox is that it can evolve over time. The initial setup provides a foundation that can be extended with additional buttons, more LED strips, wireless multiplayer, improved sound effects, high-score storage, or new game modes.

The goal is to make a simple, affordable gaming system that makers can understand, modify, and expand. Rather than purchasing a new device for every game, users can experiment with new ideas using the same core hardware and their own code.

Check out the attached Arduino IDE code.

Downloads

Let's Play!

WhatsApp Image 2026-10-11 at 1.40.20 AM.jpeg
WhatsApp Image 2026-10-11 at 1.40.24 AM (2).jpeg

Alright, enough building and coding—it’s time to play!

Grab your DIY LED GameBox, find a comfortable spot, and let the games begin. Whether you’re relaxing alone or hanging out with a friend, there’s always a little challenge waiting for you.

Playing solo? Jump into Color Blaster and test your reflexes. Watch the red and green enemies rush toward you, hit the matching button, and see how high you can push your score. Think you’ve got quick reactions? Let’s find out!

Got a partner? Bring on the competition! Start an LED Racing match, pick your buttons, and race against each other. Press as fast as you can, complete your laps, and see who reaches the finish line first. Winner gets bragging rights—until the rematch!

And the best part? You don’t need a big arcade machine or a fancy gaming setup. Just your little strip of LEDs, a few buttons, and someone ready for a challenge. Take it to your desk, share it with friends, or bring it along to your next get-together.

So, who’s playing first—you or your partner?

Power it on, press that button, and let the LED battle begin!