- 1 x Electric Imp Developer Kit
- 4 x Adafruit 1.2-inch 8x8 Square LED Matrix plus Backpack
- 1x or 2x barrel jack
- 2x mini solder-less breadboards
The circuit shown is idealised. Power comes from the imp breakout board’s USB port (VIN). In practice, you will want to re-position the imp relative to the LED matrices, and I added to barrel jack power ports in parallel and positioned so that you can run a cable into the top of the clock or up to its base, depending on where you plan to site the clock. The jacks were wired directly to the GND and power rails, and from there to the imp board’s P+ and P- panels. The jumper on the board was adjusted accordingly.
If you use the laser-cut casing, make sure you first place the faceplate face down, fit the LED matrices into the cut-out correctly, and then use a glue gun to fill the gaps between the faceplate and the matrices’ circuitboards, which overhang the LEDs by approximately 5mm. This will hold them in place while you assemble the circuit — you can then slot LEDs into the board, add the side plates and finally glue on the backplate.
You’ll need to visit Electric Imp to sign up for a free developer account. You will be asked to confirm your email address.
Visit Electric Imp’s Getting Started Guide to learn how to configure your imp001 to access your local WiFi network, and how to enter code into impCentral and run it on your device.
The application code makes use of a number of components not all of which are included in the device and agent code listings. You can spot these external components by looking for the
#import statements by which they are referenced. You can use a tool like Squinter or impt to ‘compile’ these parts into complete device and agent code, and upload it to the Electric Imp impCloud™. Alternatively, you can simply copy and paste the contents of the files names in the
#import statements into the main code blocks, then copy and paste this code into impCentral™, Electric Imp’s online IDE.
Not all of the required components are included in this repository: they are not specific to this application. Only the files
HT16K33MatrixCustom.class.nut are included here. The other components can be found in these repositories:
The Matrix Clock device code is currently hardwired for UK usage: it adjusts to British Summer Time (BST) and back to Greenwich Mean Time (GMT) as appropriate. To do so, it makes use of my Utilities library and its bstCheck() function. This call can be replaced with the dstCheck() function if you wish to use a Matrix Clock in the US. This change will cause the clock to adjust to US Daylight Savings Time. The code can readily be adapted to match other territories’ daylight savings periods.
The Matrix Clock can be controlled by accessing its agent URL:
Version 2.1.0 introduces a new option: night mode. Using night mode, which is enabled or disabled through the web UI, the clock will power down its display overnight. This can be useful if you don't like the clock filling the room with light at night. Even with the LED brightness set to minimum, it will generate a lot of illumination in a darkened room. You may find this unappealing, especially if the clock is placed in a bedroom, and night mode allows you to deal with this without having to manually turn off the display at nighttime.
When you enable night mode in the UI, the clock turns off the display automatically at a time you specify. It then turns on the display at a subsequent time. You set these times — respectively, night start and end — in the UI using 24-hour clock values. The default values are: start 22:30, end 07:00.
You can still turn the clock display on (or off) during unlit (or lit) periods using the UIs ‘Turn Display On/Off’ button.
You can use the file
clock.svg to produce a simple laser-cut case/mounting frame for the Matrix Clock.
- 2.1.0 — 3 December 2018
- Add an option to automatically turn off the clock display overnight
- Add an option to switch display between black on green and green on black
- Improve UI layout
- Update matrix LED class
- Prep for 2.2.0
- 2.0.0 — 1 November 2018
- Update dependencies
- Restructure API to use JSON
- Improved Apple Watch Controller support
- Improved error handling
- Improved settings handling
- Improved web UI code
- 1.6.0 — 11 September 2018
- Add Advanced Settings area to UI and move Reset button into it
- Add Debug checkbox to Advanced Settings
- 1.5.0 — 7 June 2018
- Bring dependencies up to date
- Add support for world time display, including web UI controls
- Add favicon and iOS home page icon
- Add web UI controls
- Initial public release
The design and software for Matrix Clock are made available under the MIT Licence.
Copyright © 2016-2018, Tony Smith