OpenChess is a complete Arduino-based smart chessboard system featuring modular architecture, multiple game modes, and AI integration. Build your own intelligent chess board that can detect piece movements, provide visual feedback, and even play against you using Stockfish AI!
- Human vs Human: Classic chess gameplay with visual move indicators
- Human vs AI: Play against Stockfish engine via WiFi API
- Sensor Test: Verify your board's sensor grid and LED mapping
- Physical Game Selection: Choose modes by placing pieces on center LEDs
- 88 NeoPixel Matrix: Full-color LED feedback and animations
- Hall Effect Sensors: Detect magnetic chess pieces on every square
- 74HC594 Shift Register: Efficient sensor matrix scanning
- WiFi Connectivity: Connect to Stockfish API for AI gameplay
- Move Indicators: Red selection, white valid moves
- Animations: Fireworks, captures, promotions, confirmations
- Game Status: Visual feedback for invalid moves and game states
- Stockfish API: Professional-strength chess engine
- Difficulty Levels: Easy, Medium, Hard, Expert
- Real-time Analysis: FEN notation and move parsing
- WiFi Hotspot Support: Connect to mobile hotspot for internet access
- OpenChess.ino: Main program with game mode selection and coordination
- board_driver.h/.cpp: Hardware abstraction for LEDs, sensors, and animations
- chess_engine.h/.cpp: Chess rules, move validation, and game logic
- chess_moves.h/.cpp: Human vs Human chess implementation
- chess_bot.h/.cpp: Human vs AI chess with Stockfish integration
- sensor_test.h/.cpp: Hardware testing and calibration mode
- wifi_manager.h/.cpp: WiFi connection and web interface (SAMD/IoT boards)
- wifi_manager_rp2040.h/.cpp: Placeholder for RP2040 boards
- stockfish_settings.h: AI difficulty configuration
- arduino_secrets_template.h: WiFi credentials template
- README.md: This documentation
- Scripts/Chess.ino: Original monolithic implementation
- Scripts/Sensor_Test.ino: Original sensor test
- Arduino Board: Nano RP2040 Connect, Uno, or compatible
- 88 NeoPixel Matrix: GRBW LEDs recommended
- 64 Hall Effect Sensors: One per square (A3144 or similar)
- 74HC594 Shift Register: For sensor matrix scanning
- Chess Pieces with Magnets: Neodymium magnets embedded in base
- WiFi Module: For AI gameplay (built-in on RP2040 Connect)
- Power Supply: 5V for NeoPixels, adequate amperage for 64 LEDs
- Adafruit NeoPixel v1.14: Specific version for RP2040 compatibility
- WiFiNINA: For boards with WiFi capability
- Standard Arduino Libraries: SPI, Wire, etc.
- Open Arduino IDE
- Go to Sketch > Include Library > Manage Libraries
- Install Adafruit NeoPixel version 1.14 (not latest!)
- Install WiFiNINA if using WiFi features
- Connect NeoPixel matrix to pin 17
- Wire shift register: SERpin 2, SRCLKpin 3, RCLKpin 4
- Connect column sensors to pins 6-13
- Embed magnets in chess piece bases
- Copy arduino_secrets_template.h to arduino_secrets.h
- Edit arduino_secrets.h with your WiFi credentials
- Compile and upload OpenChess.ino
- Power on the board
- Wait for 4 white LEDs in the center
- Place any piece on a LED to select mode:
- Position (3,3): Human vs Human
- Position (3,4): Human vs AI
- Position (4,3): Future mode
- Position (4,4): Sensor Test
- Set up pieces in starting position
- Pick up your piece (shows red + valid moves in white)
- Place on valid square (green confirmation flash)
- Opponent's turn
- Connect to WiFi (automatic with credentials)
- Set up pieces in starting position
- You play as White (bottom), AI plays as Black (top)
- Make your move AI calculates response
- Follow LED indicators to make AI's move physically
- Place pieces on starting squares
- LEDs light up where pieces are detected
- Remove/add pieces to test sensor grid
- Perfect for calibration and troubleshooting
Edit arduino_secrets.h:
\\cpp
#define SECRET_SSID
YourWiFiName
#define SECRET_PASS \YourPassword
\\
Edit OpenChess.ino line 37: \\cpp ChessBot chessBot(&boardDriver, &chessEngine, BOT_EASY); // BOT_EASY, BOT_MEDIUM, BOT_HARD, BOT_EXPERT \\
Modify pin assignments in board_driver.h if needed.
- NeoPixels not working: Ensure you have NeoPixel library v1.14
- WiFi not connecting: Check credentials in arduino_secrets.h
- Sensors not responding: Run Sensor Test mode first
- Slow AI response: Try BOT_EASY difficulty (6-second vs 15-second moves)
Enable Serial Monitor (9600 baud) for detailed diagnostic information.
Contributions welcome! Areas for enhancement:
- Additional game modes (King of the Hill, Chess960, etc.)
- Bluetooth connectivity
- Mobile app integration
- Tournament mode with time controls
- Opening book integration
MIT License - See LICENSE file for details.
- Stockfish Team: For the incredible chess engine API
- Adafruit: For the excellent NeoPixel library
- Arduino Community: For the development platform
- Chess.com: For inspiration on digital chess interfaces
Build your own intelligent chess board and experience the future of tabletop gaming!
For questions, issues, or contributions, please visit: GitHub Repository