element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Build a Present
  • Challenges & Projects
  • Project14
  • Build a Present
  • More
  • Cancel
Build a Present
Blog Arduino UNO Digital Chess Clock
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: javagoza
  • Date Created: 12 Jan 2022 9:29 AM Date Created
  • Views 9188 views
  • Likes 9 likes
  • Comments 4 comments
  • clock
  • lcd
  • arduino uno
  • tft
  • game
  • chess
  • buildapresentch
  • arduino
Related
Recommended

Arduino UNO Digital Chess Clock

javagoza
javagoza
12 Jan 2022
Arduino UNO Digital Chess Clock

Arduino UNO TFT LCD Touch Digital Chess Clock

a Christmas present to play face to face with your loved ones.

In this project we have developed a digital chess clock based on the Arduino UNO and an LCD screen to give to my young son. He has also collaborated in all the development and testing and now he thinks that C programming is easier than programming with Scratch.

This chess clock allows you to program all the most popular time control modes for the game of chess. From the simple time control, to the post-increments and pre-increments of time, as well as the bonuses for moves made in different stages of the game.

image

In this blog we describe the main time controls that are usually used in the game of chess, to later see the implementation in our chess clock program for Arduino.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

What is a Chess Clock

A chess clock consists of two adjacent clocks with buttons to stop one clock while starting the other, so that the two clocks never run simultaneously.

Chess Time Controls

Different Time Limits Of A Chess Game

There are 5 main time limits of a chess game. Special names for the time limit tells us how fast the game is.

  • Standard/Classical
  • Sudden Death
  • Rapid Chess
  • Blitz Chess
  • Bullet Chess

Standard/Classical

Used in tournaments often have a time limit of 40 moves in 2 hours, followed by 20 moves in 1 hour, and then 30 minutes of sudden death.

Sudden Death

We have to finish the game before our flag falls. This is also called a quickplay finish.

Rapid Chess

Both players start with 30 minutes for all their moves.

Blitz Chess

Normally means 5 minutes for the whole game. 3 minute blitz is also popular.

Bullet Chess

1 or 2 minutes is all you get.

Overtime Formats

Game time is split into two categories: the main time and overtime. To switch between the two requires players to trigger a series of events.

In chess, if the player reaches the fixed number of moves they can then trigger “bonus time,” which is in addition to the fixed time.

Chess Increments

An increment in chess is a small amount of time that is added to the clock after every move. It is usually set from 1 to 30 seconds.

There are five main types of Time Increments:

  • Fischer or Cumulative add-back mode (also called FIDE, bonus, or progressive)
  • Bronstein Delay or Non-cumulative add-back mode (also called Adagio)
  • Simple Delay or Delay mode (also called Andante or US Delay)
  • Time or Sudden death

The first three time controls implement some sort of delay clock, a small amount of time that is added for each move. The reason is that with a sudden-death time limit, all moves must be completed in the specified time, or the player loses. With a small delay added at each move, the player always has at least that much time to make a move. The three types of delay clocks differ in how the delay is implemented.

The last two time controls are somewhat different, as they do not rely on time delay.

Fischer or Cumulative add-back mode

A specified amount of time is added to the players main time each move, unless the player's main time ran out before they completed their move. For example, if the time control is 90+30 (ninety minutes of main time per player with a thirty-second increment each move), each player gets an additional thirty seconds added to their main time for each move, unless the player's main time ran out first. Under FIDE and US Chess rules, the increment is applied to the first move as well. 

Bronstein delay or Non-cumulative add-back mode

This timing control adds time but unlike increment not always the maximum amount of time is added. If a player expends more than the specified delay, then the entire delay is added to the player's clock but if a player moves faster than the delay, only the exact amount of time expended by the player is added. As with increment, the delay time is applied to the first move under FIDE and US Chess rules.

Simple delay or US Delay

The clock waits for the delay period each move before the player's main time starts countdown down. For example, if the delay is ten seconds, the clock waits for ten seconds each move before the main time starts counting down. This is the current USA tournament standard.

Time or Sudden death

This is the simplest methodology. Each player is assigned a fixed amount of time for the whole game. If a player's main time expires, they lose the game.

Overview of our implementation

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Time control reached

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Hardware used

This program is compatible with all TFT LCD screens an Arduino models that the Adafruit TFTLCD Library supports.

For the examples shown, I am using:

  • Arduino UNO
  • ELEGOO UNO R3 2.8 Inches TFT 

You can also choose this one from Adafruit:

  • adafruit TFT Touch Shield, 2.8", Arduino, Resistive Touch Screen

image

Software

You can download the complete Arduino Sketch form the github repository:

  • Arduino UNO Chess Clock https://github.com/javagoza/ArduinoTFTChessClock

The sketch uses a library that we have also developed to display virtual seven-segment displays on a TFT screen. This library allows displaying various configurable displays without flickering on an Arduino UNO with a TFT LCD screen that generally has serious problems refreshing the data on the screen. /challenges-projects/project14/buildapresent/b/blog/posts/arduino-uno-chess-clock-_2d00_-tft-lcd-virtual-clock-display-library

  • TFT LCD Virtual Segment Display for Arduino https://github.com/javagoza/TFTVirtualSegmentDisplay

