Step 9: The Code

The code for the clock is at GitHub:

Version 1.3 used Button.h
Version 1.4 uses Bounce.h
<p>Hi uhclem, that's great and very kind of you, - now to go ahead and order the bits and bobs (-:</p><p>Will let you know how I get on.</p><p>Much appreciated,</p><p>Mick.</p>
<p>Pin 13 is INT/SQW from the DS3231/DS1307.</p><p>Pins 12, 11, 5, 4, 3, 2 are for the LCD. The 2x7 connector used by my VFD would be wired as follows:</p><p>------------&gt; left edge of cable (red stripe)</p><p>gnd vcc</p><p>n/c d12</p><p>gnd d11</p><p>n/c n/c</p><p>n/c n/c</p><p>d5 d4</p><p>d3 d2</p><p>For the RTC (DS3231 or DS1307):</p><p>a4 goes to the SDA pin on the RTC</p><p>a5 goes to the SCL pin on the RTC</p><p>(each of the above needs a 10k pull-up resistor)</p><p>Pins 10, 9, 8, 7, and 6 are used by the buttons.</p><p>My github has updated code. V1.7 is the latest for the DS3231, while V1.8 is the latest for the DS1307.</p><p>Code here:</p><p>https://github.com/quarterturn/Solar-Oriented-Clock</p><p>The accuracy of the DS1307 is good enough and it is probably easier to build on a breadboard since it is through-hole. If you use the DS3231 I'd buy a breakout with a battery holder. I don't have a PCB for this project. It is simple enough to wire point-to-point on a breadboard if you use a breadboard-compatible Arduino clone. They are certainly cheap enough now ($5-$6 direct from China).</p><p>I've made a few of these since making this instructable. If you use the case and VFD display I use, the easiest way to mount the VFD is to make use of the front plastic panel for the case. Sand down sides at the edges and it will fit into the internal card slots. Then you can make a photocopy of the VFD and tape that down on the plastic panel and use it as a drill guide. If you can find 1mm or 1/16&quot; blue or green plastic for the front, you won't have to sand it down to get it to fit in the front panel slots.</p>
<p>Hi there, great clock - I fancy having a go at building one. Do you by any chance have a wiring diagram so I can see what connections to make?</p><p>Many thanks</p><p>Mick.</p>
Its a great project which I would be interested in building unfortunately I couldn't afford the hefty price of a VFD display. Thanks for sharing
You can use a regular HD47780-compatible LCD. Other than the brightness command for the VFD it should work with no modifications. You'll have to add a 10k pot for the contrast adjustment and a current-limiting resistor for the backlight. <br> <br>BTW VFDs are now sold directly in single quantities off the Noritake website. They often have sales that bring displays down to the $20 range.
That's how it comes, though I replaced one of the end panels with blue acrylic.
Did the enclosure come like that or did you have to modify?

About This Instructable




Bio: You know, I think we're all Bozos on this bus
More by uhclem:Squareinator - A SN76489 Monosynth 2014 Chevy Camaro Disable OnStar The Tnychron Clock 
Add instructable to: