20170426_224506s

Slices of a clock

There are so many ways to tell the time. DIYers have been doing clocks since the Ancient Egypt (obelisks lacked portability, thou). Every modern maker has a clock amongst her first projects. I have done some myself, including a fibonacci clock, a wordclock with a fancy green matrix effect and an unreleased project that hopefully will see the light someday soon.

But recently I came back to the idea behind the wordclock before, to extend it in different ways:

  • Replace the ATMega328P with an ESP8266 (NTP support and user interaction)
  • Smaller sizes (8×8 LED matrices)
  • Smaller PCB, less buttons
  • Add buzzer for alarms
  • Replace the 3D printed part with a wooden grid cut in laser
  • Completely closed enclosure, better presentation
  • Fix some issues with the original board (like the lack of a beefy capacitor across the LED matrix power lines).

20170426_224545s

Shrinking the PCB

One of the goals was to be able to create smaller displays using 8×8 LED matrices instead of the original 16×16. They are much cheaper and almost the same fun. The 16×16 I was using are the flexible type you can find on Ebay or Aliexpress for about 40-50€.

The 8×8 ones are also available for 7-9€ at Ebay and Aliexpress and have a smaller pitch (8mm versus 10mm for the 16×16 RGB LED matrices). This allows for a smaller version so I decided to design a PCB with the same features but a 50x50mm size. The controller board sports an ESP8266 ESP-12E [Aliexpress, also on Ebay] and a DS1337S RTC [Aliexpress and Ebay]. A buzzer for alarms and connectors for a WS2812 matrix with a beefy capacitor across the power lines.

The DaClock board is released under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA 3.0) and follows the terms of the OSHW (Open-source hardware) Statement of Principles 1.0. It can be checked out at my DaClock board repository on Github.

daclock-3-0-schema

20170426_110903s 20170430_220914s

SeeedStudio Fusion PCB service

You can use the latest gerblers from the repository or open the project using Eagle +8.0. I sent the gerblers to fab using SeeedStudio Fusion PCB service. It is the first time I use their PCB service but I have already sent a couple more projects to them, including a PCBA service and I plan to do a review about it soon.

Quality of the PCB is really good and price/quality ratio is hard to beat. I like the fact that you are not limited to the green color for the cheapest price tag: green, blue, red, yellow, black, white, they all cost the same and for a standard board under 10x10cm and 2 layers the price starts at USD 4.90 (USD 12.90 lead free) for 10 pieces!!

20170426_111523s

The slices PCB in black looks awesome. The only small glitch I noticed is a small (0.3mm) shift on the silkscreen. Not critical by any means.

20170426_111048s

Not the same board but the same Eagle part, the black one from SeeedStudio is slightly shifted towards the top left corner in the picture.

You can check the bill of materials at the README page in the repo for the rest of components.

Slices

Well, here’s where the name comes from.

My wordclock project had some very good reviews. People at the Mini Maker Faire in Barcelona last year loved it for the display effects and the overall built. “You should be selling it” was a common advice. The only issue someone reported was that it has an open enclosure (that sounds like an oxymoron). So I started thinking about a case for the electronics to prevent them from gathering dust.

On the other hand I wanted to get rid of the 3D printed part, the grid that serves as an isolator between LEDs. So I tried to laser cut it on a 5mm MDF board and the result is much better. 5mm thickness are enough to allow the light to cover the entire 9x9mm square and it looks nicer (better finished), easier to build because I’d be already using a laser cut for the rest of the pieces and much cheaper: a few cents versus a few euros for the 3D printed part, only in material.

20170502_080914s

I love the color of MDF after a session of laser cut!

And to close the box I designed simple hollow layers inspired (again) on the Pibow cases by Pimoroni. The only drawback is that you waste a lot of wood but luckily you can fit 4 layers of the smaller version inside the hollow layers of the 16×16 version since they are smaller than half the length/width (half the LEDs in each direction and smaller pitch).

The end result is a layered, “sliced”, box with room for the LED matrix and the electronics. The layers from front to back are:

  • a smoke colored acrylic layer cut with a laser cutter
  • a diffusor, a thin white paper sheet
  • the LED isolator grid, laser cut in MDF
  • the LED matrix
  • LED matrix frame in MDF for the 8×8 version
  • MDF hollow layers to allow room for the electronics
  • the controller
  • MDF again with holes for the power connector and button

20170426_124503s

20170426_140239s 20170426_140246s

20170426_140325s

To cut the layers I have used the Laser Spirit GE 100W at the Ateneu de Fabricació de Les Corts, one of the three public fablabs in Barcelona: Xarxa d’Ateneus de Fabricació de Barcelona.

The Slices case models (in OpenSCAD format) and the code examples below are released as free open source software & hardware under the GPLv3 licence. You can checked them out at my Slices repository on Github.

Coding clocks and more

Time for the code. I’m using the framework of my ESPurna project to add basic functionality (WIFI, WebServer, NTP, MQTT,…). On top of that I’m adding a matrix manager based on Adafruit’s NeoMatrix library and a driver manager. Each “mode” is handled by a “driver”. Drivers have common methods like setup, start, stop and loop that the driver manager is responsible to call when necessary.

NOTE: the code is still a work in progress.

Basic clock

