When I showed my 60 NeoPixel LED clock prototype to my daughter and her girlfriend, and they both wanted to have one right away :-). Well, that clock was just a proof of concept, with lots of temporary wiring. So I decided this week-end to beautify it and to make it look nice and clean(er). There is nothing like a week-end project with adding a few more LEDs and features :-).
If you want to build something similar, here is what I used:
- Freescale FRDM-KL25Z board (or any other FRDM board): US$ 15.00
- 4 Adaftruit 4/60 Pixel Ring: 4x US$ 9.95
- Adafruit 24 Pixel Ring: US$ 19.95
- Adafruit 12 Pixel Ring: US$ 7.50
- A battery buffered realtime clock, I used the DS1307 from DX.com: US$ 2.85
- Bread board or prototype board with cables and headers: every engineer has that at hand, so ‘free of charge’ ;-)
- Large capacitor (around 1000 µF, at least 6.3V or higher), 300-500 Ohm resistor, 74HCT245N level shifter: around US$ 2.00
- Eclipse with Processor Expert if you want to use my sources and project, link to GitHub project at the end of this post: free of charge :-)
- Something to mount the LED rings on it. I borrowed kitchen hot pan protector tile made of slate stone. My wife will find this out when she returns from work this evening ;-)
- Drilling machine/Dremel
- Universal Glue plus a hot glue gun
- Shrink tubing or electrical isolation tape
- A small protection case to put the electronics into it.
- Around 5 hours of your time (depends how skilled you are) ;-)
So costs are around US$ 90. Definitely you get a clock below that price from any store nearby, but for sure not such a cool one!
Self-Made NeoPixel Shield for the FRDM Board
Previously, I used a bread board to drive the NeoPixels. To makeHCT things cleaner, I have created a small prototype board shield for the FRDM board. So I integrated the level shifter, the capacitor, the resistor on the data line and added the RTC (Real-Time Clock).
The TinyRTC I2C module has a DS1307 on it, and this one needs a 5V supply (the EEPROM would be happy with 3.3V). For the I2C I do not need a level shifter, as the pull-ups define the logic level. So all what I need to do is to power the module with 5V, but remove the two pull-ups to 5V on it (R2 and R3), and add two pull-ups to 3.3V because otherwise on the FRDM board side there are no I2C pull-ups:
The next picture shows the bottom side with the wiring: The green wire is the WS2812 bit signal from the microcontroller to the 74HCT245N level shifter. The output of the level shifter goes to a 400 Ohm resistor and then to the LED connector. For the Tiny RTC I only need 5V, GND and I2C (SDA and SCL):
I added one terminal for the LEDs (5V, GND and Data In) and one terminal for a separate 5V power supply. If driving only a few LEDs, the board USB power supply is used (< 300 mA):
Clock Back Wall
I needed something as background for the clock. In our kitchen we use slate stone tiles to protect the table from hot pans or cups. I have a small 5x5cm one for my hot-as-hot double-double Espresso coffee cup:
They are inexpensive, around $US 2.50 for the 5×5 cm one, and about $US 4.00 for the large 20×20 cm one. The slate stone has a nice surface. The large 20×20 cm tile has the perfect size for my 60 Pixel ring:
I want the cables not to be visible, so I need to drill holes. As I was not sure how good this works, I started with the one for the 60 pixel ring. First I marked the position where to drill the hole:
Then using a Dremel to drill careful and slowly a 3 mm hole:
Slate is a rather soft stone, so that worked pretty well:
The backside was perfect :-):
With such a good result, I was confident that it shall work for the remaining holes too. With paper tape used as underground, I aligned the rings and marked the position of Data IN, Data OUT, 5V and GND connectors:
The drilling holes shall be under the rings, so they are not visible afterwards:
The data routing is as below:
- Microcontroller/Level Shifter to Data IN of the 60 Pixel ring.
- Data OUT of the 60 Pixel ring to Data IN of the 24 Pixel ring.
- Data OUT of the 24 Pixel ring to the Data IN of the 12 Pixel ring.
With this the pixel sequence for the software is this: 60 Pixel ring -> 24 Pixel ring -> 12 Pixel ring. Each ring has its own 5V and GND wires.
For the large 60 pixel ring, I need to pull 4 wires (Data In, Data Out, 5V and GND) through a single hole. But for the smaller rings there is only one wire for each hole, so I used a smaller diameter of 2 mm:
The backside looked good too:
After removing the paper tape, the front was very clean (I should have used that paper tape for my first hole too):
Pulling the wires for the small 12 Pixel Ring:
Then soldering it to the ring:
Pulling the wires back to put the ring into place. Because the ring is hold by the wires, no other fixing is required :-) :
Same for the 24 Pixel ring:
Pull the wires to place the 24 Pixel ring and repeat the same soldering for the large 60 Pixel ring:
Then pull the wires to put the ring into its place:
Because the larger ring only has one hole to keep it into position, I glued it down. For this I put a drop of glue under the ring:
On the back side of the clock the 5V and GND wires are soldered together:
And then isolated with shrink tubing (or use a tape):
To secure and fix the wires, I glued them to the back:
Clock Desktop Stand
While it would be possible to put the clock on a wall, I think it is better on a desktop. For this I need a feet or stand. I joined a acrylic picture holder with that small 5x5cm tile.
I added one stainless steel wire to attach the picture frame to the tile, and one wire to hold the front tile with the clock on it. The Freedom board fits behind the stand:
Now the clock is securely held in position:
As for the basics of the software used, see “Adafruit NeoPixel Clock with 60 LEDs“, “Tutorial: PWM with DMA on ARM/Kinetis” and the project and source files on GitHub here. The project is an Eclipse Kepler project for the GNU ARM Eclipse plugins. As compiler I used the open source GNU ARM Embedded (launchpad) tools. The project is using Processor Expert components which I have created and used in other projects, and which made it easy to implement the clock functions:
The program is running FreeRTOS for scalability, and implements an interactive command line shell interface. With the help of Processor Expert, only a few source files are required to implement the clock. The source NeoRingClock.c implements displaying the clock and controlling the LEDs based on the time information from the RTC:
And this is how it looks like:
I’m very happy about the result: A fancy and (I think) cool looking clock with WS2812/NeoPixel LEDs for around $US 90. But a DIY LED clock is priceless anyway :-).
As alway, I think about adding more:
- Ambient light sensor for automatic dimming
- Smoother movement of the second indicator (dimming in and out)
- Smaller PCB/electronics
- Using the accelerometer to dynamically change the clock orientation
- Adding Bluetooth Low Energy (BLE) so I can control it from my Android tablet
- More funny effects or different kind of clock materials, like pans or glasses or … :-)
The FRDM board could be eliminated with everything on a single PCB. I might have to think about this when I would go into ‘production’ mode. Let’s see, maybe there is a demand for such clock? Oh, and I need to wait and see my wife is when she finds out that the kitchen inventory has misused :-).
Happy Clocking :-)