Introduction: Data Clock (Cloud + Amazon Echo + LED's = Artistic Data!)

For years I've wanted to find ways of artistically expressing data that I check every day. Most of my job is spent on the computer or phone - and yes, there is an app or webpage that can do all of this and more. But I'm fatigued collecting my data from screens. Here's an interesting, artistic and refreshing way to view data in new ways. This electro-mechanical device can display current and historical weather, forecast, moon phase, solar weather, snow pack, stock-market, timers, (and of course the time) in a well laid-out system complete with Amazon Echo (Alexa) voice control! What we've developed is part-mechanical, part-arduino, part-LED, part-internet, part-stepper motor, part-wood, part-metal, and part-fun!

The principle of the clock is as follows. The inner ring is the mode ring and the outer ring has a "peep-hole" that corresponds to the inner ring's mode. So in the pictures above you will notice that it is currently in the moon mode. Color coordinated LED's will then display the AGE of the moon, the RISE time, the SET time, and the PHASE.

12 modes in all including Weather, Historic Temperature, Forecast, Ski Mountain Conditions, River Flow and few modes custom to my own personal needs.

All this data is collected from the internet via a cloud-connected particle core arduino microcontroller. The voice activated Amazon Alexa is used to change modes. Extra cool!

Due to the complexity of the clock, this will be a principle and inspiration based instructable rather than a detailed step-by-step. Source files and code will be attached!

Materials we need:

  1. (480) WS8212b LED modules. You can buy them from digikey or find them surplus on ebay.
  2. 1/4, 3/16, 1/2 and 3/4 MDF sheet material
  3. (5) 1.5" 1/4 -20 bolts and nuts (or comparable)
  4. Paricle photon here.
  5. Low profile (pancake style) stepper motor. Surplus one's here.
  6. Stepper motor driver. This one works well
  7. Skateboard bearings. (8mm inside diameter 22mm outside diameter)
  8. Bare wire and some connecting wire
  9. Soldering patience!

Tools:

  1. CNC Machine
  2. Solder iron and solder
  3. Drill, screwdrivers and misc hand tools

Step 1: Use Cad Files and CAM Files to Cut Out Pieces

As can be seen in the pictures, the clock is composed of 4 main plates, two large internal gears, 3 small internal gears and some miscellaneous structural components. The clock utilizes the WS2812b pixel tape (144 units/meter indexing) oriented radially so that the pixel shines into a cavity and reflects up through a hole displaying the light.

I've attached the CAD files in both Rhino *3ds as well as the more universal *dxf files as well as the actual CAM files I created using VCarve (the post-processor I used was for Mach3).

The first step is to use the CAD files to create your own toolpaths and cut out he pieces you need. Theoretically you could use the CAM files in the ZIP folder but best practice suggests you use the CAD files and create your own (the attached files are for reference).

Any type of MDF can be used but for the face show pieces, it's nice to use painted MDF so that your lettering comes out sharp and crisp. I chose chalkboard material readily available at Home Depot as it is inexpensive and works great!

  1. Bottom Plate (Plate 3) - 1/2 MDF
  2. Middle Plate (Plate 2) - 3/16 Black MDF
  3. Top Gear Plate (Plate 2) - 3/16 Black MDF

For the letter I used a 30 degree vcarve bit, for most other work I used a 1/16 endmill.

Step 2: CNC Work - Scaffolding, Gears, Mechanics and Cavities

Here's a look a the various pieces that make up the complete package. I'm not going to take the time in this instructable to literally explain each and every piece. This is more of an explanation of the principles and concepts that I used to build the dataclock and I would expect that someone might be inspired by these ideas to do something similar!

Notice how the LED's slide into the cavities. Special jigs were needed to solder together the LED strips in perfectly indexed locations.

Step 3: Testing the LED, Wiring of Micro Controller and Mechanics

As assembly continues you can see the lighting begin to function. Notice how the lighting flows down the channels and then exits through the LED slits in the engraved top plate. Cool!

Step 4: Use Thingspeak to Parse Output From Wunderground API

The key to grabbing data from the cloud to display on our data clock is to use API's. API's are great when developing on the web, however, most API's output JSON which is complicated for the arduino to parse. We'd rather just have the parsing done in the cloud and then deliver clean data to the arduino when we request it. This is where Thingspeak comes to the rescue! Let's walk through this process.

As part of the weather mode on our data clock we need to know the historical record high. In order to do this we will have to register for our own person API (there is no cost for this). You shouldn't share your API (notice mine is blacked out). Once signed up, you can now begin using it. Conveniently for us, Wunderground has an API for accessing almanac data (and many more great tools found here). The API call looks like this:

api.wunderground.com/api/YOUR_KEY/almanac/q/CA/San_Francisco.json

When you substitute YOUR_KEY for your api you should get a response like this:

{"response": { "version":"0.1", "termsofService":"http://www.wunderground.com/weather/api/d/terms.html", "features": { "almanac": 1 } } , "almanac": { "airport_code": "KSFO", "temp_high": { "normal": { "F": "71", "C": "22" } , "record": { "F": "95", "C": "35" }, "recordyear": "1961" }, "temp_low": { "normal": { "F": "54", "C": "12" } , "record": { "F": "44", "C": "6" }, "recordyear": "1960" } } }

This is a very messy JSON output - difficult for arduino to use. To have this parsed by thingspeak, create an account at thingspeak and navigate to https://thingspeak.com/apps/thinghttp

Click the "New ThingHTTP" button. The following screen has two important fields. The first is the API field where we insert the API we received from Wunderground (used above). The second is the parse field. The parse field takes the JSON information and grabs only the data we are interested in. In this case we use the parse string: almanac.temp_high.record.F (notice how each element in this sequential string drills further into the sets of brackets in the messy JSON output we posted above) This enables us to drill down such that our new API will return a single number. Once you save your new ThingHTTP you will be presented with a URL that allows you to test your new API (NOTE: If you are using a web browser to test don't forget to remove the GET at the beginning of the string).

Checkout the new output: 95

That's nice clean data easily passed to arduino! That's how you do it. For each piece of data you want to pull down from the web, find an API, use thingspeak to parse it, and then call the clean thingspeak API from your arduino code. Let's look how to do that in the next step.

Step 5: Call Thingspeak API to See Your Clean Output

From our particle photon, we need to create some code that will pull our newly created thingspeak API (your fresh clean data). Here's some simple code to do that so you can understand the concept before we integrate it more fully. Note: In order to use this code you will need to download the HttpClient.h library found here. The full code is below the screenshot above shows the key piece we are interested in. Notice how the API from thingspeak is called and then outputs to the serial line! Nice and easy.

Now we can take that data and turn it into real world information.

Step 6: How to Add Voice-Activated Alexa Integreation Using IFTTT (Part 1)

Adding Alexa Support is surprisingly easy with the Particle Photon due to the excellent feature set provided by the IFTTT. To begin, create an account with IFTTT and connect both your Alexa device and your Particle. The image sequence should guide you through the steps.

Step 7: Expand and Design

Take the concept to the next level! Would be happy to answer any questions and get your feedback.

Microcontroller Contest 2017

First Prize in the
Microcontroller Contest 2017

Make it Glow Contest 2016

Participated in the
Make it Glow Contest 2016