Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenChess β€” Smart Chess Board (Nano RP2040 fix-fork build)

Firmware release Build doc release Self-tests License

My build of the OpenChess smart chess board by Concept Bytes, with bug-fix patches for the Arduino Nano RP2040 Connect firmware.

🎯 Are you a Kickstarter backer with the Concept-Bytes PCB?

AI mode hangs? Sensors flicker? Stockfish API failed? Pieces appear/disappear when you slide them?

Use my patched firmware β€” it fixes those issues. The original Concept-Bytes repo has been unmaintained since Aug/2025 (0 PRs ever merged, 7 open issues including the AI mode hang).

πŸ”₯ Download v1.4.1-rp2040 firmware (.uf2 drag-and-drop) β€” AI mode finally reliable

v1.2.2 routes the Stockfish API through a Cloudflare Worker proxy so the board talks plain HTTP instead of HTTPS β€” works around a fundamental TLS bug in the NINA-W102 firmware that was causing 100% Stockfish failure rates with Cloudflare-fronted endpoints. Verified: 8 consecutive API calls succeeded on first attempt at ~2s end-to-end.

New in v1.3.0: runtime AI difficulty (pick Easy/Medium/Hard/Expert on 4 centre squares), a "whose turn" breathing indicator, a blue Human-vs-AI menu LED, working castling in AI mode, a fix for the "Invalid FEN" turn-stall after castling, and a clean serial monitor by default.

New in v1.4.0: persistent games β€” the board saves after every move and silently resumes after a power-off (play, switch off, come back days later and continue), until you reset by re-placing all 32 pieces.

New in v1.4.1: checkmate/draw detection in AI mode (it used to never end the game against the bot) and endless checkmate fireworks until you lift a piece.

Also includes: column-mirror coordinate fix, full FIDE chess rules, breathing-pulse-while-thinking, castling visual hint in HvsH, 5-attempt retry with NINA reset and amber retry pulse as belt-and-braces.

Backed the OpenChess Kickstarter? Same hardware β€” these fixes apply to your board too.


Table of contents


What this repo is

This repository has two parts:

  1. Build documentation for my personal OpenChess assembly (this repo, semichcsc-byte/openchess) β€” BOM, photos, lessons learned.
  2. Patched firmware for the Concept-Bytes PCB + Arduino Nano RP2040 Connect (semichcsc-byte/Open-Chess) β€” fixes the broken AI mode, sensor flicker, missing chess rules, and packs everything into a one-file .uf2 drop-in.

If you just want a working board, scroll to Quick start. If you want to understand the build, see BUILD_LOG.md.


Quick start

Goal: get the patched firmware running on your board in under 60 seconds, without installing the Arduino IDE.

1. Download the firmware

Latest release

Grab OpenChess-v1.4.1-rp2040.uf2 (~325 KB).

2. Put the board in bootloader mode

Double-tap the white reset button on the Arduino Nano RP2040 Connect within ~500 ms. The board mounts as a USB drive named RPI-RP2.

3. Drag-and-drop

Drag the .uf2 file onto the RPI-RP2 drive. The board reboots automatically into the new firmware.

4. Open the Serial Monitor (optional but recommended)

At 9600 baud. You should see:

================================================
         OpenChess Starting Up
         Firmware: v1.4.1-rp2040
         Fork:    semichcsc-byte/Open-Chess
================================================
=== ChessEngine self-tests ===
PASS T1..T10
=== Self-tests complete: 10/10 passed ===

If you see fewer than 10 passes, the board flashes red 5 times β€” the firmware is broken, don't use it for a game.

5. Set up the pieces and pick a mode

Place all 32 pieces in their starting squares (the board guides you: your side glows white, the far side red, and each square goes dark as you fill it). When the board is complete a rainbow burst plays and two menu LEDs light up in the centre:

  • D5 (left) β€” white LED β†’ Human vs Human
  • E4 (right) β€” blue LED β†’ Human vs AI (Stockfish)

Lift any piece and place it on a lit square to choose. AI mode then asks for difficulty on 4 lit centre squares (c4 Easy/green, d4 Medium/blue, e4 Hard/amber, f4 Expert/red). Full layout in the user manual.

6. (Only for AI mode) Configure WiFi

The pre-built .uf2 does not include WiFi credentials. To use AI mode, clone the source, edit arduino_secrets.h, and recompile. Full instructions in the manual.


What's fixed vs upstream Concept-Bytes

