Open Arduino

Enter Your Project for a chance to win a grand prize for the most innovative use of Arduino or a $200 shopping cart! The Birthday Special: Arduino Projects for Arduino Day!

Back to The Project14 homepage

Project14 Home
Monthly Themes
Monthly Theme Poll


Hi everybody!

I wear eye glasses since I know myself and during the years the number are only going one way, UP

Without them I cannot see almost anything, everything is blurry.

There is one problem, if my kids wake in the middle of the night, I really want to know what time is it, and wearing my glasses several times at night is not an option.


Then I came with a solution, even though I can see digits, the colour stays correct.

I wanted to build a clock that will consist of 1 RGB led, and every hour during the night will have different colour coding.

And it goes like this on fritzing:



And goes like this on breadboard:

I removed some unrelated circuitry from other projects that still on my breadboard


How to remember colour-hour index?

Since remembering 24 colour by heart is too much I thought using some nice colour palette that will represent sunrise/sundown so remembering the exact hour won't be that hard.

Also, I don't really need 24 hours but only dark hours, so I only included 19:00 -> 07:00 hours.

My draft is:

Arduino code

I will be using two libraries:

Complete code can be found in my github:

Colour palette relies in separate H file in double array, so I could easily change palette without diving into the code too much...


The community voice

I would like to thank genebren, neilk, mcb1, jc2048, balearicdynamics and jw0752 for their helpful comments.

It is great seeing that projects you think are great, also seems interesting for other people.

I will try to summarize the comment so far and also add offline comments I got from other people I talked to regarding this project.


Arduino by itself cannot provide accurate clock over time without aux devices.

Solutions I know so far are (ordered by complexity):

Arduino time library actually supports all of the solutions above, so from SW perspective its no big change.


I think my solution will be to add RTC, I am not sure the module will arrive on time for the contest schedule, but I will order one for long term solution...


LED contrast issues

For start, I would like to say I accidentally connected the RED pin to a non-PWM pin in arduino (pin 8), I moved it to pin 6 and now the colors are much more rich than I thought. +1 to cheap RGB led

Additional improvements are:


I must say after playing around with the color values and move RED pin to PWM,

I did managed to find more than 12 distinguishable colors to project on cheap RGB LED.


LED replacement approaches people mentioned:

  • Use Braille code
  • Using text to speech engine to speak the time

Both approaches are much more complicated


Thanks again for all the people that are interested in the project


Making it like arduino brick

I have decided to try and build the module as an arduino brick.

The pins of the board will suite exactly in the right arduino's pins so it will be easy to make it portable and extensionable.

In the video below you can see clearly how the brick fits inside the arduino uno.

I also provided debug hooks for allowing to test the colors of the LED in a more quick way

By pressing r,R,g,G,b,B one can change the values of the LED for finding better colors as he wish.

Prints to serial are also included, I also made the debug code enabled with macro for saving MIPS in operational mode (hopefully for better clock accuracy)

Power source

Pretty simple, 5v cellp hone wall wart with type B USB cable

Making the colors more precise

I have tried many methods for making the colors more distinguishable.

The most accurate method found so far is putting the clock inside an open box and during the night the emitted light is very soft and accurate

The sunrise/sundown colors are easy to remember and the quality of my life has been improved, at least at night

Wish list

1. Adding RTC. The module has enough room for adding RTC, I just need to wait until the item will reach my post office.

2. Config time

     Currently the simplest method I am using is to set it to 19:00 upon reset of the arduino.

     I can build screen and button with the whole bloat but I prefer other way.

     I have bought an IR receiver, I will also search for old TV remote and will try to find and easy and simple clock setup

     Something like: 1 button to enter setup mode, (LED will blink), press 4 digits 1725 will be to set the time for 17:25:00, then press setup again (LED will be solid)



Next steps

Receive the RTC

Final notes

I must say the last couple of weeks were great.

I was able to approximate the time during the night, since the granularity of the indication is per hour the time drift is fairly insignificant. I set the time 2 weeks ago and i didnt even notice 1 min drift.

Also the sun colors also help to quickly remember by heart the color to hour transformation.

I am sure RTC will probably minimize the drift further but since the arduino code is simple and all debug hooks can be turned off by macro the drift is minimized to bare min.


I hope that anybody that will want to build the piece have enough info in this walkthrough.