Project: Clock Four – Scrolling text clock

Introduction

Time for another instalment in my highly-irregular series of irregular clock projects.  In this we have “Clock Four” – a scrolling text clock. After examining some Freetronics Dot Matrix Displays in the stock, it occurred to me that it would be neat to display the time as it was spoken (or close to it) – and thus this the clock was born. It is a quick project – we give you enough to get going with the hardware and sketch, and then you can take it further to suit your needs.

Hardware

You’ll need three major items – An Arduino Uno-compatible board, a real-time clock circuit or module using either a DS1307 or DS3232 IC, and a Freetronics DMD. You might want an external power supply, but we’ll get to that later on.

The first stage is to fit your real-time clock. If you are unfamiliar with the operation of real-time clock circuits, check out the last section of this tutorial. You can build a RTC circuit onto a protoshield or if you have a Freetronics Eleven, it can all fit in the prototyping space as such:

If you have an RTC module, it will also fit in the same space, then you simply run some wires to the 5V, GND, A4 (for SDA) and A5 (for SCL):

By now I hope you’re thinking “how do you set the time?”. There’s two answers to that question. If you’re using the DS3232 just set it in the sketch (see below) as the accuracy is very good, you only need to upload the sketch with the new time twice a year to cover daylight savings (unless you live in Queensland). Otherwise add a simple user-interface – a couple of buttons could do it, just as we did with Clock Two. Finally you just need to put the hardware on the back of the DMD. There’s plenty of scope to meet your own needs, a simple solution might be to align the control board so you can access the USB socket with ease – and then stick it down with some Sugru:

With regards to powering the clock – you can run ONE DMD from the Arduino, and it runs at a good brightness for indoor use. If you want the DMD to run at full, retina-burning brightness you need to use a separate 5 V 4 A power supply. If you’re using two DMDs – that goes to 8 A, and so on. Simply connect the external power to one DMD’s terminals (connect the second or more DMDs to these terminals):

The Arduino Sketch

You can download the sketch from here. Please use IDE v1.0.1 . The sketch has the usual functions to set and retrieve the time from DS1307/3232 real-time clock ICs, and as usual with all our clocks you can enter the time information into the variables in void setup(), then uncomment setDateDs1307(), upload the sketch, re-comment setDateDs1307, then upload the sketch once more. Repeat that process to re-set the time if you didn’t add any hardware-based user interface.

Once the time is retrieved in void loop(), it is passed to the function createTextTime(). This function creates the text string to display by starting with “It’s “, and then determines which words to follow depending on the current time. Finally the function drawText() converts the string holding the text to display into a character variable which can be passed to the DMD.

And here it is in action:

Conclusion

This was a quick project, however I hope you found it either entertaining or useful – and another random type of clock that’s easy to reproduce or modify yourself. We’re already working on another one which is completely different, so stay tuned.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The following two tabs change content below.

John Boxall

Founder, owner and managing editor of tronixstuff.com.

10 Responses to “Project: Clock Four – Scrolling text clock”

  1. lekmans says:

    nice!!! want to try but how we built our own dmd?

  2. cybergypsy says:

    T am building this project with your Arduino sketch using Arduino IDE v 1.0.5. I have separately tested both the DS3232 RTC as well as the DMD. Both are working fine. However, when I send the byte data retrieved from the RTC to the createTextTime function, nothing happens. Apparently, the data for hh and mm is not in a format which can be used by the case statements in the function. I have tried everything I could think of to convert the data from byte to int, but nothing works. If I hard code any values for hh and mm in the createTextTime function, everything works like a charm. PLEASE HELP!

  3. Brian says:

    Hi John,
    Your sketch works perfectly, thanks. But I am curious about the subtle difference is the Arduino IDE. You say this sketch only works with 1.0.1, but I would have expected all 1.0.x releases to be backwards compatible to 1.0.0. Do you know what the problem is here, because it might explain why other sketches I’ve downloaded from various sources, have not worked (or have thrown up errors) when I’ve compiled them.

    Cheers,
    Brian
    PS Keep up the good work. I love your site and Freetronics stuff.

    • John Boxall says:

      Thanks. To be honest I haven’t revisited that project. From memory 1.0.3 and 1.0.4 weren’t the best. Just put the sketch in 1.0.5 and it compiled, so will just go with it.

  4. Ben says:

    Hi,
    I have tried to compile this on IDE 1.0.5 but i am getting an error on the follow line in void setup.

    Timer1.initialize( 5000 );

    I have the timer1 library installed.

    Are you able to help.

    Regards Ben

Trackbacks/Pingbacks


Leave a Reply

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: