Scan Barcodes to Find Hidden Surprises in This Novel Game

See how one maker created his own game that uses barcodes to store hidden "items," which can be found later by scanning them.

Evan Rust
4 years agoSensors / Displays / Gaming

A bit of history

Games such as Pokemon and Magic the Gathering gain a lot of their allure due to the mechanic of collecting certain items, whether it is in physical form or digitally. Back in the early 2000s, maker Brandon J. Williams had the opportunity to play a game called "Skannerz" from Radica Games Limited. In it, the player gets certain cards with barcodes that were then scanned, hence the name, to reveal various in-game items and monsters with which to play. Inspired by this nearly two-decade old system, Williams wanted to create his own version that hides virtual electronic components in barcodes.

The barcode encoding scheme

At first, Williams decided to use UPC-A codes that use a series of 13 digits to encode an identifying number. That number would then be used to determine which of the following three components had been "found:" resistors, capacitors, or LEDs. However, this was quite limited, so it was modified to encode the component in the first nine digits and then have the color in the last four. The color could be simple, such as a red, green, or blue LED; or something more complex depending on how far the code would be changed.

Scanning

The scanning device itself was a simple SparkFun 2D Barcode Scanner Breakout board that has a DE2120 module to read the data and send it via serial. These digits are collected by a RedBoard Artemis that then processes the data and decides which item it represents.

Displaying the items

Rather than merely writing a wall of text to the serial monitor, Williams wanted to add a bit more interactivity to his game, so he included a small Micro OLED Breakout that displays certain graphics. After drawing a very pixelated capacitor, resistor, and LED, he exported them as a bitmap file from GIMP and ran them through a converter utility that transforms the pixels into an array of bytes for easy importation into the code. Depending on which component has been read, the image is sent to the OLED and then drawn over with its name and color, resulting in a fun little project that explores how barcodes can encode so much data and even get incorporated into games.

Evan Rust
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles