Connect 4 Game Using Arduino and Neopixel

Connect 4 Game

Rather than just giving an off-the-shelf toy gift, I wanted to give my nephews a unique gift that they could put together and (hopefully) enjoy. While the Arduino code for this project may be too difficult for them to understand, the basic concepts of input, output, loops, and conditions used in this code could be explained visually as they play the game of Connect 4.Connect 4 Game

 

 

 

 

 

 

 

 

 

 

In this Instructable, I will show you how to put together an Arduino kit that you can assemble and code with your kids to play Connect 4. No soldering is required for this project; just plug and play.

Step 1: Parts

Parts (3)

 

 

 

 

 

 

 

 

 

 

 

For this project, you will need:

  • Arduino Uno or equivalent
  • 8×8 Neopixel RGB LED
  • Breadboard
  • 3 button switches
  • Jumper wires
  • Screws
  • Case – baseboard & cardboard stand

Tools: Screw driver, glue gun

Step 2: Prepare the Neopixel Display Stand Unit

Neopixel Display Stand Unit

 

 

 

 

 

 

 

 

 

 

First, connect 3 jumper wires to Neopixel. I’m using the following wiring color code:

White: GND
Gray: 5V
Purple: Data IN

Then, affix Nelpixel to the display board with hot glue.

Step 3: Prepare the Button Switch Unit

Button Switch Unit

 

 

 

 

 

 

 

 

 

 

Place button switches on the breadboard and connect jumper wires using the following wiring color code:

Brown:  Left Button
Red:    Left Button
Orange: Center Button
Yellow: Center Button
Green:  Right Button Switch
Blue:   Right Button Switch

Brown, orange, green wires are connected to the (-) rail along with a new black wire.

Note:
You may noticed that I’m not using any resistors for these buttons. That’s because I will be using Arduino code to use built-in 20K Arduino pin resistors. See my other project on how to use internal resistors using your code to simply your circuit.

https://www.instructables.com/id/Simon-Whack-a-Mol…

Step 4: Attach Arduino and Battery Holder to Baseboard

Battery Holder to Baseboard

 

 

 

 

 

 

 

 

 

 

Use screws (or hot glue) to attach Arduino and the battery holder to the baseboard.

Step 5: Affix Display Unit to Baseboard

Affix Display Unit to Baseboard

 

 

 

 

 

 

 

 

Use hot glue to affix the display unit to the baseboard as shown.

Step 6: Connect Jumper Wires to Arduino

Jumper Wires

 

 

 

 

 

 

 

 

 

 

Connect all the jumper wires to Arduino according to the following pin assignment:

Red    -> 2
Yellow -> 3
Blue   -> 4
Purple -> 5

Black  -> GND
White  -> GND
Gray   -> 5V

Step 7: Upload Code & Play

I pre-loaded the Arduino with attached code so that as soon as the 9V battery was connected to the Arduino, it started to play the game. The blue buttons are for moving your chip position to left or right column before pressing the yellow button to drop the chip. (See the video)

 

Read more: Connect 4 Game Using Arduino and Neopixel

Leave a Comment

Your email address will not be published. Required fields are marked *