Introduction: The Go the F* to Sleep Guardian Angel Project
Making a kids night clock using a sparkcore and an internet button shield. (Any neopixel strip mounted in a circle would do).
The idea behind this project was to have something that my 4-year-old could look at and instantly know if it was time to get up, or if she should stay in bed. Also giving her a reference for how much time "five minutes for bedtime reading" really is.
- "Internet button" shield
- Postcard from ewian.com
- double sided tape
- some semi-transparent diffusing plastic material
- Power bank or USB charger
- paper knife
The idea is to have the surface of the clock light up in blue color when it's daytime, and red or green color when it's night. We'll also use the 11 leds distributed around the clock to show the time, using one color for hours, another for minutes and a third for seconds.
The 11 leds are distributed around the clock as if there were a twelfth led.
It'll use network syncronized time, and have a presicion of 5 minutes or 5 seconds on the leds. (12 positions)
Step 1: Programming the Sparkcore
I assume you've already managed to connect your sparkcore to spark.io, and are ready to code in their online editor.
My code for this project is available on GitHub. You have permission to use this code under the AGPL 3.0 license or later.
Both of these libraries are avaliable through the library search at spark.io, so find them, and add them to your project.
With these two libraries added, you can use the code from my project. Note that you may want to change the timezone offset
rtc.setTimeZone(1); // gmt offset
You might also want to choose a different set of colors.
Step 2: Mounting the Clock
Now, the sparkcore might be cool, but it isn't much to look at, the neopixel array also has quite visible red green and blue leds inside each pixel, so it'd be nice if we could blur it a little.
I used some cardboard to keep the clock standing, cut out holes in a postcard matching the pixels, and added a layer of some semi-transparent glittery packing plastic on the back of the postcard. Then I mounted the postcard on top of the internet button shield using double sided tape.
You may also add digits to the led-positions on the face of the postcard