image

Arduino Chess Clock Features

This Arduino TFT LCD Touch Clock has been designed to be used as game clock for Chess
The main features are:

  • 5 different algorithms covering all popular timing standards
  • Pre-move time increments modes
  • Post-move time increment modes
  • Up to 3 different stage definitions per game.
  • Time mode without increments
  • Cumulative add-back mode
  • Non cumulative add-back mode
  • Moves control for each stage.
  • Auto selection for whites clock
  • 24 preprogrammed options for quick and ease of use
  • Move counter for all options
  • Pause/Resume the game

Display and buttons

image

Settings

image

Preset modes

  • 01 Time blitz 5 min
  • 02 Time rapid 25 min
  • 03 Time blitz 3 min
  • 04 Time + guillotine 2 hrs f.b. 30 min
  • 05 Time + guillotine 1 hrs f.b. 30 min
  • 06 2 x Time + guillotine 2 hrs f.b. 1 hr f.b. 30 min
  • 07 Time + repeating 2nd period 2 hours f.b. 1 hour (repeating)
  • 08 Time + Bonus (“Fischer”) 25 min f.b. 5 min + 10 sec./move
  • 09 Time + Bonus (“Fischer”) 2 hrs f.b. 15 min + 30 sec./move
  • 10 2 x Time + Bonus (“Fischer”) 2 hrs, f.b. 1 hr f.b. 15 min + 30 sec./move
  • 11 2 x Time + Bonus (“Fischer”) 1 hrs, f.b. 30 hr f.b. 15 min + 30 sec./move
  • 12 Bonus (“Fischer”) blitz 3 min + 2 sec/move
  • 13 Bonus (“Fischer”) rapid 25 min + 10 sec/move
  • 14 Bonus (“Fischer”) slow 90 min + 30 sec/move
  • 15 Bonus tournament 90 min f.b. 15 min (all + 30sec./move)
  • 16 Bonus tournament 100 min f.b. 30 min (all + 30sec./move)
  • 17 Delay (“Bronstein”) 5 min + 3 sec./move free
  • 18 Delay (“Bronstein”) 25 min + 10 sec./move free
  • 19 Delay (“Bronstein”) 1 hr 55 min 5 sec/move free
  • 20 Delay (“US DELAY”) 5 min + 3 sec./move free
  • 21 Delay (“US DELAY”) 25 min + 10 sec./move free
  • 22 Delay (“US DELAY”) rapid 25 min + 10 sec/move
  • 23 Delay (“US DELAY”) slow 90 min + 30 sec/move
  • 24 Delay (“US DELAY”) tournament 90 min f.b. 15 min (all + 30sec./move)

How preset modes are defined


