I wanted to buy a game clock, but I wasn’t able to find one here at the local stores. Last year, after several weeks learning and playing with an Arduino Duemilanove I realized that a game clock would be a great project.
At my office there are several people who play chess but they usually take too long to play. I thought that a time constrained match would spice up the game, specially for the spectators
Sometimes I play go with my friends using a real goban and sometimes I play online at KGS or Panda Net. So I was already familiar with the Byo Yomi and Canadian Byo Yomi time controls.
I jumped to wikipedia and found this page with information about different ways of counting time in board games. My idea was to build a game clock with the most commons time controls used in chess and go.
The software is programmed in C++ using classes and polymorphism. It is available at my github repository.
All user interface strings are stored in PROGMEM to avoid heap utilization. The main loop uses a kind of cooperative multi tasking where the “tick” functions of each component (buttons, buzzer, game logic , etc) is called sequentially. For this reason calls like delay() are prohibited.
The time controls implemented are: Sudden Death, Hour Glass, Byo Yomi (as played in KGS) Canadian Byo Yomi (as played in Panda net), Fischer Delay (some chess cube games) and Bronstein Delay.
First the user selects the game type. Then he selects from a preset of game configurations. In the current version the user is not able to create a custom game. But new game setups are very easy to add on the source code.
The last version consists of an arduino nano, a 16×2 LCD, three push buttons, a buzzer and a potentiometer to control the LCD contrast. All these components connected to a perfboard using custom connector cables.
The power is drawn from an external power supply. Internally there is space for a 9V battery but I didn’t have time to implement an input switching circuit.
I wanted the design to be as simply as possible. I tried to simplify using a 2-button interface but after testing I chose a 3-button interface.
The enclosing box was designed and built by a friend of mine. I helped with the idea of using magnets in some parts.
Enough of talking, lets see some pictures.
Arduino Duemilanove using a 4-button interface on the breadboard.
Arduino Duemilanove with a protoshield inside an Ice Cream box.This was aborted at the beginning.
Arduino Nano on a perfboard inside a custom case.
Things that I would like to add to this project are: Ability to choose between external power supply and internal 9V battery; Mini USB socket at the back to facilitate software updates; Some alarms to tell the user that he is running out of time; Lights to show current player; User customizable games;
I had a lot of fun with this project. If you have doubts or suggestions, please feel free to contact me. (admin at matias.blog.br or leave a message below).