Bug / missing feature in upstream Fixed in v1.0.0-rp2040
πŸ”΄ AI mode hangs at "Connecting to WiFi…" βœ… APβ†’STA tear-down before WiFi.begin() (PR #9)
πŸ”΄ "Stockfish API failed" on success βœ… Parser splits HTTP body from headers (PR #10)
πŸ”΄ Easy and Medium AI are identical βœ… medium() now sends depth=10 (PR #10)
πŸ”΄ No check / checkmate / stalemate βœ… Full detection + on-board animation (PR #11)
πŸ”΄ Pinned pieces could move (expose own king) βœ… Legal-move filtering
πŸ”΄ No castling βœ… Kingside + queenside, FIDE legal
πŸ”΄ No en-passant βœ… Pink LED hint, correct capture
πŸ”΄ No 50-move rule / insufficient material βœ… Auto-detected, draw animation
πŸ”΄ Pawn always auto-promoted to Queen βœ… Q/R/B/N choice via 4 LEDs (Human-vs-Human)
🟑 Sensor flicker when sliding pieces βœ… Debounce: 3 consecutive scans required
🟑 OpenChessBoard AP stays up forever (~100 mA) βœ… Shut down when not needed
🟑 No way to know if firmware is broken βœ… 10 self-tests at every boot

Plus assorted code-quality fixes (buffer sizes, off-by-one, MODE_GAME_3 spam loop, etc.).

Added since (v1.3.0-rp2040)

Improvement Detail
πŸ†• Runtime AI difficulty Pick Easy/Medium/Hard/Expert on 4 centre squares β€” no recompiling
πŸ†• "Whose turn" indicator Side-to-move's back rank gently breathes (white = you, red = opponent)
πŸ†• Blue AI menu LED Human-vs-AI selector is blue, Human-vs-Human white
πŸ†• Castling in AI mode Was impossible before; now works for player + bot with a rook hint
πŸ†• Valid FEN after castling Fixes the "Invalid FEN" turn-stall (rights/EP/clock from live state)
πŸ†• Clean serial by default Verbose debug gated behind DEBUG_VERBOSE / WIFI_VERBOSE
πŸ†• Persistent games (v1.4.0) Auto-saves to flash after every move; resumes after power-off with no menu, until you reset by re-placing all 32 pieces

See docs/COMPARISON.md for an honest comparison with the more advanced joojoooo/OpenChess ESP32 fork.


Hardware & build status

Component Status
OpenChess PCB v1 βœ… Have
Arduino Nano RP2040 Connect βœ… Soldered to PCB
3D printed board (bottom) βœ… Printed
3D printed board (top/tiles) ⬜ TODO
3D printed chess pieces (32) ⬜ TODO
Neodymium magnets 10Γ—2 mm (36+) βœ… Have
Steel discs 10Γ—1 mm (64+) βœ… Have
Soldering (Arduino β†’ PCB) βœ… Done
Software step Status
Sensor_Test firmware βœ… Sensors validated
OpenChess.ino (full game) βœ… Compiled & uploaded
WiFi + Stockfish AI βœ… Working
10 engine self-tests βœ… 10/10 passing
Patched firmware released βœ… v1.3.0-rp2040 (latest)
4 upstream PRs filed βœ… #9, #10, #11, #12
Column-mirror coordinate bug βœ… Fixed in v1.1 β€” driver layer

Tech specs

  • PCB: 64Γ— Hall effect sensors (A3144) + 64Γ— RGB LEDs (NeoPixel GRBW)
  • MCU: Arduino Nano RP2040 Connect (WiFi + BLE built-in via WiFiNINA)
  • Shift register: 74HC594 (⚠️ NOT 74HC595 β€” different pinout)
  • Pin mapping: NeoPixel = D17, ShiftReg SER = D2 SRCLK = D3 RCLK = D4, Sensor cols = D6–D13
  • Board size: < 250Γ—250 mm
  • Magnets: 10Γ—2 mm neodymium in each chess piece (south pole down for A3144)
  • Steel discs: 10Γ—1 mm ferromagnetic under each square
  • Serial: 9600 baud; quiet by default (verbose debug behind DEBUG_VERBOSE / WIFI_VERBOSE)
  • Sketch size: ~152 KB (β‰ˆ 1 % of 16 MB flash)
  • RAM: 44 624 bytes (16 % of 270 KB)

Game modes

  1. Human vs Human β€” pick up piece (red LED) β†’ valid moves shown (white) β†’ place (green flash). Includes castling, en passant, promotion choice.
  2. Human vs AI β€” Stockfish via WiFi, with runtime difficulty (Easy / Medium / Hard / Expert picked on 4 centre squares). Bot move validated locally before applying.
  3. Sensor Test β€” LEDs light up where a magnet is detected; useful for hardware verification.

Mode selection: set up the 32 pieces β†’ 2 menu LEDs appear (D5 white = Human-vs-Human, E4 blue = Human-vs-AI) β†’ place a piece on one to select. A breathing back-rank shows whose turn it is during play. Full layout in the manual.


Firmware sources

Source Platform Status (June 2026) Notes
Concept-Bytes/Open-Chess (official) Nano RP2040 πŸ”΄ Abandoned β€” last commit Aug 2025, 0 PRs merged Original. Several known bugs unfixed for 9+ months.
semichcsc-byte/Open-Chess (this fork) Nano RP2040 🟒 Active β€” v1.4.1-rp2040 released What you want if you have the Concept-Bytes PCB + Nano RP2040.
joojoooo/OpenChess ESP32 (different MCU!) 🟒 Active β€” 16β˜…, last commit May 2026 More features (Lichess online, Web UI, OTA, calibration), but requires re-soldering with jumper wires.
joojoooo build guide β€” 🟒 Maintained Best schematic + wiring documentation for both platforms.

β†’ Detailed comparison: docs/COMPARISON.md


Repo layout

openchess/
β”œβ”€β”€ README.md                      ← you are here
β”œβ”€β”€ LICENSE                        ← MIT
β”œβ”€β”€ CONTRIBUTING.md                ← how to file issues / PRs
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ MANUAL.md                  ← full user manual
β”‚   β”œβ”€β”€ COMPARISON.md              ← honest gap analysis vs other forks
β”‚   β”œβ”€β”€ BUILD_LOG.md               ← chronological build journal
β”‚   └── BOM.md                     ← bill of materials with prices & links
β”œβ”€β”€ firmware/                      ← README pointing at the fork
β”œβ”€β”€ stl/                           ← 3D-print sources & notes
β”œβ”€β”€ images/                        ← build photos (TODO)
└── upstream-firmware/             ← gitignored local clone, do not commit

Links


License

Build documentation in this repo: MIT.

OpenChess design files (PCB, STLs): CC BY 4.0 by Concept Bytes.

Firmware fork: MIT (inherited from upstream Concept-Bytes/Open-Chess).

About

OpenChess Kickstarter backer fix-fork: bug-fix patches for the Arduino Nano RP2040 Connect firmware. AI mode WiFi fix, Stockfish parser, board correctness.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors