Outrageously cool WS2812-NeoPixel-based clock - Embedded.com

Outrageously cool WS2812-NeoPixel-based clock


Well, I am all aquiver with excitement. When I returned from my trip to the UK last week (to celebrate what would have been my dear old dad's 100th birthday) I found a package waiting for me in my office.

The outside of the package informed me that its sender was my chum Duane Benson, so I was reasonably confident that this was going to contain the PCB he'd created to implement the spectrum analyzer shield for my BADASS Display. And, indeed, when I opened the box, the first thing I saw was a small plastic bag containing a couple of these PCBs along with the associated headers.

Actually, the main package was significantly larger than this board. I remember thinking at the time that Duane was being a tad enthusiastic on the packaging front. In fact, I was just about to throw the box away when I realized it contained something else. When I looked closer, I discovered a 60-element NeoPixel ring (this is actually formed from four 15-element NeoPixel segments) from AdaFruit.

Now, I've been using NeoPixels in a lot of my recent projects (see Using WS2812-based NeoPixels in embedded systems), and I'd been lusting after one of these rings for a while, so I was jolly excited to finally have one in my sweaty hands. I was just starting to ponder some of the things I could do with this little beauty when I realized that it was accompanied by a custom-designed circuit board.

Well, what would you do? There wasn't any note accompanying the ring, but there was a micro-USB socket on the board almost begging for power to be applied, so I immediately did so, and the ring lit up looking much like the image above.

It didn’t take too long to realize that this was a clock. The pink pixels indicate the hours, the yellow pixel indicates the current hour, the green pixel indicates the current minute, and the blue pixel (a bit hard to see here) indicates the current second.

Sometime later, when I finally got around to checking my email, I found a message from Duane saying: “The spectrum analyzer board should be there when you get back. Also, you'll need these instructions for a little something extra I put in the box.” This link took me to the LeoNeo Clock Kit page on Duane's SteelPuppet.com website where I discovered this video, detailed build instructions, and the source code for the sketch (program) running the clock.

In addition to the MCU (which looks like an Arduino Leonardo to the Arduino IDE), there is a real-time clock (RTC) chip, an ambient light sensor, and two control buttons. You can use the buttons to vary the overall brightness of the NeoPixels and to set the time. Whatever brightness you set as the base level, the system will use as a starting point to brighten or dim the display based on the ambient light.

Now, I want to go on record here as saying that Duane has done a masterful job. His circuit board is a joy to behold (not the least that he solders all of the surface-mount components by hand), and the board-ring combo looks absolutely amazing in real life. On the other hand… displaying the hours, minutes, and seconds on the same ring can be a tad confusing to the observer. Also, I always feel that the more tri-colored pixels you have, the better life is (this is a simple rule-of-thumb, but it's served me well over the years).

The bottom line is that I started to ponder making one of these little beauties of my own. Unlike Duane with his custom board, I'll start out using an Arduino Uno or Arduino Mega for my prototype (I may move on to a custom board later). I also started to think about augmenting the 60-pixel ring with a 24-pixel ring and a 12-pixel ring as illustrated below.

In the case of the real-time clock, I'm going to use a ChronoDot Module from Adafruit, because I've already deployed these in my Vetinari Clock and my Inamorata Prognostication Engine projects; they are easy to use and work really well.

I'm still noodling about all of this, but my current thoughts are to place the NeoPixel rings behind a circle of translucent white glass, which will be embedded in an equilateral triangle of black/ebonized wood. The triangle's corners will be rounded off, and the whole thing will have an ultra-simplistic look and feel as illustrated below.

Of course, this ultra-simplistic look will be deceiving. For example, it will be possible to place the triangle using any of its faces as the base, and the clock's display will automatically respond to accommodate this. I could achieve this using two or three simple Tilt Ball Switches, but I'm rather tempted to performing some experiments with a Triple Axis Gyro, or perhaps even an all-in-one 9-DOF Sensor (where “DOF” stands for “degrees of freedom”). In the case of this latter unit, a 3-axis accelerometer can tell you which direction is down towards the Earth (by measuring gravity) or how fast the board is accelerating in 3D space; a 3-axis magnetometer can sense where the strongest magnetic force is coming from (generally used to detect magnetic north); and a 3-axis gyroscope can be used to measure spin and twist. By combining all of this data, the clock will have a really good idea as to what is happening around it (yes, I said “will” because while writing this I've decided that my masterpiece deserves nothing less than a 9-DOF sensor).

I'm also planning on adding a sound effects card that can play and mix multiple audio streams. A few of us have been looking into designing and building our own card (see this column for more details). However, Duane just pointed me towards a very interesting card called the WAV Trigger from SparkFun that appears to offer most of the capabilities I need.

In addition to playing various sounds to indicate the passing of the hours, minutes, and seconds, I'm also planning on having the clock respond to being tapped or moved, saying things like “Oi! Have you washed your hands?” and “Hey! Don’t be so rough!” and “Oooh… that feels nice.”

The really cool thing is that I showed Duane's clock to my chum Ivan who sits in the next bay. Ivan and I are both somewhat competitive, so he's decided to build one of these clocks also, and then we're going to compete with each other to try to out-do the other with the sophistication of our effects. We've both ordered our 60-, 24-, and 12-pixel rings and ChronoDot real-time clocks. (Ivan doesn’t yet know that I've ordered a WAV Trigger card — you have to keep a little something in reserve LOL.)

I'll be posting update blogs and videos in the weeks to come. I'll also be making all of my design files and program source code files available for anyone else who wants to build one of these. Actually, it would be great if you decided to build one yourself, because then you could join in the competition with Ivan and myself to see who can come up with the best effects. In the meantime, I'd be very interested to hear your thoughts on all of this.

Join over 2,000 technical professionals and embedded systems hardware, software, and firmware developers at ESC Boston May 6-7, 2015, and learn about the latest techniques and tips for reducing time, cost, and complexity in the development process.

Passes for the ESC Boston 2015 Technical Conference are available at the conference's official site, with discounted advance pricing until May 1, 2015. Make sure to follow updates about ESC Boston's talks, programs, and announcements via the Destination ESC blog on Embedded.com and social media accounts Twitter, Facebook, LinkedIn, and Google+.

The Embedded Systems Conference, EE Times, and Embedded.com are owned by UBM Canon.

20 thoughts on “Outrageously cool WS2812-NeoPixel-based clock

  1. “I've got one of these clocks on the wall in my office. I've been seriously thinking of making it speed up or slow down at various times of the day – make meetings seem shorter or longer, and just generally confuse people.”

    Log in to Reply
  2. “You already succeeded, because the one you sent me was set to Pacific Time, which really did confuse the situation for a brief moment LOL”

    Log in to Reply
  3. “Hi Duane, When I chaired meetings I always made the meeting standing only, as it shortens the time spent in useless talk. I never though of making the time speed up in these meetings but what a great idea say 2:1 they would all go away grumbling about how

    Log in to Reply
  4. “Hi Crusty — I must admit that I like the idea of messing with people's minds — the ideal thing would be for the clock to be aware of what's going on around it — so when someone new enters the room it shows the correct time — but after that it slows do

    Log in to Reply
  5. “I'm the developer of the SparkFun WAV Trigger mentioned above. As you probably are already aware, the WAV Trigger can play and mix up to 14 16-bit, stereo 44.1kHz wav files simultaneously and independently, with independent track volumes, fades and crossf

    Log in to Reply
  6. “Hi Jamie — I'm the author of this blog — in fact I was just looking at your site trying to work out what SD card to use (I ended up finding it on the SparkFun site — as far as I could see there's no mention on yours — it might be good to add it to the

    Log in to Reply
  7. “Before I designed this, I had a mirror image clock on the wall behind me in my office. It worked well for me, because I'd see it in the reflections on my window, but people coming in to talk with me would get really perplexed looks on their face.”

    Log in to Reply
  8. “Crusty – I've thought about a batter operated version, but the NeoPixel draw a lot of current. I've considered a number of options, but so far haven't come up with anything reasonable.”

    Log in to Reply
  9. “Great minds think alike….nnI had thought about doing a three ring (or at least a two ring) NeoPixel clock after seeing Duane's comment on your last NeoPixel blog where he mentioned his. Of course I hadn't thought about putting it in a wood enclosure..

    Log in to Reply
  10. “Ivan already has his three rings lit up in his office and they look AMAZING. I'm still sticking to three rings also, but I may use more (like a 60 outside, a 24 inside to the bottom, and three 12s sitting in the area above the 24) in a Mark 2 version — I

    Log in to Reply
  11. “I like the idea of making this thing situationally aware. There are some pretty tiny image sensors around – cell phone cameras – that I could put on a version. But then, I'd need more horsepower than an 8-bit MCU has at its disposal.nnNXP and Freescale

    Log in to Reply
  12. “Next week I'll be posting a column about a new product that could help with the situationally-aware stuff — but I do like the idea of machine vision — it would be great if the clock could recognize people and say things like “Good Morning Max, that's a

    Log in to Reply
  13. “So — are you going to join the competition with Ivan, Elizabeth, and myself — (a) the best visual effects using three concentric 60-, 24-, and 12-element rings and (b) the most wizz-bang overkill use of sensors?”

    Log in to Reply
  14. “Max/Duane,nI Love this project and feel very tempted to have a go at building something similar myself. I would make use of my wood turning lathe though to create a jig to aid the ring assembly. “

    Log in to Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.