At long last I have managed to finish the Rainbow Word Clock!

Once again, this one was inspired by Doug and his creations https://www.instructables.com/id/The-Wordclock-Grew-Up/

I have a fixation with RGB LED's at the moment and I wanted to do something a little different.
So, while it is still here (before my girlfriend nicks it!) I thought I would share the proccess with you.

This is based on the Arduino ATmega328 with a slight redesign of the PCB to change the outputs from negative to positive and to add a ULN 2003 to handle the switching of the grounds.

Step 1: The Design

I had a local company who do screen printing to make me two Word clock faces, one regular 300mm x 300mm and one custom 185mm x 205mm.
The smaller one is designed to be fitted into my cabinet just above the shelf, it has been sat in there for a number of months now happily telling me that I am late!

This one was also used as a test to do the first PCB, which turned out quite nice in the end.

Step 2: Building the Body

The main part of the clock has not changed much from all of the others on this site.
I did make a few tweeks to try and improve the light spread without causing glare.

Key changes to the normal design are:

I used some plastic strips that I found at work and ripped them down to two sizes, a larger one for the outer frame and one smaller one for the internal shutters.

Once the grid is made I then covered it with reflective ducting tape, basically silver foil with a sticky back.

Placed the LED strips on the top and bottom of the cells so they are not glaring right at the word.

The LED strips were bought from eBay, 5M strips of RGB, but be careful though, some of the ones on sale say RGB but are actually three seporate LED's, they don't work half as good as the combined ones.

Step 3: Rainbow Electronics

For the rainbow version I am switching the positive side of the LED strips instead of the negative, at first I thought I would need a HEF 4049 hex inverter to change the output but I managed to swap the ULN 2003 for the UDN2981 and bob is not only your uncle but you also end up with some empty parking spaces on your PCB. Then move one of the ULN2003 chips along to drive the 3 PWM outputs that generate random colours.

There are a few pin changes from the original layout but the rest has not changed much from Doug's original design.
I have also added a PDF of the wiring diagram in the ZIP file.

There are 4 wires from each LED strip, a switched positive, Blue Negative, Red negative and Green Nagative.
I connected all of the Red wires into a bunch with one more so I could connect it to the ribbon cable, the same with Green and Blue. I simply soldered the bunch together and then covered with heat shrink.
There is a small strip of breadboard to connect the ribbon cable to the white switched positve for each cell.

It is worth mapping the ribon cable out at this point with a 12V supply, make sure all of the LED's work and note which wire does which cell.

Step 4: Rainbow Time

Once it is all put together sit back and watch the colours change.
You can adjust the colour patterns by changing the variables at -

  redNew = random(255);
  blueNew = random(255);
  greenNew = random(255);


  redNow = random(255);
  blueNow = random(255);
  greenNow = random(255);

If you change the variable to a lower number on both of the the redNew and redNow it will mean that red will less intense so in theory th eblue and green should be more dominant.

Anyway, best to simply have a play and see what you can do with it.

The photo's don't do it justice :-(

Step 5:

This is the modified code that includes the Rainbow section, this is also based on Doug's latest code that allows you to adjust the day / night brightness.

**** UPDATE 27/10/2013****
To try and eliminate the delay caused by the Rainbow I have simply added a comparator just before the Rainbow which seems to have calmed it down.
The Rainbow code now changes the colour only if the seconds = 30.
It seems to run smooth but I would have to watch it for 24 hours to see if the bug is fixed. Please replace the end of the code with:
// Void Rainbow
if (second==30) {

analogWrite(blue, blueNow);
analogWrite(red, redNow);
analogWrite(green, greenNow);
redNew = random(255);
blueNew = random(255);
greenNew = random(255);
// fade to new colors
while ((redNow != redNew) ||
(blueNow != blueNew) ||
(greenNow != greenNew))
analogWrite(blue, blueNow);
analogWrite(red, redNow);
analogWrite(green, greenNow);
The important bit is the IF statement and don't change the delay lower than 100 because it will flash through a range of colours in the one second when second = 30.

If anyone with more knowledge of the coding can throw an opinion I would be very grateful.
We are all here to learn! (including me :-) )

One important note is that because the colour is not set until the end of the code you will not see the self check, it is happening but you just cant see it :-)
So once you have powered up the unit there will be a delay of a couple of minutes before anything exciting happens. Its worth the wait.

