This 3D printer solves Sudoku puzzles

Zach Hipps from byte sized turned his 3D printer into a sudoku-solving robot. He added a pen, a camera, and a Raspberry Pi Zero W to the printer in a non-destructive way so that it can still be used for printing.

Subscribe to byte sized on YouTube

Kit list

How does it work?

Zach wrote some Python code to take a picture of the Sudoku puzzle using the camera attached to the printer. Then some image processing using computer vision happens, and the puzzle numbers are input into his Sudoku-solving algorithm which he has running on his Raspberry Pi Zero. Next, the Raspberry Pi generates the G-code for the solution, containing the commands for the printer parts to move so as to write out the correct numbers with the attached pen. The G-code is sent over the serial port to the printer, which makes the pen fill in the Sudoku grid with the solution.

Mesmerisingly neat writing

This is a particularly impressive feat as Zach had never worked with computer vision before. Although he intended it as just a toe-dipping project, he managed to make a 3D printer capable of solving a Sudoku puzzle in seconds. Way quicker than humans. I’ve been known to take days. But I don’t number so well.

sudoku solving robot
Zach with his puzzling machine

Hang on, what IS computer vision?

It’s a type of Artificial Intelligence (AI) that allows a computer to analyse, classify, and process what a connected camera is “looking” at.

Right. Now what’s G-code?

G-code is a super popular CNC (computer numerical control) programming language. It’s used a lot in manufacturing to control automated machine tools, and it’s used by 3D printers.

Sudoku race

Well, that ended badly

In a follow-up video, Zach put his Sudoku-solving robot to the test by seeing how many puzzles it could solve in the time it took him to solve one. Spoiler: the printer is miles better than Zach. But Zach is better than me so, that’s something.

All the project files for this build are available on GitHub.

2 comments
Jump to the comment form

Avatar

This is what we’d call a plotter.

Reply to Bob Roberts

Avatar

A marvellously over-engineered plotter, with some nice problem-solving in the video. Would blog again.

Reply to Liz Upton

Leave a Comment