# Mega Electronic Sudoku

## What to do with 81 Seven-Segment Displays?

By Hari Wiguna

I love making unique creative things and I've never seen anything like it, so I ordered 30 of those 3-digit displays. 27x3 for the 81 digits, and 3 extras in case there were any bad ones.

When the displays arrived, after my initial excitement of seeing so many seven-segment displays in one place, I realized that it came with no datasheet! That's pretty common when ordering from China. Googling did not help me much, so I had to deduce the pinouts by using an Arduino and a current limiting resistor. I could have gone straight to driving the displays using shift registers, but I wanted to show that you could drive quite a few digits using just an Arduino.

Even after deciding to use shift registers there were many other decisions to be made. While we could treat each LED as a separate LED, I decided to treat them as a group of eight (seven segments plus a decimal point). I used nine shift registers, one for each row of digits. The columns are driven by nine 2N2222 NPN transistors. I wasn't sure if the Arduino could push the data fast enough for all 81 digits without a flicker, so I breadboarded as many digits as I could.

Originally I had planned to hand-wire everything on a plain proto board. Unfortunately, breadboarding the whole thing would be too much, so I wrote the code as if I had all the shift registers and digits wired up, but in real life only the top 3 rows were physically breadboarded.

I had a great time brainstorming with my friends at our local makerspace on how to best deal with all the crisscrossing rows and columns wiring. Unlike a typical matrix with discrete LEDs, the seven segments have relatively tight spacing between their pins. I decided that a custom double-sided PCB is the only way to go.

My EagleCAD license does not allow for such a large board, which led me to discover EasyEDA, a web based PCB design software. It is amazing that they're able to implement a whole circuit designer and PCB layout completely in a web browser. Plus the price is right. EasyEDA is FREE!

While waiting for the PCB to arrive, I went to work on the interface. Originally, I wanted to make it touch sensitive, but in light of how complicated the display wiring was already, I decided to look into other ways to control the display. One of my YouTube viewers suggested a really clever way to be able to choose any of the 81 digits in just two key presses on a keypad. While I could have used more shift registers to read the keypad, I came across a way to read a 4x4 keypad using just one Arduino pin!

The board eventually arrived and it actually worked. Miraculously I did not make many mistakes. Soldering wasn't too bad. I accidentally bridged a pair of pins on the shift register. Solder braid to the rescue! Once I got the board up and running, it was time to actually write the Sudoku game. I shared my code on Github and really enjoyed brainstorming with others. The project would not be as cool as it turned out were it not for those brainstorming sessions at MakeShift and ideas from viewers of my YouTube channel.