Arduino Word Clock

I first saw a clock with this type of design on the Make Blog over a year ago. It is an incredibly clever idea, but the $1000 price tag is a bit much for my taste. I had seen a few attempts at a DIY version but most of them were still too complex or expensive to build. Needless to say when I saw this Instuctable I got really excited. It is based off of another Instructable, however, it simplifies the design and construction to the point where I felt confident that I could build it.

I followed the Instructable pretty closely, with the following exceptions:

LEDS:  I got my LEDs from Evil Mad Science, which sells packs of superbright 5mm LEDs in various colors. This project requires a pack of 100 white LEDs. For current limiting resistors I used 470 Ohm instead of 1K Ohm. This allowed me more flexibility since I can dim the LEDs as much as I want, but I can never make them brighter. The LEDs I used are very efficient and only draw 4.8mA with a 470 Ohm resistor, so the maximum power draw for the clock will be about 150mA. Consequently power usage is not an issue since I used a repurposed cell phone charger as the power supply and it can provide 700mA at 5V.

Letter Mask:  I had to use 4 transparencies stacked in order to get the mask dark enough. I also used a wider border for the letter mask to cover up some imperfections around the edges of my transparencies. For LED diffusion I used some translucent plastic folders that I found at an office supply store. I got a multicolor pack so that I could try different configurations and decided that a combination of one gray and one white folder cut to fit in the frame was the best looking and most functional choice.

LED Holder:  Instead of a cardboard LED holder I used foam poster board. This is a much stiffer material and makes the holder much sturdier, however, it is also thicker so I had to make the light baffles 1″ high rather than 1-1/8″.

Circuit Board:  Since the wiring on this project is fairly complex I decided early on that I wanted to keep the circuit board as simple as possible. In order to accomplish this I used two Radioshack breadboard matching printed circuit boards. These are great boards since they have power buses running down the sides of each board and they have plenty of room for the 7 chips necessary for this project. This made it very straightforward to scratchbuild an Arduino on one of the boards and then wire it to the other chips. Note: when building an Arduino in this way you need an FTDI cable which plugs into the 6-Pin header on the board in order to program the Arduino.

I mounted the boards side-by-side on a piece of acrylic to make it easier to work with. I also wired the board such that I could add a photoresistor in the future to allow for dynamic LED dimming (its wiring is bundled separately for later use as shown in the photos). Instead of wiring headers I just wired directly from the circuit board to the LEDs using multicolor wire to differentiate which word group I was wiring to (you can see each ULN2003A’s bundle grouped together in the photos).

The size of these boards prevented me from trying to mount them inside the picture frame, however, mounting the boards on the back wasn’t a problem. As shown in the photos I had use some stacked foam board as spacers between the back of the picture frame and the wall to keep the board from rubbing agains the wall. I also changed the power socket mounting from the back of the frame to the bottom by cutting a notch in the wood and gluing it in place.

Conclusion:  The biggest problem I had with this project was dealing with a slightly imprecise LED layout. This resulted in some of light baffles partially blocking the wrong letters. After removing the problem baffles, however, I found that my diffusion layers worked well at making up for any discrepancies due to LED placement as well as reducing cross-letter light bleed to an acceptable level. As far as the code goes the only changes I made were done to make use of external pull-down resistors instead of internal and to clean up the code a little bit since some of the comments no longer made sense. I really like this project. It is not only cool looking, but it is useful as well.

