A clock built using a Raspberry Pi, LED seven segment and dot matrix displays driven by MAX7219. The python code uses the excellent MAX7219 driver by Richard Hull https://github.com/rm-hull/max7219 and https://github.com/tadeck/onetimepass by Tom Jaskowski.
The code is simple and displays local/UTC time, and time-based one-time password for a 2-Step verification account.
Ensure that the SPI kernel driver is enabled:
pi@raspberrypi ~ $ dmesg | grep spi
[ 6.164368] bcm2708_spi 20204000.spi: master is unqueued, this is deprecated
[ 6.489381] bcm2708_spi 20204000.spi: SPI Controller at 0x20204000 (irq 80)
And that the devices are successfully installed in /dev:
pi@raspberrypi ~ $ ls -l /dev/spi*
crw-rw---T 1 root spi 153, 0 Dec 31 1969 /dev/spidev0.0
crw-rw---T 1 root spi 153, 1 Dec 31 1969 /dev/spidev0.1
Refer to http://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md if the devices do not appear before proceeding.
The breakout board has an two headers to allow daisy-chaining:
Board Pin | Name | Remarks | RPi Pin | RPi Function |
---|---|---|---|---|
1 | VCC | +5V Power | 2 | 5V0 |
2 | GND | Ground | 6 | GND |
3 | DIN | Data In | 19 | GPIO 10 (MOSI) |
4 | CS | Chip Select | 24 | GPIO 8 (SPI CS0) |
5 | CLK | Clock | 23 | GPIO 11 (SPI CLK) |
The case is designed in SketchUp. Printed at ShapeWays in White Strong & Flexible material and is available at http://shpws.me/Im4Y
Displays are sourced from ebay and below are some helpful searches:
- https://github.com/rm-hull/max7219
- https://github.com/tadeck/onetimepass
- http://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md
###Code Copyright 2015 Sharjeel Aziz (Shaji)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
###3D files
Dodecahedron Clock by Sharjeel Aziz (shaji) is licensed under a Creative Commons Attribution 4.0 International License.