Electronic Tic-Tac-Toe Game in a Wood Box

by e_Darwish in Circuits > Arduino

608 Views, 6 Favorites, 0 Comments

Electronic Tic-Tac-Toe Game in a Wood Box

IMG-20171226-WA0026.jpg

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.

Schematic

Schematic.jpg

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

Designing the Wood Box

Box Measurments.jpg
Box Photo.jpg

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.

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)

Procedures

IMG-20171226-WA0022.jpg
IMG-20171226-WA0025.jpg
IMG-20171226-WA0023.jpg
IMG-20171226-WA0024.jpg

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

Files

Box Measurments.jpg

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