Arduino Nano Chess Clock
by AndersSeverinsen in Circuits > Arduino
5433 Views, 38 Favorites, 0 Comments
Arduino Nano Chess Clock
Have you also been pulled into the world of chess, after it got extremely popular? Either way it got me the inspiration to make this digital chess clock, powered by an Arduino Nano, and displayed using a LCD display.
The clock can be powered by 5V from three AAA batteries making it portable, or 5V directly from a micro usb cable, with at least 1.5A, for those longer games.
In this guide I will show you how I build it and how you can too.
Supplies
- An Arduino Nano and a compatible USB cable with data lines
- A 16x2 or 16x1 LCD display (Can be I2C, but not required)
- 3x 90 angle push buttons
- 1x 90 angle 2-way switch
- 4x 220 Ω Resistors
- Short jumper cables/wires
- Copper foil tape
- 4x 5mm magnets
- 8x 5mm standoffs with nuts and screws
- A bit of superglue
- Optional:
- 3x AAA batteries and SMD AAA battery holders
- Micro USB breakout board
- Female and male pin headers
Tools:
- 3D-printer
- Soldering iron and solder
- Wire-cutter
- A Phillips Head Screwdriver
- A Computer
- Optional:
- PCB-holder and/or a third helping hand
Setting Up the Arduino
We start by setting up the Arduino Nano.
- If you haven't already, download and install the Arduino IDE, by going to https://www.arduino.cc/en/Main/Software.
- Download my code from below, or on my GitHub here, and open it in the IDE.
- Go into Library Manager, search and install the LiquidCrystal library.
- Plug in the Arduino Nano, and Go to Tools > Board > Arduino AVR Boards and select Arduino Nano.
- Go to Tools > Processor and select your processor.
- Then select the port that your Arduino is connected to, and upload the code.
N.B. The code is written for a 16x1 LCD without I2C, so a few simple modifications needs to be made.
If you want to add your own modes, you can do this by adding them to this array:
int modes[8][2] = {{15,10},{10,10},{10,0},{5,10},{5,5},{5,0},{3,0},{1,0}};
The format {x,y} should be read as x being total time for each player, and y is the seconds added after each move.
The three buttons on the front is for play/pause, option, and modes, which cycles through the different modes.
Downloads
The PCB
This step is optional, since you could just place all of the components on a perfboard, and manually solder and join everything together. But if you like me, want it to look professional, then designing and having the PCB manufactured, is a must.
The Gerber file can be downloaded for free, on my GitHub here.
Making the Case
Now onto the laser cut case, which I quickly designed in Fusion 360.
Then I got the case manufactured in 3mm clear acrylic.
The PCB mounts on four 5mm standoffs, and the same goes for the LCD display.
It is a simple finger joined box, so when assembling it, it may have to be glued together at some places, for it to hold.
The Button
Then for the main switch/button, which was a challenge figuring out how to make look and feel like a real one.
The idea is that the magnets makes the button snap to the next state. The button works as a switch, by it being pressed when the copper tape is making a connection.
The magnets is glued in place with super glue, and the copper foil is taped in place.
Onto both ends of the copper tape, I soldered a female jumper cable, and connected it with the male pin headers on the PCB.