Wordclock 0.4

I did some updates to the software of the wordclock. It couldn’t really cope with interference, and since it relies on updates from the DCF77 receiver every minute it doesn’t really work as soon as something interferes. I was a little surprised how much the signal is affected by everyday things. TVs, for instance, at least the CRT kind, which is still widely used. My main problem turned out to be the lights of my aquariums, which are neon tubes. They too affect the radio signal, which I confirmed with a “normal” radio controlled clock.

To account for these issues I modified the code to display the time from the Arduinos internal clock. This internal clock is not very accurate, from what I gathered on the Internet it is off by a couple of seconds after only a day or so. For that reason I use the radio clock signal to set the internal clock when it gets a clean signal, which should be every day at night when all interfering sources are turned off. That way the RTC chip i mentioned earlier in this post is not really necessary.

I updated the main article about the clock to reflect these changes, the new software is available for download there as well.

Improving accuracy

Thanks to the readonly old Arduino forum I noticed only today that the author of the DCF77 code I am currently using published an update, nearly a year ago.

He wrapped it in a nice library, which makes it a lot easier to use. Sadly it doesn’t work on version 1.0 of the Arduino UI, so I reverted to version 0022 for now. There are newer “old” versions of the UI, but I had this version still installed.

This is the example from the library:

#include "Dcf77.h"
 
Dcf77 dcf77(0); 
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  const char *v = dcf77.getDateTime();
  if (strcmp (v,"DCF77POLL") != 0) {
    Serial.println(v);  
  }
}

The library takes care of parity and plausability checks, so I don’t have to worry about that anymore. The downside is that it produces the current time far less frequent than the code I’m using now, but when it returns one it is correct.

I’m still leaning toward adding a realtime clock to the clock. This way I can rely on the RTC for the current time and correct it now and then when I get a signal from the DCF receiver.

Circuit board for the wordclock

Yesterday I was playing with Fritzing to create a circuit board for the wordclock. Building it on the breadboard was easy, but the auto routing on the PCB-layout drove me nuts. Today I tried it again, loaded the file, repositioned the components on the circuit board a little and guess what … it worked on the first try. This is how the circuit board in the next version of the wordclock may look like:

It is designed for an Arduino Mini Pro, which is by far the cheapest Arduino variant I could find and which is sufficient for this purpose. U1, U2 and U3 will hold the 74HC595 ICs, J3, J4 and J5 will connect the LEDs. J2 is the connection for the DCF77 receiver.

I guess next I’ll have to learn how to etch my own circuit boards.

Breakthrough

This evening I managed to get a breakthrough while I was working on the wordclock. The clock kept showing a completely wrong time now and then, followed by the correct time a minute later.

So I loaded the test program for the DCF receiver again and monitored the output on the serial console over a longer time (one or two hours or so). I noticed that the receiver actually gave incomplete information once in a while. To rectify this I did two things: Continue reading Breakthrough

LEDs arrived

Today the LEDs I ordered finally arrived. A couple of days ago I stumbled upon a wiring technique called “charlieplexing”, which is explained quite thorough in this article. If my calculations are correct I’m going to need 12 pins on the Arduino to control the LEDs and another one for the DCF module, so I’ll be good with the regular 14 pins.

So, next I’ll start wiring up some LEDs for testing. As long as I don’t have the DCF module some dummy clock function will have to to.

New project: Wordclock

For some time now I was intrigued by wordclocks. Sadly, all clocks I found so far are quite pricy, so I decided to build my own, using an Arduino for the electronics. The clock is going to be a gift, so I’m going to keep these posts private until the gift is given, so all related posts are going to appear at once.

Yesterday I ordered the first parts for the project, an Arduino Mega 2560 along with a set of white LEDs. Originally I wanted to use an Arduino Nano, but while I was doing the concrete planning of the electronics I realized that would mean quite an excessive amount of soldering on my part. The Nano has only 14 digital pins, but for a minimal german word clock I need to control 19 individual lights, I’ll have 21. My first idea to use a logic gate fell short when I calculated the logic gate.

es ist fünf zehn viertel
zwanzig  nach  vor  halb
eins zwei drei vier fünf
sechs sieben  acht  neun
zehn   elf   zwölf   uhr

There are just too many things that can go wrong here, additionally this would be using quite an amount of space. So I’m going for the Arduino Mega, which has 54 digital pins. A little excessive, but way easier to build. I’m going to add an DCF77 radio clock module so I won’t have to bother with the functions to set the time. The module will reduce the available pins on the Arduino further when it’s connected. Integrating it shouldn’t be too hard, a library to access it from an Arduino already exists.

This is how I want to build it: The top is going to be a layer of acrylic glass, with the words being cut out somehow. I’m not sure yet how I’m going to do this, I have a couple of ideas to try. Below that I want to use a layer of diffuse acrylic, to spread the light from the LEDs more evenly. Maybe I can merge these two layes, I’ll have to try it.

Things to figure out: how to separate the LEDs from each other, how to build the case (probably thin PVC). But first things first, I’ll have to wait for the first parts to arrive. Then I’ll start playing with them.