I recall the little LED bubble displays were at one time in all sorts of handheld electronics and, in a slightly different form, watches. By the time LCDs became cheap in the late 1970's, the more power-hungry LED display was on its way out.
I was pleasantly surprised back in 2011 to find on ebay a seller with numerous rails of HP 5082-7433 LED displays. These are three-digit displays in a 12-pin standard DIP format. I bought a few rails since the price was good. I've a tendency to get "stuff" and then never get around to using it so I decided this time there would be a project to make use of all the displays.
The "Tnychron" clock was born!
Step 1: Design
- 1970s-looking retro case
- Arduino IDE environment project
- use the HP displays effectively
- make it play music
- make it easy to use
Step 2: The Case
The only downside to this case (and probably most cases) is the choice of pre-made front windows - clear or black/IR transparent. I wanted red, so I found an online supplier of 1/16" acrylic sheet and ordered some. I used a small table saw with a fine pitch blade to cut the plastic.
Measurements were obtained from the Serpac spec sheet and the PCB size was confirmed by exporting an image of the .brd file, punching the mounting holes out and making sure the holes matched the mounting posts and everything fit they way it should.
Step 3: The Code
It is possible that the libraries have been updated since I last used them. But you can be sure what is on my github site will work if that's all you need.
Here's a photo of the breadboard prototype.
Step 4: Using the Displays
My first idea was to use machined-pin, right-angle sockets. Nice, but very expensive - 7$ each!
I wasn't about to put $14/clock into just display sockets, so there had to be another way.
A better solution was to just bend the lower display pins so they are parallel to the back of the display and then solder wires from the board top row to the display top row. Zero-ohm resistors were just the right size to allow easy soldering.
You can see in the photos below how I used gaffer's tape to secure things in place. Gaffer's tape looks like "duct tape" but it is very different in that it is designed to be strong yet leave little or no residue when peeled off.
Step 5: Playing Music
The answer was the excellent Playtune library. (https://code.google.com/p/arduino-playtune/) On the ATMEGA328p used in the project, it is capable of three simultaneous voices. The sounds are generated using the hardware timers (with appropriate prescaler and dividers) and are squarewaves without any envelope. The great thing about this method is once you have the timer configured, it just runs and your code is free to do whatever else is needed until the next note event.
Typing in notes manually would be tedious so there is the MIDITONES tool to convert a .mid into code. it has helpful options to limit simultaneous notes from the source file which make the best of the available voices.
As implemented, I only use two of the possible three channels. That is because I wanted to keep timer0 for 'millis()' timing and other functions. As it turns out, playtune.cpp actually includes a substitute timing function that would have allowed a third voice. Oh well, something to keep in mind.
Sounds from the timer outputs are sent through 500 ohm resistors and then directly to a large piezo disc. The combination of driver, hole and case cavity help reinforce the sound. It is certainly loud enough to wake you up from a bedside table or even across the room.
Step 6: Ease of Use
- 12/24 hr
- daylight savings time
- setting defaults
Three buttons is about all that would fit across the back while leaving room for a power jack. That's just fine for decrement, increment and set. Each menu item does data validation.
Another code design feature is the use of a display buffer. The display is 8 characters (physically it is 9 but I don't use the last digit) but the buffer is 16, to allow for also storing the date. The actual display function grabs a window from the display buffer. This allows for the effect of the time scrolling out of the way to display the date, all the while the seconds (and everything else) continues to update.
Most important to me was having an alarm that knows not to go off on the weekend. The alarm is configurable to go off never, only on weekends, only on weekdays or every day.
Here are some photos of the menu options.
Step 7: More Hardware Stuff
Here is what's in the clock as far as hardware:
ATMEGA328p clocked at 16 mHz with an external crystal
DS1307 RTC chip and 32 kHz crystal
1220 battery and 12mm battery holder
MAX7219 common-cathode, 7-segment display driver
I realize you could probably do the same features using just the ATMEGA328p. It would be more coding work and I think you would not achieve the same power failure battery life as obtained from the DS1307.
Step 8: Conclusion
Getting to the final board layout took three revisions. On the first I somehow got the display wiring reversed; on the second I realized the switch mounts weren't quite right for the right-angle switches; the third was the charm, so to speak.
I had enough displays to build 10 clocks. I have 6 left at the time of writing this instructable, as well as 9 extra boards (note: BatchPCB's cart may say 'quantity 1' but that still means two boards). If you'd like to buy a clock or a bare board send me a personal message. If you don't have the same displays (or can't find them anywhere) you can certainly use my board to drive any common-cathode 7-segment LED display.