aramok

aramok

Saturday, September 27, 2014

CLACK - COMPLETE


https://plus.google.com/photos/101425767694746849316/albums/6063926866267257521?authkey=CLa84_mB7P2yywE


















Click image or more image^
Code HERE
User Manual HERE

I have just moved to my into my new garage home here in Corvallis, Oregon, where I plan to attend Oregon State University for the next few years as an electrical engineering student. Before I left California, I spent two months of my summer hard at work on three projects. Two of them turned out wonderfully, another did not, however this is one that did.

After much deliberation, I have finished my clock. It has taken about 6 months, of what ever free-time of my free-time I have had, to design and build the CLACK into a permanent and complete version. The final features are as follows. Year to Centisecond time displayed on Sixteen, 1970's led numeric indicators, copper and wood case, four alarms, time settable, Real Time Clock with ±4ppm accuracy, and an alarm speaker that also makes a faint ticking noise every second.

I built this clock very much from scratch. Somethings I admit could and should have been done better if I had acquired the proper tools. Its two circuit boards were made using strip board, solder jumpers and tiny wires. Only a few weeks after I began building the clock on strip board did I figure out how to cut out PCB's on my CNC machine at work. Using strip board for something this small and space sensitive was ultimately not the way to go but at the time it was the only way I had. I have had probably twenty different shorts, incorrect wiring and complete section do-overs to make things fit.

The "Operating System" as I came to call it, the program that the clock was loaded with, ended up being about 500 lines long, and the most obese program I have ever written. Not many library's could be used to save time. The program is fairly well commented (from my perspective, probably not so much a first time reader) and could be helpful to you in many areas of Arduino clock programming. Firstly, how to control and poll the Real Time Clock, DS3231, using a DS1307RTC library. Using this DS1307 libary for the DS3231 has no compatability issues and is my favorite libary out of the three I found. I like its method of storing time in its own updated "public" variables like "tm.year" every second so that I can retrieve it with my code simply by saying myYear = tm.year. Also my button reading approach is a helpful trick. My Shift Registrar display usage, specifically how to use two in series. Try to ignore the "modes" and "cursor place" programming implementations, they are convoluted and not worth wrapping your head around, but they work for this application.

I came up with (probably rediscovered) a nifty way to "Debounce" the input buttons on the back by implementing a timer to check how long a button was held down. Piggybacking off the centisecond timer that is already running, each button was checked for a depressed state one hundred times a second . If after 5 centiseconds the input has not gone LOW even once, the buttons action would be triggered. If the button dose go LOW in that time, the buttons personal counter will be reset to zero. This feature can be piggybacked as well because it not only can be used for debounce but also as a detector for if the button is being held. For example the enter button needs to be head for 500 centiseconds to go into TimeSet mode.

The physical design of the clock is a copper layer cake wrapped in an icing of wood. The layers from front to back are as fallows.  First a shinny a copper plate with windows cut out helps define the separation of the groups of numeric indicators. Then the numeric indicators sit on-top another copper plate with two slots for the pins to feed through. Then, first single sided strip-board PCB. That PCB plugs into another PCB with 16 connections for "indicator select", 5 connections for the {1,2,4,8,DP} and 2 connections for display power supply. After which there is a plastic insulator for the second PCB so that it dose not short on the copper back plate that has five square holes for the buttons to poke out. All of these layers are head together with four bolts (not pictured) and alot of thin nuts to space everything out to a total witch of 0.7 inches.

I was going to just leave the clock like that, but considering all the finicky wires that could pop off from flexing or something, I had to cover the sides. I planed to give this clock to my father as a going away present, so it had to be somewhat durable, I wouldn't be able to fix a solder joint from five hundred miles away so it had to be robust enough NOT to be garenteed to break, like most of my DIY projects. So I relentlessly built a wooden case for it. I made a slotted sleve it slid into with a cap on the end with a hidden bolt. I don't have the tools for tiny wood workmanship, but I made do with my CNC used like a milling machine and a file.

Well that's that, as always I hope something from this project will be of some use to you. Tune in next week for an artical about my experience with some reeeal electronics. ;)