static const GameType games[24]  PROGMEM = {
  { FISCHER, 0, 1, {{ 300, 0}, {0,  0}, {0, 0}}},         // 01 Time blitz 5 min
  { FISCHER, 0, 1, {{1500, 0}, {0,  0}, {0, 0}}},         // 02 Time rapid 25 min
  { FISCHER, 0, 1, {{ 180, 0}, {0,  0}, {0, 0}}},         // 03 Time blitz 3 min
  { FISCHER, 0, 2, {{7200,40}, {1800, 0}, {0, 0}}},       // 04 Time + guillotine 2 hrs f.b. 30 min
  { FISCHER, 0, 2, {{3600,40}, {1800, 0}, {0, 0}}},       // 05 Time + guillotine  1 hrs f.b. 30 min
  { FISCHER, 0, 3, {{7200, 40}, {3600, 20}, {1800, 0}}},  // 06 2 x Time + guillotine 2 hrs f.b. 1 hr f.b. 30 min
  { FISCHER, 0, 3, {{7200, 40}, {7200, 20}, {1800, 0}}},  // 07 Time + repeating 2nd period 2 hours f.b. 1 hour (repeating)
  { FISCHER, 10, 2, {{1500,40}, {300, 20}, {0, 0}}},      // 08 Time + Bonus (“Fischer”) 25 min f.b. 5 min + 10 sec./move
  { FISCHER, 30, 2, {{7200, 40}, {900, 0}, {0, 0}}},      // 09 Time + Bonus (“Fischer”) 2 hrs f.b. 15 min + 30 sec./move
  { FISCHER, 30, 3, {{7200, 40}, {7200, 20}, {900, 0}}},  // 10 2 x Time + Bonus (“Fischer”) 2 hrs, f.b. 1 hr f.b. 15 min + 30 sec./move
  { FISCHER, 30, 3, {{3600, 40}, {3600, 20}, {900, 0}}},  // 11 2 x Time + Bonus (“Fischer”) 1 hrs, f.b. 30 hr f.b. 15 min + 30 sec./move 
  { FISCHER, 2, 1,  {{180, 0}, {0, 0}, {0, 0}}},          // 12 Bonus (“Fischer”) blitz 3 min + 2 sec/move
  { FISCHER, 10, 1, {{1500, 0}, {0, 0}, {0, 0}}},         // 13 Bonus (“Fischer”) rapid 25 min + 10 sec/move
  { FISCHER, 30, 1, {{180, 0}, {0, 0}, {0, 0}}},          // 14 Bonus (“Fischer”) slow 90 min + 30 sec/move
  { FISCHER, 30, 2, {{5400, 40}, {900, 0}, {0, 0}}},      // 15 Bonus tournament 90 min f.b. 15 min (all + 30sec./move)
  { FISCHER, 30, 2,    {{6000, 40}, {1800, 0}, {0, 0}}},  // 16 Bonus tournament 100 min f.b. 30 min (all + 30sec./move)
  { BRONSTEIN, 3, 1, {{300, 0}, {0, 0}, {0, 0}}},         // 17 Delay (“Bronstein”) 5 min + 3 sec./move free
  { BRONSTEIN, 10, 1, {{1500, 0}, {0, 0}, {0, 0}}},       // 18 Delay (“Bronstein”) 25 min + 10 sec./move free
  { BRONSTEIN, 5, 2, {{7200, 0}, {0, 0}, {0, 0}}},        // 19 Delay (“Bronstein”) 1 hr 55 min 5 sec/move free
  { DELAY, 3, 1, {{300, 0}, {0, 0}, {0, 0}}},             // 20 Delay (“US DELAY”) 5 min + 3 sec./move free
  { DELAY, 10, 1, {{1500, 0}, {0, 0}, {0, 0}}},           // 21 Delay (“US DELAY”) 25 min + 10 sec./move free
  { DELAY, 10, 1, {{1500, 0}, {0, 0}, {0, 0}}},           // 22 Delay (“US DELAY”) rapid 25 min + 10 sec/move
  { DELAY, 30, 1, {{180, 0}, {0, 0}, {0, 0}}},            // 23 Delay (“US DELAY”) slow 90 min + 30 sec/move
  { DELAY, 30, 2, {{5400, 40}, {900, 0}, {0, 0}}},        // 24 Delay (“US DELAY”) tournament 90 min f.b. 15 min (all + 30sec./move)
};

enum IncrementType { DELAY = 0, // Delay the player's clock starts after the delay period
                     BRONSTEIN, // Players receive the used portion of the increment at the end of each turn
                     FISCHER    // Players receive the full increment at the end of each turn, with increment 0 is BLIZT or GUILLOTINE
                   };

struct StageType {
  long duration;
  int moves;
};

struct GameType {
  IncrementType incrementType;
  uint16_t incrementSeconds;
  uint16_t stagesNumber;
  StageType stages[3];
};

Touchscreen selection of preset modes

image

Sample of the two clocks facing each other in the idle state to start the game. It has not yet been decided which clock will control White's time and which will control Black's.

image

The screen shows the chosen control mode (TIME, FISCHER, BRNSTEIN, US DELAY), the increment time to apply if it exists.

The different defined stages, the number of movements to complete in time and the time bonuses in the following stages.

image

Moves counter and color (White, Black) indicator

image

Pause/Resume

image

image

Reset game, new game, back to idle.

image

Github repositories

  • Arduino UNO Chess Clock https://github.com/javagoza/ArduinoTFTChessClock
  • TFT LCD Virtual Segment Display for Arduino https://github.com/javagoza/TFTVirtualSegmentDisplay

References

  • What Is The Time Control For Chess Tournament: Rapid, Blitz, Bullet and Standard – Hercules Chess
  • Time control - Wikipedia
  • World Chess Federation handbook
  • Time Control for Bullet, Blitz and Standard - Chess Stack Exchange

Project Blogs

Arduino UNO Digital Chess Clock

Arduino UNO Chess Clock TFT LCD Virtual Clock Display Library

  • Sign in to reply
Parents
  • fmilburn
    fmilburn over 3 years ago

    Well done and nicely documented!  My son is a chess player also, I will have to look into this further. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza over 3 years ago in reply to fmilburn

    Thanks! 

    Hope you like it, there is still a lot of room for improvement. The time now depends on the millis () function with all that that implies in terms of precision and we have avoided using interrupts so as not to mess up my little son more Nerd

    It is still not possible to modify the time controls from the program only from the code, we ran out of memory in the Arduino UNO with the clock setting interface that we had prepared so we will have to work more on that part.

    Arduino Digital Chess Clock Setting

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • javagoza
    javagoza over 3 years ago in reply to fmilburn

    Thanks! 

    Hope you like it, there is still a lot of room for improvement. The time now depends on the millis () function with all that that implies in terms of precision and we have avoided using interrupts so as not to mess up my little son more Nerd

    It is still not possible to modify the time controls from the program only from the code, we ran out of memory in the Arduino UNO with the clock setting interface that we had prepared so we will have to work more on that part.

    Arduino Digital Chess Clock Setting

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube