LED Clock with Kitchen Hot Pan Protector
Join the DZone community and get the full member experience.Join For Free
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 :-)
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.