105 thoughts on “Arduino Word Clock”

  1. Hi Joe
    I´m trying to do mine, so I have a problem or I just dont understand…
    You use a HCF4094 to shift the hours, but what happens if it is disconectted? I´m just thinking that it will lose its synchronization so in that case, how I would do to ensure it will keep the hour even if I unplug it? By the way I´m using arduino with the DC3231 so I can have the hour updated for 2 or 3 years.

  2. Hello Joe,
    Thank you for the awesome tutorial!!
    I have a question. I want to add a personalized message hidden in the word clock (the message is “Happy Birthday”) with WS2812B LEDs. Is it possible using a single Arduino?
    I want the message to be displayed on a particular date. Will the power output of the Arduino be enough?
    What modifications will I have to make to the code?
    Thanks again 🙂

    1. I don’t have any personal experience with those particular LEDs, but after a little research it looks like they only require power and 1 digital output to work. I found an Instructable which looks like a good tutorial (http://www.instructables.com/id/Best-RGB-LEDs-for-any-project-WS2812/). This should be doable with a single arduino since the word clock design has several spare digital outputs that could be used for this purpose.

      The main issue I see is your desire to have the message displayed on a specific date. The word clock is a dumb design in that it only keeps track of time. There is no calendar function built in that tracks the date or year. If you modified the design to incorporate a real time clock module (http://www.sparkfun.com/products/12708) this could be done. This would require some additional coding to manage the communications with the real time clock module in addition to adding a trigger for the birthday message.

      I believe that I have seen other designs that incorporate a real time clock and if you look around you might find a design with code that is very close to what you need.

      1. Thanks for your inputs.. I used a DS3231 RTC to keep track of time and date and wrote some arduino code to fetch the current time from the RTC and it works fine.
        I have another question though, Can I use CD4094 or HEF4094 instead of the HCF4094? I am not able to get the HCF4094 in my locality. Are these chips interchangeable or do I need to change some connections?

        1. Hi,
          Is there any opportunity to get your code?I’m doing a similar project and I’d be in love to add an “Happy Birthday” option 🙂

        2. Hey, I know this is a long shot, but do you by chance still have that code?

          I’m currently faced with the situation that my two clocks are running a bit slow (at different rates) and I’d prefer adding a reliable time keeper to tweaking the code to speed up my seconds; especially considering the benefit of being able to unplug it without having to reset the clock.

          I got a DS3231 as well, but since my coding experience is beyond limited and I have a due date coming up (one clock is a gift for a friend), it appears I’ve bitten off more than I can chew.

          Thanks in advance for any advice.

  3. Craig,

    I would double check all the wiring for short circuits, especially in the power circuit.

    I would also connect the arduino in stages and see when the problem occurs. For example connect only the IO pins, one at a time but not the power. If you have another 5V supply available try that with the breadboard and see if powering the two halves of the circuit separately solves your issue. It could be that the power draw from your breadboard is too much for the arduino's power supply circuit which causes a brown-out of sorts.

    Keep in mind that the arduino doesn't have a lot of protection circuitry built-in so it's pretty easy to damage components due to short circuits, over-voltages and reversed polarities.

    Hope this helps,
    Joe

  4. Hi Joe,
    Thanks for putting together this tutorial looks as though it has been used by many people!!
    I'm close to finishing mine off but have run into problems, which I'm hoping you will be able to point me in the right direction with:)
    I'm prototyping the circuit with a bread board and using an arduino instead of the micro controller. The issue is that whenever I connect my arduino to the breadboard it loses power.
    Unfortunately my knowledge with electronics is very limited and so I have no idea what is causing it. As far as I can tell I have followed your schematics exactly,
    Do you have any ideas as to what it could be? Sorry if this is a bit of a newb question!
    Thanks
    Craig

  5. Hedinn,

    I'm not sure what exactly could be causing your problem, but since you've already tried reloading the program I would start with checking your wiring. You could have a short somewhere or a bad connection that is causing odd behavior. I had an intermittent problem with my clock and discovered a bad solder connection in one of the LED groups.

    Sorry I couldn't be more helpful. Good luck.

  6. Hi there,
    I'm in the process of building my own wordclock, but I am having a few issues…

    I'm not getting any light on my "ten" and "twelve" hours. When the "ten" light should be on, I'm measuring 2,5V from the +5V to the "ten" output, and 2,5V from the output to ground. When the "twelve" light should be on, it's the same, but then I am again measuring 2,5V to the "ten" output, but nothing to the "twelve" output!

    At first I thought that I had messed something up in the program when I re-programmed it for icelandic language, so I uploaded the original version to try it but the same thing happens there… I don't really understand why I'm getting only 2,5V on the "ten" output when it is ten o'clock and again when it's twelve o'clock…

  7. Hi Matt –

    I'm Doug Jackson, the author of the original instructable article.

    The timing issue you have found is because the Arduino is not an amazing timekeeper. There is variability with the 16Mhz crystals, and the ms timing loop can tend to be a bit variable.

    There are two things you can do.

    (1) I re-designed the project to use a DS1302 RTC chip and a 32768Khz crystal – that is rock solid – you can see the result here: http://www.instructables.com/id/The-Wordclock-Grew-Up/ In the clocks that I make for my small wordclock business, I use ds1302 RTCs exclusively – they work beautifully.

    You have to be careful to get a real (not fake DS1302) – there are heaps of Chinese copies on eBay that are rubbish as far as timekeeping is concerned. I get mine from Mouser.

    (2) You can also have success in changing the number of ms in seconds value in the loop – I know that there are 1000mS in a second, but when the mS timer is incorrect, you can fudge it by setting the code to believe that there are 1020mS in a second, effectively slowing the clock down – It will take patience to find the correct delay:

    Here is the original code:
    void loop(void)
    {

    // heart of the timer – keep looking at the millisecond timer on the Arduino
    // and increment the seconds counter every 1000 ms
    if ( millis() – msTick >999) {
    msTick=millis();
    second++;
    // Flash the onboard Pin13 Led so we know something is hapening!
    digitalWrite(13,HIGH);
    delay(100);
    digitalWrite(13,LOW);
    }

    you can change the >999 test to read >1020 and run it for a couple of days to see what the result is.

    20mS in a second is probably all it will take.

    A bit of patience, and some careful recording of the actual timing values, and you will get it close – but run the tests over a few days.

    Doug

  8. First, great tutorial. Thanks so much for putting it together. I've never built anything electronic before, and it came together quite nicely. I'm proud of myself, but you should get most of the credit.

    I do, however, have one problem. My clock runs a little bit fast. It puts on about 15-20 minutes each day. It otherwise works perfectly. I thought I might have a bad crystal, so I replaced it with a spare one I had (same manufacture and item number) and it still runs fast. What could be causing this? Wrong type of crystal? I got a 16MHz. Coding? I copied yours and it worked great. Weird voltage running through the crystal? I'm pretty confident I have things wired together correct.

    I'm assuming other people have had this problem. What are your thoughts?

    Thanks again,

    Matt

  9. Dan,

    1 – The nano should work just like any other arduino. You do not need an RTC. The existing code does not include code for an RTC if you wanted to add one.

    2 – Any extra LED groups would require additional shift registers and darlington arrays to drive them. The code would also have to be modified to integrate these new LED groups into the sequence so that instead of waiting 5 minutes to shift, the registers would shift every minute.

  10. Hi Joe,

    First of all, great write-up! Together with this instruction: http://www.instructables.com/id/Sleek-word-clock/?ALLSTEPS I would be able to build a clock myself.
    Just 2 questions come to mind when I think the project through.
    1: I Am planning to use an Arduino Nano, do I need to use an RTC to keep track of time? Is this already coded?
    2: I Want to use 4 extra "dots", where each dot represents a minute. (It is a quarter past one, plus three dots makes it 18 past one) Would this be implemented easily?

  11. Matthew,

    Thanks for the kind words. I try to put stuff on here that is interesting and helpful and it's been cool to see how many people are interested in this project.

    To be honest I did not originate the code for this clock, I only modified a few lines to fit my circuit design. That said I believe the #define statements were used to make the code easier to follow and to save memory space. The program could also have been written such that the Display1=Display1 | (1<<0) is inserted wherever MTEN is currently used in the code.

    The purpose of this code is to shift the high bit within the Display1 register. As the clock time increments it reaches different time thresholds, such as passing from minute 4 to 5. The MFIVE #define (Display1=Display1 | (1<<4)) is then referenced via an IF THEN statement. This shifts the high bit 4 positions to the left within the Display1 register. When the LEDs are fired it references the Display1 register and lights the appropriate group of LEDs via the shift register chip. Every minute the clock checks if it needs to change the time displayed. The Display1 register is reset to 0 and then the time is checked and the high bit is shifted again and the LEDs are lit again. So technically the LEDs flash every minute, it just happens so fast that we can't see it happen.

    Hopefully this answers your question and makes sense.

  12. Hi Joe,

    Just want to start off by saying that I love your blog and this is a great tutorial specifically. I was just looking through your code and I'm curious as to what your definitions mean (i.e. "#define MTEN Display1=Display1 | (1<<0) "). I've never seen this type of definition.

    Thanks,
    Matthew

  13. Johnny,

    You are correct, the Arduino's 5V power output can be used as the 5V power supply for the other chips and the LEDs.

    The PCBs I used have power bus traces down each side of the board, which make it very easy to wire the 5V and GND connections. You could use a similar strategy, except instead of using an external 5V power supply like I did, you would use the Arduino's power output.

  14. Hey Joe,

    I am thinking about doing one of these clock, but I have never really done something like this at home, just smaller projects at school. So, a tad inexperienced. I am thinking that using a Arduino UNO is the easiest way for me, and I do not plan atm on doing something else. I understand that these are the pins I would use on the UNO as per the earlier posts.
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton & 1K Ohm Resistor – Digital 2
    Hours Pushbutton & 1K Ohm Resistor – Digital 3
    LED Common Anode – 5V
    Ground & Common Cathode – GND

    The thing I can't get my head around is how to power everything. That is, how do I use the 5V pin from the UNO to power the rest of the circuit? In your picture of the completed module have a red wire from the outlet to the top most row of the PCB, would I run a wire from the 5V pin in the same fashion?

    Sorry for a stupid question!

    Thanks,
    Johnny

  15. Nik,

    Since you are using an Arduino UNO board, to avoid confusion you should really just think about this project in terms of that board and not the ATMega 328.

    If you look at it in this way, the only connections you need are:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton & 1K Ohm Resistor – Digital 2
    Hours Pushbutton & 1K Ohm Resistor – Digital 3
    LED Common Anode – 5V
    Ground & Common Cathode – GND

    Everything else is already handled by the Arduino board.

    Correct, the Power GND should be used for power connections.

  16. Joe,

    Thank you for your immediate answer. You stated that i would only require the 1K ohm resistors for the pushbuttons, hence doest that mean i should disregard the connections to the ATmega(1,7,8,9, 10, 23,22, 20) in your diagram. By this I mean that these connections (since the components are already built into the board) are not required?

    Also I wish to know; are all "grounds" connected? If so on the Arduino board there are 2 different GND ports, Digital GND and Power GND. I am assuming that the Power GND is the correct ground.

    Once again, I am new to electronics, especially with Arduino/ATmega. Thank you for your consideration.

  17. Nik,

    Glad to see you found that info in one of the earlier comments. Always remember that the pins on the Arduino board do not necessarily match the pins of the ATMega chip, even if they are wired to the same point. It can be a little confusing transposing between the two, so it's good to keep that in mind. It's the same on the software side as well since the Arduino programming language uses the board pin numbers not the ATMega chip's pin numbers when referencing which pin does what.

    The majority of the extra components, or an equivalent version of them, are already built-in to your Arduino board and consequently are not necessary.

    The only parts you should need are the two 1K Ohm resistors that wire to the pushbuttons. These function to pull down the inputs on the ATMega until the pushbuttons are pressed, this keeps the inputs from floating which could cause a false button press.

    Regarding the IT IS wiring: the IT IS LEDs are wired to the common anode the same as the rest of the LEDs, however, since the IT IS LEDs are on all the time and not switched by the shift registers they need a permanent ground (aka cathode) connection to complete the circuit. So just as the common anode is wired to the 5V pin on the Arduino, the common cathode is wired to the GND pin.

    Hope this gets you on your way.

  18. Joe,

    I have been attempting to create this word clock, and am using the arduino UNO instead of your setup. I am a beginner when it comes to electronics so sorry if this seems obvious. Previous comments have said the pins I should wire to on my Arduino Board are:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    However, on the circuit diagram provided it shows many capacitors and extra components which are connected to the ATMega chip. Are all of these necessary when I am using the Arduino board. I do not quite understand how the IT IS common cathode wires up to the arduino UNO. I also wish to know which of the components displayed in the diagram are actually needed when using the arduino board instead of the ATmega.

    Thank you

  19. Chris,

    Glad to see you have been successful building the clock.

    It sounds like you have the right idea at how to implement your changes. I would run the On/Off switch to a digital input and drive both the red and green LEDs from digital outputs. All this would have to be defined at the beginning of the program in the void setup section of the program. You would then have to add an if/else statement to the void loop section of the program to test for the two switch states and turn on the appropriate LED for that state.

    I'm not sure how you were planning on switching the word LEDs on and off but I see two ways of accomplishing this. The easiest way would be to use a 3 pole On/Off switch where one pole would go to the digital input another would be used to interrupt the common power connection to the word LEDs and the last pole would switch the power for the IT IS LEDs.

    Another way to do it would be to alter the void loop section of the program so that for the different states of the On/Off switch you would change the analogWrite command from 255 (max brightness) to 0 which should effectively turn off the LEDs since you would no longer be triggering the output of the shift registers.

    Hope this was helpful.

  20. To clarify my post above, the red LED is supposed to light up my word OFF (I made my own transparencies I can share if anyone likes) and I used an Arduino UNO instead of the standalone ATMega.

    Chris

  21. Joe,

    Thanks a ton for putting up this project. This was my first ever time working with electronics! While it took me a considerable amount of time, I learned so much about electronics and I'm really excited with the final product.

    I got a little too ambitious in my design and I customized it so that in addition to the letters, there is also 1 green LED that lights up the word ON (when the other words are lit) and 1 red LED that lights up when the clock has power but a switch has been thrown to prevent the words from lighting.

    I didn't realize the change this would put on my system until after I had printed the transparencies. Can you suggest a good way to make this work? I have an ON/OFF switch on the side of the clock. I figure that goes to a digital pin input and the red LED is on a digital pin. My big problem is I am very poor at coding. Any help from anyone would be appreciated.

    Thanks again Joe.

    Chris

  22. Joe,
    Yeah, I suspect the culprit is the dimmer code. It runs perfectly fine with your code unedited. I also used your dimmer code that's already in the code. Once I activate the dimmer code, then it becomes unstable. I'm not sure if you tested your dimmer code to see if it conflicts with the rest of your code. Have you ever heard of the processor freezing up because of a bad code? I'm going to check tonight and see if I can hook it up to another power source and see if it becomes stable.

    Thanks

  23. Henry,

    Your comment that the clock resets itself suggests you could have a bad power connection or unstable power supply. Either that or somehow the arduino is being reset internally or externally.

    Does the clock function properly if you run my code unedited? If so then whatever dimmer code you are using is the culprit and should be looked over and modified to prevent the dimmer from affecting basic clock functionality.

    Good luck.

  24. Joe,
    I'm not sure if you can help me figure out what's wrong with my clock. I have built the clock using your schematic and used your coding. Everything seems to run fine, but it starts having problems whenever I use the dimmer code. Once it's activated, the clocks seems to run unpredicably. It would lock up randomly or other times it would reset the clock altogether. I don't know if that is a hardware problem or a software problem. I tried troubleshooting by swapping out all the chips, but it still ran with problems. I also tried using the code Roger posted on page 4 and it still had issues. This only appears to happen whenever I activate the dimmer function. Sometimes switching the time or changing the brightness would also freeze the clock and I would need to unplug the power. Other times the clock would run for a while and then reset to default. I double checked the wirings and it doesn't seem to be any wiring problems. I even made another clock just to see if the wiring was shorted. I'm out of ideas at this point. Any help would be greatly appreciated.

  25. Jason,

    My clock exhibits the same delayed button response. I'm not sure what the limitation is in this case. Is the arduino slow enough that the scan time of the program takes long enough that the delay we see is noticeable, or is the program just inefficient and present unnecessary delays? These are questions I don't have answers for.

  26. Hi Joe,
    Thanks for our help from the previous post. I have been able to build the prototype and everything seems to be working fine. The only issue I notice is that the clock doesn't seem to be able to register the buttons quick enough. If I were to press the minute or hour push button, I would have to wait 1 – 1.5 seconds before I could press it again. If I were to repeatedly press it (not overly quick, but just at a normal pace), the software wouldn't be able to register the multiple clicks. It would take several clicks beofre it'll adjust the time or I would have to wait between intervals. I thought there may be a delay function in the coding, but I don't seem to find it. Does it have to do with the hardware? Perhaps the IC or the push butons can't read the push button quick enough? It's not a big issue, but I feel the adjusting the clock would feel a lot smoother if it didn't have a delay.

  27. Joe,

    Thanks for your reply. That is indeed what I meant. The Arduino was on for more than half an hour so I expected to see at least one led light up some time. I've double checked the wiring after I made the wrong connections, therefore I thought maybe one (or all..) chips were fried. But if that's probably not the case, I will start wiring over again. The programm I just downloaded from your site and uploaded to the arduino (whitout modifying it).

  28. Sjaak,

    You say that you have wired the first HCF and ULN and some LEDs. By this I assume you have wired the LEDs that would light up the words: ten, half, quarter, twenty, five, minutes, and past. All of these words refer to the minutes setting. Consequently, depending on what time setting the clock starts up with none of these LEDs may light up. But if you press the minutes set pushbutton a few times one or more of these LED sets should light up eventually. Unless you did something crazy, it's fairly hard to fry these chips so I would lean toward this being a wiring or programming error.

    Joe

  29. Hey Joe,

    Recently I decided to build a word clock. I started by building it with a breadboard and an Arduino Uno. I have build the first part of the circuit to test it. The first HCF and ULN are connected to the arduino and some leds but when I upload your program, no led lights up.
    I made some mistakes with wiring in the beginning, I connected the wrong Arduino pins to the HCF. When upload the 'blink' example the onboard led does blink however. Have I fried my ATMega, HCF or ULN? I know it is a bit of a difficult question but if you have any idea what could be wrong it would be very usefull before I just replace all chips with new ones..

  30. Jason,

    The RTS, TX, RX, USB 5V, GND, and GND labeled circles on the schematic represent the six pins of the header that the FTDI cable uses to connect to the ATMega chip for programming. If you are using a pre-made Arduino you can just use its usb port, however, since I built mine from scratch it has no built-in usb interface. In order to be able to program the ATMega microcontroller I had to add a FTDI header which allows me to use the FTDI cable's usb interface to connect the circuit board to my PC.

    The 16MHz refers to the resonant frequency of the quartz crystal used in the circuit. You can also use a quartz resonator which combines the crystal with the two 22pF capacitors into one package. I believe you can also use different frequencies, or not use a crystal at all depending on which ATMega microcontroller you are using and how you setup the chip internally when it is programmed.

    Joe

  31. Hi Joe! Thanks for the instructions. I have several questions regarding the schematic. Can you please explain to me what TX, RX, RTS, 16 MHZ represent? Thank you so much!

  32. The code is the one provided and those results are not from the clock itself but the chip located in an Arduino Duemilanove being viewed through the serial monitor as the code runs. I am using an ATMEGA328P-PU-ND from Digikey. When plugged into the clock it just gets worse as entire sets of lights are lit up from each ULN2003.

  33. Dustin,

    Before I changed microcontrollers I would first double check the code and wiring just to make sure there isn't some simple mistake causing this. Is your hour set button shorted for example? To me the fact that the code is running, if not producing the proper output, points to some external problem.

    Good Luck,

    Joe

  34. I have finished the clock however when i put in the chip to run the code things get weird. There is no rhyme or reason to what happens as it is different each time I plug it in. I am starting to think it may be some dead chips however I ran the code in serial monitor and I am getting this response,

    It is Half Past Nine

    10,31,0
    It is Half Past Ten

    11,31,0
    It is Half Past Eleven

    12,31,0
    It is Half Past Twelve

    1,31,0
    It is Half Past One

    2,31,0
    It is Half Past Two

    3,31,0
    It is Half Past Three

    4,31,0
    It is Half Past Four

    5,31,0
    It is Half Past Five

    6,31,0
    It is Half Past Six

    7,31,0
    It is Half Past Seven

    8,31,0
    It is Half Past Eight

    9,31,0
    It is Half Past Nine

    10,31,0
    It is Half Past Ten

    It seems it is adding to the hour segment each second.

    Any advice on this?

    It is doing this in Arduino 1.0.4 and Arduino 00023.

    Thanks,

    Dustin

  35. Dan,

    I'm not sure what Doug is doing with those additional LEDs (I looked around but the clock looks more or less the same) but they are wired to ATMega pins 25-28, which correspond to Arduino analog pins 2-5.

    Be aware if you are going to try a combination of our two designs that there are enough wiring differences that the code will have a number of differences. For example I used external pull-down resistors for the pushbuttons where Doug uses the internal pull-up resistors in the ATMega. In addition to the new LEDs he also uses a different order for which outputs trigger which group of LEDs. These differences are pretty straightforward to resolve, however, you need to be aware that our two designs are not completely interchangeable.

    Sorry for the slow response.

    Joe

  36. Hey Joe,

    First of all thanks for posting this project. I am about to start tackling this endeavor. I have been going back and forward between your tutorial and Doug's and I noticed he has added the minutes to his code. It looks like he added a 5 pin header for those 4 LEDs and just want to make sure I put it in the right spot and wire it correctly. He also uses a PCB he designed but I want to wire it like you did just for my education. I was wondering if you tried to add that to your setup and if not I was wondering how to add that to yours cause I think I am going to set up your schematic. Disclaimer, I don't have much experience in this stuff but I am interested in learning. I think I finally understand your set up, just curious about the minute LEDs. Thanks!

    Dan

  37. Hi Joe,

    Doug Jackson (drj113 – from Instructables.com) here.

    I really enjoyed your write up – well done.

    I just thought that I would write to clarify the use of the 1302 RTC chip in my design – You are correct – It is a desicated RTC chip, so it keeps better time accuracy than the AtMega does – It also lets me implement battery backup, which my clocks all support now – I simply connect a SuperCap to the RTC itself, and it just works.

    I used LED strips in my last project, as they allowed me to easilly make a design that was able to be expanded in size – The largest clock that I currently sell on my site is 70cm tall x 50cm wide.

    All of my clocks now run from +12v DC. Originally, I was using 9V AC and counting mains cycles for timing, but that was frustratingly unreliable. My design used ULN2803 drivers as that allowed me to operate the 12V LED strips – I simply connected the anode of the strip to +12V, and the cathode was grounded through the ULN2803, ensuring that the micro never sees 12V (Which is bad for it).

    I am considering a smaller design for a broach at the moment, but to be completely honest, the current clocks are so popular that I am spending most of my time making them for other people.

    I hope that you continue to develop new and amazing ideas.

    Doug

  38. Nathan,

    The pins you should wire to on your Arduino are shown below:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    As far as arranging the parts goes I think the layout I used on my circuit board worked pretty well. I grouped the shift register and driver chip pairs together to keep the wiring more straightforward since each pair drives its own group of words. You can see this in the pictures of the finished board where I have a different bundle of wires coming from each pair. That just leaves the small number of interconnections between the chip pairs and your Arduino board.

    Hope this helps,

    Joe

  39. Hi Joe, I am attempting to make this wordclock, seems like a cool project. I have an arduino and was hoping to use that with a breadboard and the shift registers + drivers to get the clock to run. However, I am new to electronics and am struggling to know how to arrange the components and connect the arduino to the breadboard and to the led's. Do you have any advice or photos of the steps you could share?

  40. Gio,

    The wiring is very similar except for a few minor changes. Instead of an external power source you can power the clock from the Arduino's onboard power circuitry. You will also need to wire to the Arduino's I/O instead of wiring directly to an ATMega like I did.

    Make sure you keep the power draw of the LEDs low enough that the Arduino can handle it. The largest power draw possible for the clock occurs when 31 LEDs are lit simultaneously. To be safe I would size the resistors such that 31 LEDs draw less than 400mA. 1K Ohm should work fine.

    The pins you should wire to on your Arduino UNO are shown below:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    Have fun,

    Joe

  41. Thanks for fast response.. But i see, that he use the same chips, but he didn't mentioned what power supply he uses 🙁 … I'm trying to find out the answer because led strips ar lot cheaper here than simple leds.

    Greetings from Lithuania!

  42. Tomas,

    1 – I haven't looked at his code, but I assume he is using the DS1302 to keep time since it is a real time clock and should be much more accurate than the ATMega.

    2 – The design I used DOES NOT have any battery backup capability as it is currently designed.

    3 – After refreshing my knowledge of the HCF4094 & ULN2003A chips, I'm not sure that 12V would work. It is definitely too high voltage for the ATMega. I don't recommend mixing voltages if you can avoid it, so for the sake of simplicity and because I know it works, I would stick with a 5V system.

    Good Luck,

    Joe

  43. Hi Joe,

    I'm absolute newbie here and very interested in building a word clock.. now i'm trying to compare your and drj113 schemes and i would be grateful if you or someone answered my maybe stupid questions… And here is the questions : 1) why he is using ds1302 (if i'm right, atmega also counts time, or no?), 2) your clock dont have backup battery ability? 3) question about power supply : if i use 12v led strips, i should use 12v power supply? and if use 5v led's i should use 5v supply?

    drj113 scheme : http://www.instructables.com/files/deriv/FSU/MUJK/GKLJ64W2/FSUMUJKGKLJ64W2.LARGE.jpg

    Tomas

  44. Joe, I was using a version of the Arduino software from almost 2 years ago. Thanks so much for the response. I had no idea what was causing the issue- I'm not familiar with the Arduino compiler or its functions. I'll try the new software and see how the clock does.

  45. Wojo,

    What version of the Arduino software are you using? The reason I ask is that the "millis" function that the program uses to keep time was changed in version 12. Previously this function would overflow after about 10 hours, making timekeeping gradually more inaccurate. The function now overflows after about 50 days which should greatly increase the accuracy of the clock. If for some reason you were using an older version, recompile with the newer software and try it again in your clocks. Beyond this issue, I'm really not sure what could be causing your clocks to run slowly. My clock seems to keep pretty good time.

    Good Luck,

    Joe

  46. Hello, I have built two of these clocks pretty closely to the specifications. However- they both display incorrect time after about a day (clock is slow). I used a 16Mhz crystal and the two corresponding caps on a standalone atmega. Is there any reason why this would be happening? How could I change the code to fix this issue?

  47. Hello Joe,

    I'm having problems running the clock off the standalone atmega328. I've been able to get the clock to work by wiring

    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    to the arduino board I have. https://dlnmh9ip6v2uc.cloudfront.net/images/products/1/0/3/5/6/10356-01b.jpg It uses a surface mount atmega instead of a dip.

    Is there a way to program the dip atmega328 with the arduino board I have?

    Bests,
    Luke

  48. Matthew,

    If you use a regulated 5V supply like I did, then you DO NOT need a voltage regulator. If for some reason you are using a different type of power supply, then you would need a regulator to prevent under-powering or damaging the chips. The easiest way to get a regulated 5V supply is to use an old cell phone charger, but you can also buy them from Adafruit or Sparkfun.

    Thanks for the complement on the schematic. I've seen way too many badly hand drawn circuits so I always try to use CAD if I have time.

    Joe

  49. Hi Joe,

    I was hoping if you could really help me out here. Am I supposed to have a Voltage Regulator in the circuit as well? If so, how will it be wired? Or is it because you already have a regulated 5V source that you dont need one? I really really like your schematic of your components by the way! Thank you very much!

  50. Jeffrey,

    For power you can use the Arduino's 5V pin to drive the remaining circuitry. The one caveat with this approach is that you have to make sure you don't draw too much current. I would use 1K Ohm resistors with the clock LEDs to keep the clock's overall current below 500mA.

    The pins you should wire to on your Arduino Board are shown below:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    This essentially how my scratchbuilt Arduino is wired, I just made the connections straight to the ATMega chip instead of a pre-made Arduino board.

  51. Joe,

    Thank you for the quick response. As far as wiring the Arduino board directly into the circuit, how does that change the schematic? I am new to the Arduino world so any help on that would be great. That sounds like it would be a lot more simple for my first big time project, especially since I don't plan on reusing the Arduino any time soon to program another chip.

    Thanks again,

    Jeffrey

  52. Jeffrey,

    If I understand you correctly, you are going to load the program onto the ATMega chip while it is in the arduino board and then take the chip out of the board and wire it into the circuit I show in my schematic.

    If that is the case then you DO NOT need an FTDI cable. There is a USB to serial converter built into this cable that does the same thing as the converter on your arduino board.

    That said, you could just adapt the existing arduino board into the project. That would give you the ability to easily change the program via the built-in USB port as well as powering the whole clock from the Arduino's power supply.

    You can use pretty much any button you want for this project, but I used the following on my project – http://www.mouser.com/Search/ProductDetail.aspx?R=B3F-1000virtualkey65300000virtualkey653-B3F-1000

    I used the following crystal – http://www.mouser.com/Search/ProductDetail.aspx?R=ABL-16.000MHZ-B2virtualkey52750000virtualkey815-ABL-16-B2

    For the capacitors, both the 22pF and 0.1uF are ceramic capacitors like these – http://www.mouser.com/Passive-Components/Capacitors/Ceramic-Capacitors/Ceramic-Disc-Capacitors/_/N-5g90/

    If you use a regulated 5V source (like any USB output), then you don't need a separate voltage regulator. I recommend re-purposing an old cell phone charger (as long as it has a 5V output, which most made in the last few years are).

  53. Joe,

    First a little background on me: I am a beginner when it comes to electronics. I have built a TV-B-Gone (adafruit sells a kit) so I know how to solder and understand the basics, but I am left with a few questions as I begin to put together my "shopping cart."

    Here is the "Arduino" that I am looking at. http://www.ebay.com/itm/SainSmart-Duemilanove-Board-2009-ATmega168-PU-for-Arduino-Robot-Free-USB-Cable-/271020986583?pt=LH_DefaultDomain_0&hash=item3f1a1c10d7
    Will that work for this application? You said something about using an FTDI cable from Adafruit, will I need to use that with this board? I am a little confused on whether or not I will need that cable.

    I am also a bit unsure of which buttons I need for the Hour/Minute. Do you happen to have a part number or something similar?

    Because I will be reusing the arduino (do you recommend that?) only to program the chip, I will need the crystal, capacitors, and the voltage regulator. Do you have any part numbers?

    Thanks for the help and please excuse my "noobness."

    Jeffrey

  54. Bailey,

    I would double check the code and your wiring. The wiring on my schematic is set up to pull the inputs low the majority of the time via the 1K resistors. When a button is pressed the input is pulled high. My code matches this configuration by looking for a 1 to indicate a button press.

    Be aware that the older code on which my project is based used internal pull-up resistors and pulled the inputs to ground when a button was pressed, therefore that program looked for a 0 to indicate a button press.

    If your wiring doesn't match your program then it will not work properly. If you look through the other comments someone else had a similar problem, except their clock would constantly cycle through the different words because the wiring & program mismatch caused the clock to constantly think that a button was being pressed.

    Good Luck.

  55. Hi i have mocked up on bread board the clock, everything is working fine apart from the hour & minute forward when setting the input high it does not change the time. Any ideas where i need to be looking my board or the code. Thanks

  56. That was the problem thank you for your response it works great. For some reason I did not see that your code was there I guess I overlooked it.

  57. Jon,

    Your problem is being caused because you wired your clock to match my schematic, but the code you used doesn't. If you load my code from the link at the bottom of this blog post, your clock should work fine.

    This is because the code you loaded assumes that the pushbuttons ground their respective inputs, instead of pulling them high to +5V, which is how they are wired. Consequently, since they are pulled down to ground all the time, the clock just cycles through all of its states instead of running the normal timing cycle.

    You could rewire the pushbuttons, but I think it's easier to just load my code instead.

    Joe

  58. Alright I have checked the buttons for my clock and they are installed properly, no short to 5 volts. I re-checked all of my wiring for all of the ICs and everything is right. I checked for any shorts anywhere in my circuit with my DMM and did not find anything wired wrong. Is there anything that I have to add to my circuit because I followed your schematic exactly. I'm not sure if you needed something else or not but all it does is cycle through all of the times in sequential order. I have been scratching my head on this one. I had ordered a kit from dougswordclock.com and that clock worked just fine, unfortunately I do not have that clock anymore for a point of reference but I think that it was a little more complicated. I am new to arduino programming so copied and pasted the code that I had found and am not sure if any changes needed to be made for it. this is the programming I used http://www.instructables.com/files/orig/FUD/0MSO/GH8AB6SF/FUD0MSOGH8AB6SF.tmp

  59. I had exactlythe same problem. I had wired one of the switches for hours/minutes wring, hooking it up permenanty to 5v.

  60. Jon,

    Do all of the words cycle (hours and minutes)? It sounds like you could have a wiring issue with the hour and/or minute buttons so that instead of waiting for the clock time to tell it when to light the next word, it is incrementing through all of the states of the clock.

    Joe

  61. I have finished making my clock and when I power it up it just cycles through all of the words. do you have any idea what I am missing

  62. To give something back, after all my questions – now mine is working!. Two things.

    1) On mine, and other examples I've seen, if you use an LDR (photoresistor) then the side connected to the resistor needs to be connected on the ATIMega side of the resistor (at pin 23), not the earth side, or you just get a reading of zero all the time.

    2) To have the words "IT IS" dimming you need to use an NPN transistor (I'm using a 2N3904) connected this way: Base – goes to PWM 9 (pin 15 , bottom right, on the ATIMega) via a 1K resistor. Emitter goes to Earth, and collector to the "IT IS" LED bank cathode.

    http://i55.tinypic.com/o6b2tc.png

    This is my dimming code:

    With all the other "Ints" at the top of the code:

    int PhotoCellReading;
    int LedBrightness=255;

    Then down where the existing PWM code is:

    PhotoCellReading = analogRead(0);
    //Serial.print("Analog reading = "); // Good for diagnosing your LDR readings
    //Serial.println(PhotoCellReading); // the raw analog reading

    LedBrightness = map(PhotoCellReading, 0, 1023, 0, 80); //The Max range of "80" stops my clock being too bright. You can go up to 250
    if(LedBrightness<20) LedBrightness =0; // Stops the LED flickering on and off when moderately dark
    // – Tweak this value depending on your environment (TV etc)
    analogWrite(PWMPin, LedBrightness); //enable dimming via photoresistor
    //analogWrite(PWMPin, 255); //manually set brightness level OLD CODE so you know where to insert the above

    Hope this helps someone. Have fun!

  63. Got it! It was a bad connection to Pin 16 on the HEF4094 – +5v – seems it works fine with no PWM without this live, but it depends on it when PWM is used.

  64. Thanks , I thought as much. I remember thinking , "why bother with chip sockets?" at the start, no I know why! :-p I think it may be a faulty chip as my OE wire is daisy chained from chip to chip, so if there was a wire connection fault then the 3rd chip would also have problems. Ahh well, lots more fun ahead !

  65. Roger,

    As you point out, all of the words that are not behaving properly are on the same circuit. This leads me to believe that you may have a bad connection, or that one of the chips in that circuit may be faulty.

    All that the PWM does is pulse the output enable signal, so if the 4094 shift register or the 2003 darlington array isn't handling the pulsing properly, that could explain why the LEDs are stuck on. If you used chip sockets and have some spare chips handy, it would be a lot easier to just swap out the existing chips and see if that helps before checking your wiring which can be pretty tedious.

    Good Luck

  66. I have one more query! I have one odd result. If, in the code, I change the PWM value to anything other than 255 then the clock behaves oddly (in a predictable way). The PWM works – the LEDs dim to the value, but once you go past "half past" any hour , then "one, two, three, four, five, six" light up permanently until an hour (O clock) is reached, when they then clear. The clock still tells the time, and the other "words" work as they should, but 1,2,3,4,5,6 stay permanently illuminated once a half-hour is passed. I notice they are on one chip, with the word "to" also, which is on when the errant numbers are too….

    Perhaps i have a bad connection to the "1,2,3,4,5,6,to" chip and the pwm signal is too much for it?

  67. Thanks for explaining all that. I've nearly finished now. All looking great. I used thin cardboard for the baffles and it works a treat. 3 transparencies for me. Just waiting for some NPN transistors to arrive so I can make IT IS dimmable. I only had one NPN and it seems blown. The IT IS just sat at what looked like around 30-50 out of 255 brightness whilst the rest of the LEDs changed. I metered the NPN and got total continuity both ways between two pins which I believe means it is dead.

    Thanks again. Great tutorial and schematic clarification.

  68. Roger,

    From the HCF4094 Datasheet: Data is available at the Qs serial output terminal on positive clock edges to allow for high speed operation in cascaded system in which the clock rise time is fast. The same serial information, available at the Q’s terminal on the next negative clock edge, provides a means for cascading HCF4094B devices when the clock rise time is slow.

    Note: Qs is Pin 9, Q's is Pin 10, and Vss (ground) is Pin 8. See the HCF4094 Datasheet: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000399.pdf.

    As for the Output Enable (Pin 15) I'm not sure how others have wired it, but the reason they are tied to the same PWM output is to allow the program to dim the LEDs (if you used a photoresistor to determine the ambient light level for example).

    Hope this helps. Good luck on the build.

    Joe

  69. Hi – I'm building the clock to your spec (laser transparancies and an almost identical PCB) – Quick question – on the HCF4094's you use Pin 9 ( Qs' ) to pass the bus link on to the next HCF4094 whereas all the other circuit diagrams floating about use pin 8 ( Qs ) to pass the data to the next chip. Is there any reason for this or do pins 8 and 9 do the same thing? (I' know very little about these chips – well, nothing at all – though I get the idea of what they are for).

    Also, you link all the pin 15's (OE) together, yet I don't see this on other schematics. Same question really.. why?

    I'd love to know/understand – I assume it makes no difference but would like to be sure before I get soldering.

  70. Kajetan,

    Adding a potentiometer in series with the photoresistor would work to some extent, however, it wouldn't allow for true manual dimming. Because the photoresistor value changes with the ambient light, the voltage seen by the arduino's analog input will also change with the ambient light except it will be offset by the value of the potentiometer.

    This could cause some unintended circumstances when your manual setting goes against the ambient light conditions. For example if you wanted to manually turn up the brightness (potentiometer minimum) but the room was dark (photoresistor maximum) this would cause the clocks brightness to be low since the photoresistor overrides the potetiometer's setting.

    Try it an see how it works for you.

    Joe

  71. Another question .
    Is it also possible to add an additional potentiometer in row with the photoresistor to make it possible to manually dimm the light too ?
    greeting , Kajetan

  72. Kajetan,

    Generally speaking most photoresistor values should work, however, I would use one that has a maximum resistance of over 100k ohm. 90mW should be an adequate power rating since the analog input barely draws any current.

    As for the program, the following has to be changed:

    void loop(void)
    {
    /*analogWrite(PWMPin, analogRead(0)/4); //enable dimming via potentiometer or photoresistor*/
    analogWrite(PWMPin, 255); //manually set brightness level

    In order to use the photoresistor the code should now look like this:

    void loop(void)
    {
    analogWrite(PWMPin, analogRead(0)/4); //enable dimming via potentiometer or photoresistor
    /*analogWrite(PWMPin, 255); //manually set brightness level*/

    Good luck,

    Joe

  73. I just finished my clock (thx for the awesome Tutorial!) now i would like to add the Photoresistor and have a few questions.
    Can i use any resistor ? What stats schould i use ?
    Pmax 90 mW
    R 01 500 kΩ
    R 05 1500 kΩ
    R10 27 à 94 kΩ
    Umax 150 V
    Would this be enough? 90mW is to small ?

    And can you tell me what i have to change in the Programm code for the wanted effect ?

    with greetings from Austria, Kajetan Knapp (sry for my english)

  74. Peter,

    That is strange. I would reload the program and double check the wiring just to be sure. Otherwise I am at a bit of a loss as to what could be causing this. Since it appears to be time dependent, that would imply that the program was causing it, however, since the code should be correct it doesn't make a lot of sense that the program would be the problem.

    Good Luck,

    Joe

  75. Hey Joe,

    Just finished the word clock. I'm having an issue where when it is " half" or "quarter" past the hour "minutes" is still lit up. In the code it looks like it shouldn't be calling "minutes" at those times. In addition this does not happen when it is "quarter" to the hour.

    Got any ideas?

    Much appreciated,

    Peter

  76. Hey Joe,

    That's really helpful indeed! Thanks! I'm excited about this! I'll definitely keep you posted when and if (?) I'm done 🙂

    By the way the URL you mentioned has an extra ')' at the end! You might want to update your reply for other people that might be following this post! Again, thanks for your help!

  77. Marios,

    When I build an Arduino from scratch I use a schematic like this: http://www.ladyada.net/images/boarduino/boarduinosch.png to wire the circuit. It shows which pins of the ATMega chip translate to which I/O of a standard Arduino board.

    This information must also be kept in mind when programming because I/O is referenced according to its label on an Arduino board. For example the PWM output for the word clock is wired to pin 15 of the ATMega, however, it is defined as output 9 in the program since this is the equivalent output on an Arduino board.

    Joe

  78. Hey Joe,

    Thanks for your reply!

    I drew up a quick schematics on top of your schematics just to get a better idea.
    By the way, how do you came to that conclusion on which pins to use from the arduino ? Is it based on the code or some documentation that I'm missing ? Again thanks, things are getting more clear now!

  79. Marios,

    It looks like you have a good understanding of what you need to do. The Arduino should have enough power to drive all the LEDs and by substituting a full Arduino for my homebrew version it should translate fine.

    The pins you should wire to on your Arduino UNO are shown below:
    Strobe – Digital 8
    Data – Digital 7
    Clear – Digital 6
    PWM – Digital 9
    Minute Pushbutton – Digital 2
    Hours Pushbutton – Digital 3

    Good luck,

    Joe

  80. Hey Joe,

    Thanks for the clear schematics. I'm also inexperienced with electronics and arduino. This is my very first contact with such things. I'm a software developer though so I have basic understanding of things. I also started gathering components to build this. At an initial stage, I'm planning to build this using JUST an Arduino UNO. I understand that your schematics use many parts that are already on the Arduino UNO. I also understand that I will be needing the ULNA2003A and HCF4094 no matter what.

    My questions is, how would you change the schematics to have JUST the Arduino UNO, the ULNA2003A and HCF4094 chips ?

    This is what I'm planning to do and please correct me if I'm wrong (as I said earlier, I just started reading about these)
    Reference: http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front.jpg

    I will draw power from the Ardunino UNO's 5V pin to drive the HCFs
    I will replace the PWM connection from the ATMega with the Arduino UNO's PWM pin (which one though?)

    What about the Strobe, Data and Clear pins on the HCFs ? I'm guessing from the digital PWM pins again ?

    As for the resistors and LEDs I'll be using a 1KOhm resistor to drive the LEDs at 10mA. With 31 max simultaneous LEDs I will be needing 310mA which is something I can draw from the USB or Power plug of the Arduino UNO, right ? This is something I read from the instructables discussions.

    Anyway Joe, any help will be greatly appreciated!

    Thanks again!

  81. Andrew,

    Glad to hear that you finished it and it is working well for you. It's good to know someone got something of value from one of my posts.

    Joe

  82. Hi Joe,

    I finally finished the project! Thanks for all your help!
    I even implemented the photoresistor and it's working perfectly fine, except for the dimming of the "IT IS" light (the brightness never changes for this one), but other than that it looks awesome!

    Thanks!

  83. Andrew,

    The code shouldn't be too hard to modify. There's actually a line of code that is commented out at the beginning of the void loop that uses the analog input 0 (Pin 23) to drive the PWM output that controls the brightness of the LEDs. If you activated that line of code and then removed the line of code that sets the LEDs to maximum brightness that should work, however, you may have to play with the scaling to get it to work how you want it to.

    I think any range of photoresistor should work, however, different ranges may require different scaling in the program or maybe even a different bias resistor instead of the 10K I have in the schematic.

  84. I see the complication…hmm…
    If I were to use the photoresistor connected the way you drew it on the schematic,
    would the altering of the code be a difficult task?
    I'm comfortable with C programming, but I haven't had any luck figuring out this arduino code that you uploaded.
    Where and how would the code change if I introduce the photoresistor into the circuit? And would it matter what range of photoresistor I use? The one I have is ranged from 1.5kohms to 20Mohms.. I couldn't find a smaller one.

  85. Andrew,

    In theory putting the photoresistor between the 5V supply and the LED array would work, however, in practice it probably would not turn out as you would hope. The first reason is that most photoresistors couldn't handle the current needed to run that many LEDs. Second, photoresistors generally have a very wide resistance range for when they are exposed to darkness vs bright light, consequently getting the right resistance level and as a result LED brightness for a given ambient light source would be pure luck. This is why feeding an analog input with a photoresistor and then manipulating the data it provides is a better way to get the results that you would want.

    Lately I have been thinking more about getting a photoresistor working with my clock because it is much too bright at night. Hopefully I'll have enough time to work on it in the coming weeks.

  86. Thanks for the quick reply!
    That's exactly my concern.. Pin 22 is always grounded so the absence OR the existance of the photoresistor won't effect anything in the circuit, because pin 23 always has a 10k ohm resistor to ground and pin 22 is always grounded.
    But i do like the idea of using a photoresistor.
    Wouldn't it work if i placed the photoresistor between the 5V supply and the node that connects all the LED's anodes?
    This way, i don't think any altering of the code is needed.

  87. Andrew,

    Pin 22 of the ATMega should be grounded regardless of whether you use the photoresistor or not. The 10K resistor is used on Pin 23 to keep the voltage range within the capability of the ATMega's analog inputs.

    If you DO NOT want to use a photoresistor, just follow the schematic, but leave out anything attached to Pin 23.

    If you DO want to use a photoresistor, then follow the schematic, but you will have to modify the code slightly to enable the section that allows the photoresistor to control the brightness of the LEDs.

    I showed the photoresistor as optional since I planned to come back and try it out at a later date. Unfortunately I haven't had the time to work on this aspect of the project and make any code modifications/corrections to get it working the way I'd like.

    If you're in doubt, just wire everything up except the photoresistor itself (leave the connection wires unconnected) and then you can always add it later if you wanted, but if you don't it won't affect the clock's operation.

  88. Hi,

    I'm sooo close to finishing up this project, but I have a question regarding the schematic.
    The photoresistor is shown to be optional on the diagram.. I'm just wondering how putting a photoresistor would change anything in the circuit. I'm assuming the photoresistor is there to have the clock dim when it's dark?
    My concern is that pin 22 is always grounded regardless of whether or not the photoresistor is there. This would mean pin 23 is also unaffected.
    Is this the proper place to put the photoresistor?

  89. Andrew,

    You should be able swap a new ATMega chip into an Arduino, load the bootloader, load the word clock program, and then put that chip in the circuit I have shown. I see no reason why that wouldn't work since you will be using the Arduino's USB-Serial converter instead of the FTDI cable's like I did. Since I like to scratch build a lot of things, I find it very useful to have an FTDI cable since I can build my own Arduinos as part of the circuit on the cheap and still be able to change the program without pulling the chip.

    Good Luck,

    Joe

  90. Hi,

    I have a question about programming the microcontroller.
    Is it possible to stick my mircontroller into an Arduino UNO, program it, then take the chip out and place it in my circuit?

    Thanks!

  91. Thanks Rob, it's clear now.
    Maybe i will try to use an RTC, as i saw it in Doug's instructable. I hope it could help to keep the real time.
    I'll be back if i have some results to share.

    Tom

  92. Tom,

    The "IT IS" is referring to the LEDs that are let for those words on the clock. The reason those are separated from the rest of the words is because they have to be lit at all times. Don't worry about the inexperience. I'm the one in the notes above you and after some time, I was able to build my clock. I do have an issue where it seems the clock is running slow (I haven't looked for a more updated program file). Also, my only other quandry is trying to figure out a thinner (but still as strong) product to use for light baffles, as I don't like having the components on the outside.

    Have fun and good luck,

    Rob

  93. Hi Joe,

    this is a great project, i would like to make it.
    Could you explain me what exactly IT IS stands for in the schematics?
    I'm unexperienced in electronics, but i want to give this a try.
    Thanks,

    Tom

  94. Joe,

    Thanks for the quick response. Unfortuneately, due to my low IQ in electrical, I probably understood about a tenth of that. I've spent probably the last two weeks trying to understand how to do this and everyday this last week feels like I'm regressing. I'm going to take a huge step back and work on understanding this better. Well, either that or toss everything in the garbage. Thanks again for the help.

  95. Rob,

    It sounds like you want to be able to power the entire project via the 5V output of the Arduino. This should work as long as the current draw of your LED array is not too high. The Arduino documentation doesn't explicitly state the maximum current that it can provide, however, if powered via USB it is limited to 500mA. My clock was well below this but it is something to keep in mind. Since my clock doesn't use a standalone Arduino I used an external 5V source (old cell phone charger) which is a regulated 5V supply which can provide up to 700mA. You could go a similar route on your build if you wired an external 5V supply to both the USB input and the remaining circuitry, thereby bypassing the Arduino power supply circuit and avoiding any possible power issues.

    As far as wiring goes, if you would like to be able to reuse your Uno in the future I would stick to using to plug-in headers and not solder to the board. Other options would be to build an Arduino circuit from scratch (like I did), or use one of the other Arduino boards available that has through-hole wiring instead of headers, like the Diavolino (http://evilmadscience.com/productsmenu/tinykitlist/180). That would make it much easier to hardwire the entire project together as a standalone device, if that's what you are looking for.

    Hope this helps,

    Joe

  96. Hi Joe,

    Just wanted to ask you a question or two about the clock. I am in the process of building my own and started getting the components from the Instructible. One of the main issues that I'm having is that I'm a beginner when it comes to electrical. And let's just say that it's frustrating to not have a complete grocery list of everything I need when I have to fish through the instructions to find out things I didn't order.

    The issue that I am having is on the power. I have an arduino UNO board that has a 5V plug on it. From the comments, I'm under the impression that I can use the board as a whole. However, I had the idea that if building this was a success and someone wanted me to build another, I'd hate to have to order a new one. So here are my questions. 1. If I stick with the UNO board, do I run male headers into the female sockets on the board or solder from the bottom? 2. If I go with making my own power, can you provide a list of the specific components needed? One of the most frustrating things that made me almost quit this idea was the need for 1k ohm resistors. When I went to a website to order them, there were at least 8 different kinds.

    Thanks,

    Rob

Leave a Reply to Dustin Cancel reply

Your email address will not be published. Required fields are marked *