One of my clocks stopped working – and it happened to be a clock my wife likes a lot. Went to the repair shop and the guy said that he didn’t have the spare parts and could not repair this. So – I thought – why not build an LED clock – I had tons of LEDs and an RTC module just waiting to be used. The original plan was to make a charlieplexed LED clock – 60 LEDs working off 9 pins and 12 LEDs working off 4 pins – so doable with a standalone arduino. This was to be powered off 4 AA cells. However, before the clock was finished – a couple of rolls of WS2812B RGB LED strips came – I had ordered these a couple of months ago – and they came at the perfect time. When my wife saw the effects that could be generated using these, there was no going back. Now, we had spent considerable amount of time sticking the charlie-plexed LEDs and soldering them – so I was unwilling to give them up. Finally, we used the white LEDs to show seconds, and a strip of 60 RGB LEDs for the minutes and hours.
- A standalone arduino / Arduino Pro Mini
- 60 White LEDs – 5mm
- 9 resistors – 110 Ω
- WS2812B RGB LED strip - 60 LEDs
- RTC Module – DS1307
- Some headers, wires, capacitors, etc
- 12V – 800mA adapter
- CP2102 USB-to-TTL (the RST pin on the CP2102 is not for resetting the arduino – you have to solder a wire to the DTR pad on the PCB – which sends a reset signal to program the arduino. This has to be connected to the reset pin through a 104 capacitor) or Arduino to program the standalone processor as discussed in the previous post.
The Circuit is built in two steps:
- Take a strip board and connect the LEDs as per the table above. Please note, the LED numbers in blue were soldered by mistake and I had to modify the code to correct for this
- I suggest you leave a blank row between the LED rows - this would make the circuit simpler and easier to troubleshoot
- I used thin resin-covered copper wires to make this circuit as you can see below, however have been advised that ethernet cable would be a better option
- SDA and SCL pins to the RTC module’s SDA and SCL pins.
- PIN 12 to data pin of the WS2812B LED strip
- PINs 3-11 to the Charlieplexed LEDs as above
Make sure you connect the power adapter directly to the RGB LED strip and not through the arduino. The code ensures that the white LEDs do not glow all at the same time, please do not modify, as switching on all the white LEDs may damage your arduino.
I use the following libraries:
- RTCLib Arduino Library: https://github.com/adafruit/RTClib
- FastLED Arduino Library v2.1: http://fastled.io/ (Please use version 2.1)
Code can be found at:
For the clock-face I pulled out one of my photographs from Singapore and modified it to suit a clock face. I got this printed on photographic paper.
- Cut a piece of thick solid cardboard into a circle with a diameter of 318.3 mm. Please note, the circumference of the clock HAS to be 1 meter for the LED strip to fit perfectly
- Stick the LED strip on the circumference, with the first LED at the 12 o'clock position
- Stick the white LEDs behind each of the RGB LEds on the strip (as below)
- Stick the clock face from the previous step on the cardboard circle