Binary clock code for my 'Wooden Bits' project. The clock is designed for output to WS2812 LED matrices such as Adafruits NeoPixel or Pimoroni's Unicorn Hat. Code was developed for Arduino (bClock/) but I've ported to Raspberry Pi (raspberryPi/)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bClock
pcb/proteus
raspberryPi
.gitignore
LICENSE
README.md
binaryClock.scad

README.md

01000010 01101001 01101110 01100001 01110010 01111001  01000011 01101100 01101111 01100011 01101011
______ _                          _____ _            _    
| ___ (_)                        /  __ \ |          | |   
| |_/ /_ _ __   __ _ _ __ _   _  | /  \/ | ___   ___| | __
| ___ \ | '_ \ / _` | '__| | | | | |   | |/ _ \ / __| |/ /
| |_/ / | | | | (_| | |  | |_| | | \__/\ | (_) | (__|   < 
\____/|_|_| |_|\__,_|_|   \__, |  \____/_|\___/ \___|_|\_\
                           __/ |                          
                          |___/                           

Binary Clock

Wooden Bits

Originally made for Arduino controller in my Wooden Bits project, this is a binary clock for WS2812 LEDS that scales to any size pixel matrix. It includes a function for generating the 'snakes and ladders' arrangment of pixels, which can be used as a map reference for other functions.

Features

  • Version for Arduino/Atmega328 and Raspberry Pi.
  • Scales to any size WS2812 matrix.
  • Ability to rotate display.
  • Ability to set second indicator pulsing.
  • Quarter hour indicator fills n/quarter rows of the display blue (n is the quater multiple).
  • Full rainbow at midday and midnight.
  • setMatrix for sending any binary size to display; not just time.
  • initMatrixMap for creating lookup map of disaply.

For more details, see my blog post: http://wp.me/p2C0Bi-7R

Requirements

Hardware

  • Arduino/atmega328 or Raspberry Pi.
  • Pixel grid, user created or Adafruit NeoPixel, Pimoroni Unicorn Hat. Should be connected to pin 6 on Arduino or pin 18 on rPi by default.
  • For Arduino you'll need a DS1307RTC/DS3231RTC chip, already set with the time (see library page).

Arduino Libraries

Build

Arduino

Compile using the Arduino IDE or using the Makefile. Using the makefile reqruies 'Arduino.mk': https://github.com/sudar/Arduino-Makefile

Set the number of pixels in each row and column in 'bClock.h'. The clock will automatically scale the binary bits to the pixel grid - thanks to the pixelMap generation.

You can defined a flash on seconds 'pulse_second', rotated display 'rotate' and brightness

Raspberry Pi

Wooden Bits

Compile using make then run sudo ./bClock [brightness] [pulse_second] [rotate]. Designed for Raspberry Pi and Pimoroni Unicorn Hat but code can scale to any size matrix. pixelMap generator is useful for other functions other than this code.

Open SCAD

Compile within Open SCAD and export as .dxf. The comments explain how to export the various different layout options. The designs are supplied for personal use only under Creative Commons Attribution-NonCommercial 4.0 International License.

References

John Whittington @j_whittington http://www.jbrengineering.co.uk 2014

Attribution and License

Donate

Software is License: GPL v3

Hardware (KiCad, OpenSCAD, design exports etc.) is License: CC BY-SA 4.0

I make many of my projects Open Source so others can learn as I have, but please remember to follow the license terms and attribute any derivations or code reuse. You can do this by linking back to the project or jbrengineering.co.uk. Feel free to click the donate button above if you do use the source :).