Introduction: Electronic Tic-Tac-Toe Game in a Wood Box

About: Hello My name is Ahmed Darwish. I’m 39 years old, married and have two wonderful children (Abdulrahman and Emma). I’m an Egyptian electronics and telecommunications engineer. I live and work in State of Kuwait…

Hello

I introduce the funny Tic-Tac-Toe game in a new edition.

I searched the web for similar project, but the idea here is unique.

I HOPE :)

So lets start now.

Step 1: Schematic

Please note that this schematic may not be accurate 100%. Please review the connections in the code for accurate wiring guidance.

Step 2: Designing the Wood Box

Here I designed a wood box using Coral Draw program. the sizes of the edges were carefully measured to contain the LEDs matrix, the keypads and the LCD. The assembly of the box have been done on stages and finally the bottom part enclosed the prototype.

Step 3: Components

I need the following:

  • 9 Bi-Color LEDs (Red/Green for example)
  • 9 330 ohm resistors
  • 9 Male-Male long wires (for Red LEDs)
  • 9 Male-Male long wires (for Green LEDs)
  • 7 Male-Male long wires (for first keypad)
  • 7 Male-Male long wires (for second keypad)
  • 1 Male-Male long wire (for GND)
  • 4 Male-Female long wire (for LCD)
  • 1 I2C LCD (serial type)
  • 1 9 V battery
  • 1 Battery holder
  • 1 ON/OFF switch
  • 1 Arduino Mega 2560
  • 1 wood box (35 x 15 x 4 cm)

Step 4: Procedures

First of all I have to test each component individually to be sure that it's working properly. Then I started to connect the components together to complete the project.

First step I have to check the connection of two keypads on the same Arduino. So I connect the first keypads to pins 2 thru 8 then I connect the first keypads to pins A0 thru A6

Of course any digital pins will do the same job. So feel free to choose the pins that is suitable for your project.

Second step I have to check the LCD. So I connect the LCD to VCC, GND, SDL and SDA ports.

Then I start to check each LED individually to check that it's working. The bi-color LED is common grounded. So I connect the Red LEDs Anodes to pins 35 thru 51 (9 digital pins) then I connect the Green LED Anodes to pins 34 thru 50 (9 digital pins). After that I connect the common cathode for each LED to a 330 ohm resistor and connect all the resistors together with a long wire back to GND.

Finally I connect the battery and upload the code to check the functionality of the system. ENJOY :D

Step 5: Files

For the Fritzing file, please change the extension from .txt to .fzz.

The code used for the project is made using Arduino IDE. You need to download the keypad and I2C libraries. You will find them available everywhere online.

Find attached the picture of the suggested dimensions for the box. Also you can find the Coral Draw project files so you can make your own box and adjust the dimensions to be suitable for your own Tic-Tac-Toe game