Custom Hardware: 4-Digit LED Display Box
Overview
Today I'm releasing the code and schematics for a new project I am in the process of completing. I call it the 'code box,' but it can be re-purposed for many other uses. The box is a hand-held device with a single button and a 4-digit alpha-numeric LED display hidden behind an IR panel. The enclosure also has an optional silicone boot to enhance the slick factor.
The integrated circuit I chose (the ATMEGA168) can easily be programmed using an Arduino bootloader, which should hopefully allow less technically savvy users to experiment more easily. Alternate ATMEL processors of the same form factor can be substituted if your application requires more processing power or RAM.

In an effort to save space, I designed the PCB with surface mount technology, which might be a little scary for some people. The parts are big enough to be soldered by hand though. Here's a cool tutorial to demystify the process. The advantage of using smaller parts is that the entire board is only about 2.12" x .77" which will make it much more embeddable.
The entire system is powered by 2AA batteries and can sleep for approximately 30 days.
Usage
I designed the box to serve as a fancy one-time pad. The box can be programmed with a series of codes that can be verified by an external server. Each push of the button displays a new code. The codes are for a game that I'll be announcing later.
The box can also be programmed to scroll a message or display a static message.
Code
In the zip file below I have included an Arduino sketch that contains the sleep function (courtesy MacSimski/D. Cuartielles); the library and associated methods for using the LEDs; and main program that iterates through an array of four digit codes (the purpose for which it was designed).
Files
The Zip file below contains
- the Eagle files for the board and schematic
- a parts list (most items can be found on digikey.com
- a DWG file with the button hole placement
- an Arduino sketch that includes an example application
Download Files: code_box_011811.zip
Raphael Abrams was an essential mentor to me on this project. Without his knowledge and guidance, this project would have involved many tears. Thanks, Raphael.
Schematics and source file are being released under a Creative Commons Attribution license. Please credit: Brian Fountain / Raphael Abrams
Free Sketch – Proposition 12
On the set of a 'mac vs. PC' style stage. A series of normal Americans address the camera earnestly.
Man One
With the recent triumph of proposition 8, the institution of marriage has been made a little safer, but there's still more work to be done.
Woman
Alternative lifestyles continue to erode the traditions that generations of American-value loving Americans hold dear.
Man Two
That's why next election you'll be hearing more about Proposition 12.
Woman
Proposition 12.
Man Two
Prop 12.
Woman
An important new piece of legislation to continue the work we've started.
Man Two
A new law whose purpose is simple and to the point.
Man One
To stop gay people from looking at me.
Man Two
For too long, gay people have been looking at me.
Woman
Why?
Man Two
Why are you looking at me... gay person?
Woman
How much longer must Americans be made uncomfortable by gay people looking at them?
Man Two
Making eye contact at a grocery store.
Woman
Or the gym...
Man Two
Or a bathhouse.
Woman
Proposition 12 will ensure that Americans can feel safe again. By making it illegal for homosexuals to make eye contact with them. Or stand too closely.
Man Two
I mean, seriously. (emotional) Why are you looking at me?
Man One
America has been divided for too long. We need unity. And that's what Prop 12 will provide. It will bring Americans together into two distinct unified groups.
Woman
So tell your friends about this important upcoming choice.
Man One
A new law that will require homosexuals to avoid eye contact with traditional Americans.
Woman
And wear this patch at all times. (Holds up a pink triangle patch).
Man One
Vote yes on Proposition 12.
Woman
I'm voting yes on Proposition 12.
Man Two
(just crying)
Man One
Vote yes.
Man Two
(still crying, transitions to blur)
Super-imposed: Yes on Proposition 12
