UPDATE: Here's a video of the end result: http://www.youtube.com/watch?v=VpJkQQI6HeAI ruminated these requirements for a few weeks (I always plan my projects for long periods. Measure twice, cut once,) and went shopping for parts. First are the digits: Digikey here. They go for $10 each so I got 10. The big surprise I got when I started fiddling with them was that each segment doesn't consist of a single LED:
Ever since I've been 11 years old and got my first digital watch back in the 70's, I've been a big fan of LEDs (Light Emitting Diodes).
Mine didn't look like this one, but you get the idea:
Back then LEDs seemed magical to me. They made light without heat, which was unheard of, unless you counted weak effects like bio-luminescence (fireflies), fluorescence (Black Light), and phosphorescence (Glow-in-the-Dark). Anything other light source got warm and used a lot of power. I had known only of filament or fluorescent lights previously. These LED things made a cool red glow that fascinated me, and still does. I always get new LED products as soon as they become available. I remember when Green, Blue, White, Ultra-violet LEDs came out. I have tons of LED gadgets, lasers, flashlights, etc...
Today, when I build electronic projects I always include an LED or a little LED numerical display to indicate some sort of status. Even this parallel port temperature sensor has a one-digit display which is totally superfluous (sorry about the poor image quality):
That's a free-running 555 with a thermistor, if you're curious.
When I re-kindled my love of micro-controllers a month ago, I realized that a perfect project using them would be some sort of display. I had wanted to make one with very specific requirements for some time. The display had to:
I chose the good old 74HC164 serial-in, parallel-out shift register so that I could drive the segments directly (it can handle the load,) have a simple interface (clock&data), and daisy chain easily:
Lastly I needed something to feed those segments bits quickly, so I chose an 8Mhz micro-controller, the Atmel 8-bit ATTINY44:
I finally fiddled with a single digit for a while, trying different solutions for the higher voltage needed to drive the segments and found how to solve the problem: ignore it. I simply fed the digits +9 volts at their common anode and had the 74HC164s drive the cathodes through 200 ohm resistors. You'd think the 4 volts difference coming from the 9 volt supply would pull the high outputs of the 74HC164s, but that 4 volts is eliminated in the segment's diode normal voltage drop; that's part of the nature of diodes.
The circuit is so simple I didn't even draw a schematic. PA0 is data, PA1 is clock, PA2 & PA3 drive two relays directly (they're rated for TTL, use only 25 milli-amps each and include a clamping diode) for brightness regulation. The 9 volt supply goes to a 7805 5 volt supply regulator to feed the 74HC164s. I actually put one in for each digit in case I wanted to break them apart later. Heck, 7805s are cheap. The 9 volt supply also goes through 3 little signal diodes which drop the voltage to the digits so that minimum brightness is achieved. One relay shorts two diodes, the other shorts one giving the circuit four choices of brightness: 0, 1, 2, 3 diodes. it works very well as you'll see.
Ok, so what does it look like? First, let me apologize for the quality of the pictures. I've got really good photo gear, but most of it is film, not digital. So most of the pictures that follow are captured from a webcam in low-light.
Full flash of the display:
I've temporarily glued the digits together using tiny quantities of cyanoacrylate (Crazy Glue) and little tabs of plastic so they can be easily broken apart later to put them in a proper cabinet.
Without the flash:
No light at all:
Back of the display:
Here you can see that I didn't even bother with perforated boards to hold the components. The 74HC164s are held in pace because they're tugged-of-warred by the resistors, which are soldered to the digit modules' pins at the top and bottom. The 7805s TO220 hanging down are held in place by a little dab of hot glue. Notice that I didn't bother with the last two digits' 7805s. If I ever break the digits I may not need them, so screw it! :)
On the third module from the left, the micro-controller board is hot-glued in place. You can see it has its own little LED which shows serial data activity from the computer interface. There's a gray wire pair coming from the left which plugs into a connector (also hot glued) at the fourth module. That's the 9 volt power. On the fifth module you can see a black cable plugged into a connector, using a standard 1/4 jack; that's the serial line coming in from the computer. Since it's a single wire thing, it only carries Ground and Data. It's bi-directional though, see my other project.
Little close-up of the mcu board and a module:
I love those relays. No need for power transistors to drive them, no need for clamping diodes (although I put two in anyway because I'm paranoid).
From here on out, I'm switching to a webcam in low-light conditions.
7-segment display are made to display numerical digits. But with a bit of imagination, you can display letters too:
For the next set of 10 characters, you have to use a bit of imagination:
The first letter-in-7-segment real problem appears with K. Here it's represented by a T on its side. The funny thing is that after reading a bunch of things on this display, I've gotten used to the funny way the letters appear. So much so that I can read full speed, that tiny R doesn't bother me, neither does the the fact that S is a re-used 5 or that the T has survived a horrible accident in which he lost an arm. Alright, it's a seven.
The rest of the letters take a LOT of imagination:
Punctuation? A few:
Here's a couple of images to give you an idea of how large the whole thing is:
Here's a comparison with a regular-sized radio alarm clock:
Here are the four brightness settings:
In absolute darkness, that last one is still very readable.
As you may have noticed, I'm using a daemon called "displayd" which communicates with the display. From the command line, I can then use the program called "disp" to send displayd commands like DX to set the brightness, or Ttext to display text, and a few other doohickeys.
Did I mention that the firmware I wrote in the micro-controller also includes a game playable on a vt220 compatible terminal?
On the computer side, the displayd daemon displays the time as a default. But any number of clients can connect to the daemon in order to display other information. When they stop sending updates, the daemon reverts to the time. Here's one that displays my current incoming network bandwith:
The fun part: I control the display using my TV remote control by way of the Linux Infra-Red Control (lirc) daemon.
It's an ongoing project, so I'm not finished writing a bunch of utilities for it. When I'm satisfied I'll also post a schematic and all sources.