Arduino Chess

Is it possible to run a decent chess program on the Arduino alone?  The  answer, yes it is. None of them are as strong and versatile as Stockfish, which has an ELO rating of up to 3000, but several are pretty good.

Micro-Max 4.8 Chess Engine

In particular Micro-Max 4.8 has a rating of around 1900 on the right hardware.It is also truly remarkable because its written in C using less the 2000 characters in around 133 lines of code.

The author, H.G. Muller, says: “As far as I am aware, this still makes micro-Max the smallest C Chess program in existence. A close competitor for this honor, Toledo, measures 2168 characters. Despite its smaller size, micro-Max seems to beat Toledo easily.”

Chessuino

by Diego Cueva

Better news still is that Diego Cueva has ported a version of Micro-Max 4.8 to the Arduino Mega 2560 and called it Chessuino. The complete list of parts is:

1.- ARDUINO Mega 2560
2.- LCD keypad shield for Arduino
3.- Small speaker

Total price £10-15 on ebay, depending on how quickly you want the bits. Make sure you get the LCD keypad shield for Arduino, not the RPI version. It has a completely different pin arrangement

I will not repeat the details here, his web site tells you all you need to know, but I bought the bits, put it together in about 5 minutes and it worked first time. Magic.

A playing strength of 1900 would beat most strong club players, according to to HIACS site. So for most uses it should be good enough. The average “club player” falls in the 1400-1600 rating range. However I do not know what playing strength it achieves on an Arduino Mega 2560 nor whether it has any characteristic weaknesses.

The Chessino code looks like a good base for building an Arduino based chess computer by augmenting the standard “USB build” or by improving the display, especially as there is a good range of display drivers available for Arduino.

 

 

 

 

3 Responses to Arduino Chess

  1. Fritzmann says:

    Hi,
    can anyone confirm that the code is working for you? I tried it but i get this error message. I asked Diego for help, and he tried something but for me it doesn’t help.
    Has someone an idea? It is line 290 in the CHESSuni.h code:

    Arduino: 1.8.2 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

    In file included from /Users/xxx/Documents/Arduino/CHESSuino/CHESSuino.ino:10:0:
    CHESSuino.h:290: error: ‘prog_uint32_t’ does not name a type
    PROGMEM prog_uint32_t dataBase[8082]={
    ^
    In file included from /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:28:0,
    from sketch/CHESSuino.ino.cpp:1:
    /Users/xxx/Documents/Arduino/CHESSuino/CHESSuino.ino: In function ‘void searchDataBase()’:
    CHESSuino:386: error: ‘dataBase’ was not declared in this scope
    uint32_t db = pgm_read_dword_near(dataBase+block+j);
    ^
    CHESSuino:394: error: ‘dataBase’ was not declared in this scope
    uint32_t db = pgm_read_dword_near(dataBase+block+j);
    ^
    Multiple libraries were found for “LiquidCrystal.h”
    Used: /Users/xxx/Documents/Arduino/libraries/LiquidCrystal
    Not used: /Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal
    exit status 1
    ‘prog_uint32_t’ does not name a type

  2. Jerome Monscavoir says:

    Diego is working on a new version of CHESSuino using the code of Myopic more large and complex than Micro-Max. Actually i’m testing the result (by serial for the moment). Because the RAM is only 8192 bytes, the use of memory by algorithm is larger than the Micro-Max but many buit-in function are available. The power is around 500 nps and i feel the level is 1600-1650 ELO. for the moment i get no display button to test as i want. I think with this Mega2560 there enough output/input to drive both LED and reed switch 2x2x16=32 ? Of course the ELO as far away from an Stockfish than can rise probably 2400 ELO on RP zero (3000 on RP3)

Leave a Reply

Your email address will not be published. Required fields are marked *


*