Project: Clock Four – Scrolling text clock


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.


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:


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

Person. Founder and original author for VK3FJBX

10 thoughts on “Project: Clock Four – Scrolling text clock

  1. cybergypsy

    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!

    1. John Boxall Post author

      As stated in “The Arduino sketch” paragraph, please use Arduino IDE v1.0.1 for this project.

  2. Brian

    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.

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

    1. John Boxall Post author

      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.

  3. Ben

    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

      1. John Boxall Post author

        Then revert to Arduino IDE 1.0.1. Version 1.0.5 works for some people, however I don’t have the time to work it out.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.