<p>hello there again..<br>so when i try to verify the code i get the 'class DS1302' has no member name 'read_register'<br>i have installed the corresponding ds1302 library by matt sparks and i also use the arduino v0023...</p><p>any solution?</p>
Hi,<br><br>I just tried it on this PC, its a fresh install so I have not got many of the old programmes on here yet so its basically starting from new...<br>In Arduino 1.06 I got the same error as yourself, I popped onto Dugs page and under step 5 I downloaded the file<br>https://www.instructables.com/id/The-Wordclock-Grew-Up/<br>I copied the extracted folder into the Libraries and tried to compile, it then threw up the Wprogramme space error you tend to get with old code on the new version compiler, I then copied the ds1307 folder into the library of the 023 compiler and it went straight through.<br><br>If you just copy the extracted folder from the above link into the library of the 023 you should be good to go.<br><br>Good luck!
<p>if you want to use arduino 1.0.6 you must go to the ds1302.h and ds1302.cpp and edit with notepad++</p><p>you need to replace i both files the #include wProgram.h with #include Arduino.h</p><p>project nearly done! only need the led help!</p>
Hello!<br>What mah should the 5v and the 12v be?
<p>Hi pantelos21,</p><p>In theory the total current should not exceed 500mA, however the rainbow effect does not come into play until the time is read but the code still runs the initial setup (hence the delay at the beginning before anything shows) I have just had the clock running on a 12V battery with an Amp meter in line to see what happens, it actually went as high as 67mA and down to 52mA but this will depend on how many words are illuminated at any one time. I doubt it would exceed 100mA during normal running.</p><p>I hope that helps</p>
<p>I am just checking the availability of the components to do this project. Could you please tell me whether the DS1307 could be used instead of the DS1302, and whether the program would have to change if I switched them...</p>
It should work, however I no longer have my PC with the original code and all the data sheets, it may need a spot of tweaking and change the DS library to the correct one.<br>It might even keep slightly better time :-)
hi djandco !<p>I just thought of doing your rainbow word clock, but there are some errors in your code ( or may be some problem in my libraries ! don't know ) .</p><p>I am really new to arduino and bought one just for this project !!</p><p><strong>so please help me !!!</strong></p>
<p>Hi RAKKURBK</p><p>It looks like the library is not installed</p><p>You can get the library from<a href="https://www.instructables.com/id/The-Wordclock-Grew-Up/step5/Programming-the-Controller/" rel="nofollow"> https://www.instructables.com/id/The-Wordclock-Grew-Up/step5/Programming-the-Controller/</a> or a quick search in Google will supply the library, install that in your library folder and re launch the Arduino code.</p><p>I will also upload the 2013 code with the working code in a minute.</p>
sorry to disturb you again !<p>I had installed the libraries -- DS1302 - matt sparks</p><p> -- DS1307RTC - from googling</p><p> -- and few others !</p><p>even then there are the same errors !!</p><p>class &quot;DS1302&quot; has no member named 'read_register' and I am using the same matt sparks library (drj113 recommended).</p><p>Is there some problem with the arduino IDE version [i'm using 1.0.5v]</p><p>i'm getting the same problem with the code of djr113 !!</p><p>please help !</p><p>thank you.</p>
<p>Hi,</p><p>I use Arduino 0023 as I know there were a few issues with &gt; v1 with some of the projects.</p><p>I just installed V1.0.1 on my system and tried the code with the same results as you were getting. Try downloading the earlier version, this is one but not from the official source</p><p><a href="https://code.google.com/p/lhp-quadcopter/downloads/detail?name=arduino-0023.zip&can=2&q=" rel="nofollow">https://code.google.com/p/lhp-quadcopter/downloads...</a></p><p>Hopefully you will be cooking on gas in no time :-)</p>
Hi, i built the circuit on a breadboard, looks like the rainbow effect does work, however, the clock is slow, it doesnt run correctly.. you said there is a delay, its a huge delay and it is not running correctly. do you have any idea why this is happening? how can we resolve the slowness? thanks
Hi Amos,<br><br>I have a long way to go before I can fully understand the programming that goes into making this thing work, If you look at the original code from Doug's clock and compare it to mine you will notice that I have simply added the fade commands. The idea was that it should change the colour each minute but on my clock I have a delay when the hour changes, I am currently trying to learn about the programming side so I can fix this but at the moment it is way outside my knowledge base.<br><br>Sorry I cant be more help at the moment, but if I do find out what is going on I will post it on the ibble.<br><br>Regards<br><br> Darren
Hi Darren, <br>have you looked into the delay in your program yet? the rainbow effect is unique but only if it comes with a functioning clock... <br>If you have a modified code I would be glad to see it and test.. <br>thanks <br>Amos
As I have said before I am not 100% on the programming, but putting a comparator in just before the Rainbow seems to have calmed it down. <br>The Rainbow code now changes the colour only when the seconds == 30. <br>It seems to run smooth but I would have to watch it for 24 hours to see if the bug is fixed. Try adding: <br>******************************************************** <br>// Void Rainbow <br> if (second==30) { <br> <br> analogWrite(blue, blueNow); <br> analogWrite(red, redNow); <br> analogWrite(green, greenNow); <br> redNew = random(255); <br> blueNew = random(255); <br> greenNew = random(255); <br>// fade to new colors <br> while ((redNow != redNew) || <br> (blueNow != blueNew) || <br> (greenNow != greenNew)) <br> { <br> fade(redNow,redNew) <br> fade(blueNow,blueNew) <br> fade(greenNow,greenNew) <br> analogWrite(blue, blueNow); <br> analogWrite(red, redNow); <br> analogWrite(green, greenNow); <br> delay(100); <br> } <br>******************************************************** <br>The important bit is the IF statement and don't change the delay lower than 100 because it will flash through a range of colours in the one second. <br> <br>Hope this helps <br> <br>Regards <br> <br>Darren
I watched the clock last night for nearly two hours, checking that it changed when it should and it seems rather stable now :-) <br> <br>The only thing that might need a tweak is the internal clock so it keeps proper time, I have no idea how accurate this will be over months but if you read Doug's original post he explains how to adjust the internal counter to compensate for some of the internal component tolerances.
Hi, <br>this design must be super cool.. <br>I am trying to follow your schematics, how is it that PWM controls the uln2083 to sink the LED strips? the ULN2003a will turn on or off by a digital signal on its input, how is that analogwrite command actually controls the fade effect? it doesn't work for me.. thanks. <br>Amos
Hi Amos,<br><br>The ULN2003 is basically a transistor array that can sink up to 500mA.<br>This works because the total current when all possible LED's are on &quot;should&quot; not exceed 500mA.<br>Basically, and my knowledge of the programming is very limited, the digitalWrite command sets the output to either HIGH or LOW where as the analogWrite command pulses a PWM output with a value of 0 to 255.<br>This basically changes the intensity of the light intensity on the LED's.<br><br> Regards<br><br>Darren
HOW TO PROGRAMME THIS? <br> which compiler should i use ? <br> and what hardware is to be used to connect micro processer to pc
Hi there, This is an ATmega based project and there are many ways to get the programme into the chip. I use an Arduino UNO that I keep to hand for testing and use that to transfer the data to which ever chip I am using.<br> You can download the software from the <a href="http://arduino.cc/en/Main/Software" rel="nofollow">Arduino.cc</a> web site and use that to open, edit and transfer to the chip.<br> <br> There are many guides on here to help you get started with the Arduino to help you open up all it's possibilities, one guide is <a href="https://www.instructables.com/id/Arduino-All-in-One-Getting-Started-Guide/" rel="nofollow">Arduino All-in-one</a> by gunnk but there are many already on here.
If you intend to use a UNO instead of just the chip please use the ATmega 328 Pinout as a guide as to where you connect to.
really cool idea, but some company has been made it and promoted in the market.
HI, <br> <br>I am not actually a company - I am just me :-)
Yes I know, you did a good job!
I have not seen one that changes colour before, I know Doug has his own site where you can get them in any colour you want but I think they are static colours, well, up to now thaey were! <br> <br>http://www.dougswordclock.com/ <br> <br>Typical though, it seems that no mater what you think of someone has already do something similar!
Enter this in the Kit making challenge. You would have a great chance! <br>-Doctordv
I appreciate your confidence! <br> <br>However I don't think it would be fair to Doug if I did as this is down to his hard work in the first place. <br>I simply have a play and put my twist onto things. <br> <br>Regards <br> <br>Darren
Oh, I didn't think about that. Could you tell him to put it in because that project has real confidence. Thanks! <br> <br>-Doctordv
Potential not confidence. Sorry
Hi DoctorDV, <br> <br>Thanks for your confidence in me, but according to the contest rules my project is not eligible, as it was published well before the contest started :-) <br> <br>Thanks for the idea though :-) <br> <br>I do have an idea that may be worth including though :-) <br> <br>Doug <br> <br>
Would that be a new version coming out soon with R.G.B. lights? ;-)<br><br>
That is wonderful. I love the screen printed face, and I have to figure out how to do that for my clocks
I cheated and used a local company to do them for me :-) <br>The only thing I would change is to put some black silicone between the face and the grid to try and reduce some of the bleed through. <br> <br>But I am glad you like it. <br> <br>Regards <br> <br>Darren <br>

About This Instructable




Bio: I build therefore I am.
More by Djandco:EZ-Robot Wall.E Another board of many ping-pong balls A quick and easy edge lit sign 
Add instructable to: