Sudoku solver – Part 1

The Concept

So what’s the general idea?

The entire panel should be with 7 segment displays and should be modular. The Sudoku matrix is comprised or 9 sub matrices (each a 3×3 one) arranged in a 3×3 fashion.

My idea is make each one of those 9 as a separate module – and each able to work on its own and display – well, numbers from 1 to 9 🙂 Each such module, will have it’s own I2C address, and three buttons to test the functionality of the circuit and therefore the displays:

Sudoku Solver Module

Connection points for the power rails (+5V & GND) and the I2C lines (SCL & SDA) will be placed on each side of the module. At the moment, I have no idea what exactly I will use for these connection points, but all I know is that at the end, I would prefer as little wiring as possible.

The test buttons will serve to:

  • P – select the position of the matrix or each single 7 segment display
  • S – set the value (0..9), and yes – I’m aware there’s no ‘0’ in Sudoku
  • R – reset the displays

All modules will be screwed into place (on a rectangular MDF plate perhaps, but I’m not sure at the moment – like most in this project, it’s a thought evolution process) through those four holes in the middle. I would prefer to avoid any wiring between the modules when connecting them all together to form the Sudoku matrix.

Furthermore, it’s A MUST to maintain this front look of the module, which means all other components as well as connection points for flashing, need to go on the opposite side. I would like to make this a 2 layer PCB (if possible?), but let’s see how that one turns out.

I would like to use an Atmel micro for the modules – one from the ATtiny series – and yet another MUST is that the programming should be done completely outside of the Arduino tool chain and libraries. No exceptions! It’s time I start leaving my comfort zone more often!

When all said and done, the entire solver should look roughly like this:

Sudoku Solver Concept

Now for ‘the brains’ of the the solver… What I want is a module with Bluetooth capability and/or WiFi – and of course – an I2C bus. This main module, will connect to the Sudoku matrix through the I2C bus. I was thinking of a simple Android application that displays a Sudoku matrix – from which I can set the value of each cell individually then press ‘Solve’  and voila – have the result displayed.

As future improvements, maybe:

  1. having the possibility of setting different intensity levels for the 7 segment displays (I have to take this into an account starting from the 1st HW revision if it’s going to work later on), and
  2. have an additional button ‘Random Puzzle’ from which I am able to generate random Sudoku puzzles

Having a WiFi capable module which is not too complicated for programming, would also allow me in the future to introduce yet another improvement: (3) a web application which will mimic the Android app.

For these reasons, I believe an ESP32 fits the bill just fine.

Of course, let’s not forget the power supply! We have a total of 81 (eighty one!) 7 segment displays. Let’s approximate each segment to around 10mA. That gives us a minimum of 5.7A for the 7 segment displays alone (!) – if we were to turn all of them ON and display the digit ‘8’!

That’s it for now. If I come up with something else, I’ll make sure I update this post – mostly as a reminder to myself! 🙂