Hex Game

By | 2019-03-13

For this project I was inspired by Benjamin Heckendorn, where he was building a game for practicing hex numbers. I always wanted to build that, but did not wanted to make my own PCB. Then I came across with the so called LED&KEY board.

Actually this is already a 3in1 game, and the binary-game mode is more popular, than the hex-game.

Hardware design

Led&Key utilizes the TM1638 controller, that is specially design to drive LEDs and handle keyboard events . It uses a serial communication (SPI), where you can shift out your commands to the module, and shift in data corresponding the pressed keys.

More about TM1638 here.

I wanted to make a handheld device so obviously it will run on a 18650 LiIon battery (salvaged from dead laptop batteries), and a battery charger (more about that later on).

The heart of the system is an Arduino Nano. As it already provides an USB interface it is easy to upgrade the software later on with other functions we may wish (e.g. stopwatch, countdown timer). I have also added a speaker for sure. And the battery positive lead is connected to an analog pin via a megaohm resistor to have a charging level indication.

Hex game schematic


I have used the small green variant, that already provides 5 Volts, but I had to remove the USB output socket first to spare some space, and solder on jumper wires on the top side.

The case

I have designed the case in OnShape. The idea here, is that the cover board can be printed in two halfs.

Onshape link: https://cad.onshape.com/documents/843f834a9045be5e69c0daf2/w/cfc8e513198a1c4e681ebb89/e/ef071edf4700391be162cb57

Thingiverse: https://www.thingiverse.com/thing:2794902

Case design in Onshape

The software

The software written by a friend of mine. (So no support for it from my side 🙂 )

You can switch game modes (and other things) by press-and-hold the leftmost key, and press keys 2-8.

  • Key 2 – Binary game (this is the startup default game)
  • Key 3 – Ternary game (for advanced users only)
  • Key 4 – Hex game (the easiest one in my opinion)

Download software from: https://pastebin.com/Du4uG2rD

YouTube video

(may be inserted later on)