zondag 27 november 2016

weekender project: build a clock out of a plastic jar.

Make a clock with a white plastic jar, 2 adafruits neopixel rings and an arduino.

you need
1 arduino uno
1 adafruit neopixel ring 24 color leds (link)
1 adafruit neopixel ring 12 color leds (link)
1 plastic jar with lid, big enough to hold the 24 leds ring.
1 rtc module (real time clock) like this one (link)

The small ring is the small hand of a clock. 12 led's for 12 hours.
the bigger ring show's the seconds an minutes. well 2.5 minutes (seconds). Because 60 minutes diveded by 24 leds is 2.5 minutes interval. This makes the clock less accurate to read. Adafruit sels 60 led ring but it's huge, too huge.
The seconds go round in smooth way. They start to fade in and fade back out, one after another to create a fluid motion.
The minute and hour "hand" don't have this motion (yet).
The color of the hour and minute leds change during the day. At midnight till about 4 they are blue, then they start to fade to red at dusk continue to yellow at noon, in the late afternoon they fade back to orange, red, purple and blue to emulate the dawn.

The code.

You can find the code on github (link).

puzzling the pieces together

The neopixel rings are easy to put together. The rings need only 3 wires: 5v, ground and a data line. Run a wire from pin 6 on the arduino to the data in of the 24 led pin and a wire from de data out of the 24 led ring to the data in of the 12 led ring. Connect the 5 volt and ground.

The rtc module needs 5 wires: 5 volt, ground, mosi, miso and ss. They are connect to pins 10-13.

The jar.

you need a white plastic jar. The neopixels are bright. A white jar kind of smooth out the bright light.

the neo pixel ring front
neopixel rings atached to a small piece of wood

in the jar

the arduino and the rtc mounted in the lid of the jar


what's still missing

Button's to adjust the time. I had no right size switches of button's left, so adjusting the time can't be done without connecting the arduino to the computer and recompile the code.