loading
Picture of Solar-Oriented, Arduino-Powered Clock
DSC_0013.JPG
This is a clock designed to keep accurate time (independent of atomic or GPS), display local sunrise, sunset and solar noon, and also adjust itself for daylight savings time.

I wanted the clock to be easy to use and be flexible. The setting functions are menu-driven, you set each parameter one digit at a time (with live data validation) and you can abandon changes if you want. You can have 12 or 24-hour time. It uses a bright, legible VFD character display - you can choose even more readability with a 2x3 big-character mode.

Finally, VFDs are bright and readable, but sometimes you don't want them lighting up the room. So, you can set a schedule of when the display is bright, dim or off. You can turn the display on or off any time you want, as well.

I hope to go over key elements of the software and hardware design to help you in building a clock just like this one or to give you ideas for anything that needs menus, data validation, timekeeping and so on.


Step 1: Design Choices

Picture of Design Choices
As stated in the intro, I wanted the clock to be easy to use, accurate, simple but also flexible.

Easy to use:
- menu-driven setting options
- digit-by-digit setting (who wants to go up or down to set something like longitude?)
- data validation to keep the user from inputting impossible time, date, location etc...
- buttons match the way it is used, eg. you want to look at it while setting, so the left button is really the right button
- most common functions on their own button, eg. display on/off, big/small digits, etc...

Accurate:
- must keep time accurately without using radio time; DS3231 RTC is accurate to 2 ppm/year or approximately +/- 1 minute per year

Simple:
- no buttons visible anywhere except the back

Flexible:
- allow adjustment of DST start and end
- allow 12/24 time
- support display brightness schedule

I suppose you can add to "Simple" that it uses the Arduino platform. There isn't actually an Arduino board inside, though you could use one; I used a Modern Device RBBB Arduino clone and a Wicked Device RBBB shield board. I chose the RBBB because it's cheap, flexible and sports a power jack, which I needed anyway and is a pain to do properly on protoboard. I chose the Wicked Device RBBB shield as it supports the RBBB and because it gave me sufficient protoboard space to mount a 2032 coin cell holder for the DS3231 backup power and have a header for the 14-pin cable to the VFD display.
 
mickjazz297 months ago

Hi uhclem, that's great and very kind of you, - now to go ahead and order the bits and bobs (-:

Will let you know how I get on.

Much appreciated,

Mick.

uhclem (author) 7 months ago

Pin 13 is INT/SQW from the DS3231/DS1307.

Pins 12, 11, 5, 4, 3, 2 are for the LCD. The 2x7 connector used by my VFD would be wired as follows:

------------> left edge of cable (red stripe)

gnd vcc

n/c d12

gnd d11

n/c n/c

n/c n/c

d5 d4

d3 d2

For the RTC (DS3231 or DS1307):

a4 goes to the SDA pin on the RTC

a5 goes to the SCL pin on the RTC

(each of the above needs a 10k pull-up resistor)

Pins 10, 9, 8, 7, and 6 are used by the buttons.

My github has updated code. V1.7 is the latest for the DS3231, while V1.8 is the latest for the DS1307.

Code here:

https://github.com/quarterturn/Solar-Oriented-Clock

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).

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" 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.

mickjazz297 months ago

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?

Many thanks

Mick.

PICme2 years ago
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
uhclem (author)  PICme2 years ago
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.

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.
uhclem (author) 3 years ago
That's how it comes, though I replaced one of the end panels with blue acrylic.
mkuhn293 years ago
Did the enclosure come like that or did you have to modify?