Introduction: Arduino Colorful Clock++ Using Neopixel Strip
Features of the clock
- Arduino micro-controller based
- Hardware & enclosure procured from local stores
- RTC controlled by battery
- All functions controlled via IR remote control.
- Multiple modes of Display: Dot mode, Seconds arc mode, Minutes arc mode, Hours Arc mode, All Arc mode, Night mode(Auto dim)
- Hour alerts and auto mode change every 15 minutes
- Senses low ambient light and dims the LEDs to very low light levels
- Ambient light level adjustment to go to night mode
Step 1: Parts Needed
Electronics:
- Arduino Mini/nano or clone
- RTC module::DS3231 module
- WS2812B controlled RBG flexible LED strip with 60 LEDs/metre (Neopixel strip or equivalent make)
- IR Receiver:TSOP1738 38Khz
- Any spare IR remote control to use for controlling functions
- PCB header
- LDR
- 10K potentiometer/Variable resistor
- 1000MF 16v electrolytic capacitor
- General purpose PCB/Veroboard
- 230V ac to 5V DC power adaptor (I used a mobile charger's circuitry.)
Hardware:
- Hardboard
- Flexible beading strip (used to line furniture edges):Should be bendable but should retain a clean circle when bent (Avaialble in general hardware stores in bangalore)
- Hot glue gun
- Quick fix/Adhesive-Fevicol
- USB cable
- AC cable with 2 pin plug
- Single core wire to use as binding wire tags(i used strands of cat5 cable innards)
- Photoframe nail holder for hanging the unit to on the wall
Step 2: Connectivity and Building the Hardware
Coding: Pls see details in last 2 steps and ensure you have updated your remote control hex codes into the code and that the code is burned onto your arduino.
Electrical: Using a general purpose PCB and wires, i soldered them all together as per the schematic (See picture of schematic). Make sure that the IR receiver is soldered with flexible wires rather than on to the PCB as it can be positioned in the convenient place to receive the IR signals
Mechanical: I needed a circular shape to wrap the RBG LED strip around, so that the light from the LEDs spread out in a radial fashion and give a diffused look onto the hanging wall. Looked around for simple solution and found that i could buy meters of beading strips from my local hardware store. These strips are an inch and a quarter wide and are quite firm when rolled into a circle. Just spread the RGB strip on the circle and adjust the needed size and giving slight overlap of the beading, cut off extra length. Using adhesive stick the overlap areas and allow to dry.
Using similiar process wind another circle of smaller diameter which is spacious enough to fit the electronics and the power supply inside this ring. Drill small holes at the bottom and top of the inner circle strip to allow wiring to pass thru between the circles (see picture). I got a square hardboard which is 1.5 inches bigger than the diameter of the outer circle and trimmed the square corners to make it a circular hardboard. This will be my base of the clock.Once this is done, i placed both the rings on the hardboard (size 1.5 inches bigger than the outer ring) and trace the outlines and mark the holes @ 90 degrees using small punch. I removed the rings and using small drill bit, made holes on both sides of the outlines. These holes are going to anchor the rings to the hardboard.
Now i place the outer ring on the board and using single strand wires (salvaged from an old CAT5 cable-you can use any strong single strand wire which has metal inside to support the weight and twisting, making a narrow u shaped piece of wire, inserted the wire into the guide holes drilled and twisted them from the backside to hold the ring in place. Repeated this for all the holes of the ring. I repeated this for the inner ring as well. Once i ensure that the rings are in their correct place, using hotglue, i seat the rings in their place. I am securing the rings and providing the physical support with both the wires and the hot glue so that the structure is rigid. I made a small hole in the center of the hardboard (will be used to cover the entire clock with the acrylic cut disc)
Making sure that the hot glue has cooled and ensuring that all the needed holes are there in the rings and aligned, i affix the circuitry inside the inner ring area and secure the same with wires and holes (same as i did to the rings but slightly apart) so that the circuitry holds it's place and doesn't move when the clock plate is mounted vertically. I ensure that the IR receiver is fixed to the board such that it's sensor window is clearly visible from the front of the clock.
I rolled the RGB LED strip carefully clockwise (noting the signalling direction on the LED strip) on to the outer circle and if everything fits fine , i remove the adhesive backing from the strip and stick the LED strip to the outer circle. i ensured that the strip end connector was ending up between the 2 circles (see picture).
Next step was the connect the USB cable to the circuitry and connect the LED strip to the circuit and finally power up the 5V supply via 230V AC mains. I used an old mobile charger's circuit after stripping it's outer shell. Pls be careful here as it will be lethal 230V AC on exposed terminals. Take care to put enough insulation once you solder the mains power cable to the circuit board.
I ensured that the entire thing is working fine(power supply, LED strip etc) and then fixed the the acrylic circular disc drilled with a middle hole (see pic). this acrylic cover helps two fold: Helps spread and diffuse the LED light very beautifully and also allows my remote signals to reach the IR receiver sitting behind this cover.
Step 3: Before the Code
Code for my clock is embedded in next step. Almost all the functions and variables are labeled in code comments. Feel free to experiment with your editions or customization.
Before burning the code into your Arduino, you need to do some important editions to some of the hardcodings done in my code for ensuring that your code works with your IR remote control. Basically i have used an IR remote control to manage the clock remotely since i did not want any buttons on the clock. I had a spare IR remote (used to control LED strips) which was not being used. You can choose any remote as long as it is working and is not used to control any other device in the same room where you are going to hang the clock (as it may erroneously switch multiple devices when used). Next steps is identify which keys will be used for these functions on your remote: You need to have an IR remote with minimum of 12 buttons to map the same to the functions we are going to assign to those keys.
Just to simplify, whenever you press an IR remote, an unique hex code is sent via IR waves to your equipment (TV/Set top box/Receiver etc). Here we want to identify 12 buttons on that remote that we are going to use for controlling our clock functions and learn the hex codes they generate when pressed. We need to edit our clock code to ensure that the function that reads the IR codes coming via the IR receiver on the clock has these hex codes mapped.
How to get the hex codes and write them down to edit our clock code:
Pls use the below instructable to read the hex codes from the IR remote that you have chosen for the clock control and write the codes down for the corresponding 12 buttons that you want to use to control the clock.Use the first program only to identify your remote buttons' hex values. Use only this piece "Arduino Code for Receiving IR as Hex code" inside the instructable.
https://www.instructables.com/id/Arduino-IR-Remote...
Once you have found out the 12 hex codes for the corresponding 12 remote button presses, pls edit the clock code to change my hex codes with your respective hex-codes obtained from your remote
12 functions i have mapped to my remote control and their hexcodes are below and the naming convention is in the below template
MY REMOTE button::0X HEXCODE of 6 digits:: Function assigned to the button
- UP BRIGHTNESS button ::0XF700FF:: For increasing LED brightness in regular mode
- DOWN BRIGHTNESS button:0XF7807F:: For decreasing LED brightness in regular mode
- R button::0XF720DF::All dots mode ( H M S are shown as moving dots)
G button::0XF7A05F:: Seconds Arc mode: All dot except seconds which will be in circle
- B button::0XF7609F::Minutes Arc mode: All dot except minutes in circle mode
- W button::0XF7E01F:: Hours Arc mode: All dot mode except hours in circle mode
- Flash button::0XF7D02F:: All circles mode (H M S): All in circles
- ON RED button::0XF7C03F::To toggle night mode on/off
- Yellow button::0XF728D7:: Night value threshold increase to adjust the sensor to ambient light conditions to sense nightmode (advanced setting-you may not need to use)
- Blue button::0XF7A857:: Night value threshold decrease to adjust the sensor to ambient light conditions to sense nightmode (advanced setting-you may not need to use)
- FADE button::0XF7C837 :: Increase brightness setting of Night mode
SMOOTH button::0XF7E817::Decrease brightness setting of Night mode
Step 4: Here Is the Code
Attached is the arduino file for the code. Comments are self sufficient
Step 5: Evolution/Improvements/Enhancements
What started off as a simple circular LED clock evolved across few months with various ideas and changes coming into my mind as i sat down to code in my limited freetime and weekends. I started off with a push button for clock mode change and a potentiometer for adjusting LED brightness and later improvised functionality and started adding features. I removed the buttons and potentiometer and used a IR receiver and added code to allow all adjustments of brightness, mode and night sensitivity adjustments using IR remote keys. Added some auto features like auto mode change every 15th, 30th, 45th and 58th minute, night mode on low ambient brightness etc.
Other enhancements that can be done are : Time setting/changing using remote, syncing to any external timesource using additional circuitry (for US geo with time servers).
You can edit the code and make your customized clock!! Enjoy!

Participated in the
Microcontroller Contest 2017
36 Comments
Question 2 years ago
Hi,
On my clock Hour, Minute & Second are working fine, and additional some Red Led are lit ?
Question 3 years ago on Step 2
I am creating this project and I am having some trouble understanding the electrical drawing on how its all connected. I have no background in electrical. I'm an artist and love LED's
So I have this big clock and it has a 120pixel WS2812 strip as the lighting. I am using an Arduino Uno. The rest of the parts are the exact same as the list. I am very visual, is there different version of the electrical design? Clear text on what connects where?
Thanks in advance. I'll share once its done!
Answer 3 years ago
hi
this is the circuit diagram. U may take help of a friend who can help u with the connections using this picture. It is very simple. Note that my code works for 60 LEDs and not 120.
Question 4 years ago
hi
when I start or reset clock is stated with dot mode but when I will change mode by pressing G or B or W or FLASH mode will change. but when I want to go again dot mode by pressing R, it is not done. Dot mode is not activated. I have to restart or reset controller. Please give solutoon abotut it.
Answer 3 years ago
it does cycle thru the modes. pls check if u have tinkered with the code anywhere. it works for my remote. Check remote control IR codes.
Question 4 years ago
hi, please send full circuit diagram
Answer 3 years ago
the circuit diagram is in one of the pictures if u see all the pictures i have uploaded. It is a picture of the circuit i had handwritten in my scrapbook though.
Question 4 years ago
Please send full connections diagram
Question 4 years ago
Hi,
I have refer arduino code. In this code for clock ds1307 library is used but in hardware ds3231 rtc is used. Why? Is it worked properly? Please reply fast.
Answer 4 years ago
They are interchangable. Don't worry. It works
5 years ago
Thank you.Iprogrammed the RTC separetely AND EVERITHING WORKS FINE !
5 years ago
Mr Ravijag i am from Greece. I made this project with the old code from instructables and works fine.but if you like send me the latest code because the pdf is corrupted.We have the same remote control.Do you tell me the hex codes for time set buttons ?
nasos15
Reply 5 years ago
Hi there is no new updated code available. There is no button to set time in this clock. The RTC has to have the correct time programmed into it before fixing it in the circuit.
5 years ago
Hi, nice work, i am about to make it my self, just waiting for missing parts to arrive, but i have a problems understanding your hand drawn schematic , can you please make easier to understand one? Like on a pc or one like GreatScot draws? Would really appreciate.
Reply 5 years ago
sorry but could not get time do a formal schematic etc. Just let me know which part u did not follow or need help and i can sure guide you for that
5 years ago
exit status 1
Error compiling for board Arduino Nano.
how to solve this problem
Reply 5 years ago
Pls check code again for errors while copy pasting. it works with nano or mini as well as uno
6 years ago
Hi Ravi,
I am very new to the programming and using of arduino. Though going with your instructions, I have made the whole project work just as you intended it to be. My issue here is that I want to change the colour of the LED's for H/M/S, as I am not well versed with the code, I am getting no clue about this. If you could tell me how to do that I would be really thankful.
Anyways would have to thank you to make my first project successful.
Thanks
Reply 6 years ago
Dear Salil
Firstly congratulations on building this successfully on your maiden effort! That takes lot of effort and i really appreciate that!!
The code i have written uses 3 arrays to define Hours Mins & Seconds as hled[], mled[] and sled[] and use computation to put a 1 in the places where i want to light it up based on the current time and the mode.I use a function to just write these 3 arrays into the LEDs using writepixels() function.
you can tinker with the order of the same arrays being written in the below call and experiment to change the H M S colors:: write_pixels(&hled[60],&sled[60],&mled[60],bright); //Red=hour, Green=seconds, Blue=minutes order. Unfortunately i have not put a provision in my code to mix colors(say hours to be shown in orange or white etc) other than these 3 primary colors for simplicity.
Hope this helps move you forward in your endaevor to change and customize your clock
Reply 6 years ago
Thanks a lot Ravi. For now I am good with these colours. But will surely try to learn and make it customisable. Learning in the process.
Your instructable was pretty easy to understand, unlike many others. Thanks.