A really basic clock, either static (like in the picture) or scrolling for 8×8 displays. I’m using the built-in font for Adafruit GFX library but I’d really want to use a thicker one (sans bold or similar). So far I have not been able to find or create a font for the GFX library that suits me. I’d like it to be 7 or 8 points height, easy to understand by a kid and with the full character set, including accented characters. If you happen to know of such font for this library, please let me know!

20170501_225614s

Wordclock

Not the same wordclock as in my previous project, this one scrolls the hour in a readable text. Currently only in catalan language but, believe me, english or spanish are waaaay easier.

Fibonacci clock

First thing I thought when I saw this Kickstarter campaign was “I want one!”. Next thing was “F**k! $100”. An still the next one: “I could build it myself”. Actually, Philippe Chrétien released the code and build instructions in Instructables even before the Kickstarter campaign, so anyone can build hers. Even if you are not good at electronics, for instance, you can buy certain parts from Philippe’s.

So I built my own. I have never written about it here but here you have a picture:
20160108_170107s

Instead of CNC’d thick wood I used MDF and a laser cut. The overall finish is good but improvable. Anyway I thought it could be easier to do with the “Slices”.

20170426_224545s

10:28, obviously

Since the fibonacci clock has a resolution of 5 minutes (you cannot read 19:33, but 19:30 or 19:35) I added the small “dots” at the bottom to account for minutes to add to every 5-minutes block.

Problem here is that you have to know the sizes and positions of each block to read it since they are built from several pixels each. So I cut off several separators from the MDF grid with an exacto knife [Ebay] to draw the different squares of side 1, 1, 2, 3 and 5 respectively and make it clearer:

20170428_031306s

2:55, who would have tell?

Binary clock

The classical geek clock. Hours, minutes and seconds in a BCD format, each column represents a digit of the HH:MM:SS string in binary.

20170426_224506s

22:27:48, easier then the fibonacci clock, rigth?

Game of life

Because why not? New cells are painted green and old ones blue. The game and its inhabitants are mesmerising.

20170502_082956s

Drawing canvas

And finally a little game for my daughters, draw something on the computer and see it in the LED matrix. Currently you can only choose the color and paint the pixels one by one. There is no eraser (you can erase the whole matrix instead). After a couple of drawings my eldest daughter wrote a TODO list for me: allow erasing pixels individually, add a color picker and save images so it can show a slideshow of them.

20170501_225529s

 

Any other clocks you can think of that could be represented in a LED matrix? A good thing about the ESP8266 is that I still have plenty of room to add more drivers…

CC BY-SA 4.0 Slices of a clock by Tinkerman is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

12 thoughts on “Slices of a clock

  1. msurguy

    Great post! Did you know that WS2812B LED module also comes in 3.5mm x 3.5mm package? Opening up some possibilities for smaller clock / finer displays

    Reply
  2. Pingback: Grid-eye camera (sliced, of course) - Tinkerman

  3. Dave

    This is amazing i am going to build a couple of them. One other led clock you could make is a tuk clock. The only problem is, it has 9 columns. So i think you’d have to take the one Gollum and put it below. I have been wanting to build a mix clock. I bought all the parts for it. I just haven’t gotten around to build it as it requires custom PCB with tons of LEDs. Your version is much more versatile. I did see a post somewhere at a hackathon do a tix clock with an esp but didn’t share any detail

    Reply
  4. Dave

    Hey I was thinking about what I mentioned the night before about the Tix clock. I think this could be done on the 8×8 matrix without needing a 9th row. Instead using the 3×3 they have, you use 2×5 and each colum would be a different color so to read the tix clock it is left to right , hhmm. so you could do 24 hour so you don’t have to denote am or pm. and it would be 5x1h 5x2h 5x2m 5x2m. If you watch videos on them they randomly jump around every few seconds or so but has lights that add up to the number. Let me know what you think

    Reply
    1. Xose Pérez Post author

      Hi
      Good idea, I do have some clocks with 16×16 or 16×8 displays but this configuration is suitable for 8×8 displays too. Will add it to the code.
      Thanks!

      Reply
      1. David

        nice! I look forward to it. how hard would it be to modify it to a 16×8 clock? as I would be willing to buy a 16×8 led matrix. Is it just a variable change in the code? if so I might just look into ordering a 16×8 as I much prefer the look of the 3×3 rows.
        thanks for your hard work!

        Reply
        1. Xose Pérez Post author

          If you check my code you will find out I’m using 2 8×8 matrices to build a 16×8 one. You could easily fit 4 3×3 numbers there (4×3=12 + 3 pixels as separators and you still have one spare column).

          Reply
  5. Dave

    Hey there I finally received all the parts from china to build it! woo. a few questions. I saw that in the pictures not all the components are populated. I get why some are not populated like the 3.3 v AMS1117 chip but why were there none on the q41-q44?
    In addition. i can find in the slices repository the place where you store the scad files for the laser cut pieces that you made similar to pibow, where are those located?
    many thanks

    Reply
    1. Xose Pérez Post author

      The board is meant to be used either with WS2812 strips or simpler 5050 strips where you just dim the RGBW channels. Those strips work at 12V. The transistors are there to drive those lines. The second regulator footprint is a AMS1117-5.0 to get 5V from those 12V.

      Reply

Leave a Reply (all comments are moderated, be patient)