Easy to Build
Reducing the electronic components to one RPi, the LEDs, and the wires between them allows you to concentrate on the form and design.
LEDs
Using standard LEDs with a maximum of 3.1 volts. Any color and shape you like.
The current to the LEDs is limited by the RPi to 2 mA per GPIO via software. Possible values are 2, 4, 8, 16 (higher than 4 is not recommended). The usual resistor in line of the LED is not needed!
Powering
The RPi can be powered over a Micro-USB cable. Use a mobile phone power supply (for USB) or a nearby PC/server with USB.
The typical current on the 5 volts line is about 100 mA with peaks up to 300 mA when WiFi fires.
Adaption
The clock is implemented in the Python file ~/piClock/bcd.py. It can be adapted to use a different pin to LED mapping, and 2 additional pins can be defined to extend the displayable hours to 24.
Upgrading
To use low voltage bulbs (5...24V), you can add 3 line driver ICs like the ULN2003 or ULN2803 directly to the RPi without a level shifter.
To use a pure binary display (6 LEDs for minutes/seconds) the python program can be easily adapted.
Pins for I²C, 1-Wire, serial and button are left free for additional IoT gadgets for e.g. temperature, humidity, luminosity, presence, notifications...
Feel free to implement a luminosity control (planned but not realized yet)
Decisions
Why RPi?
Pros:
- The RPi can use up to 26 GPIO pins directly without an additional port expander or shift register. Most smaller/cheaper controllers do not have enough pins to drive the 20 LEDs directly.
- The RPi has a built in current limiter on the GPIO pins. Resistors in line to LEDs are not necessary.
- The RPi Zero has onboard WiFi to get the correct time via NTP. No external RTC is needed.
- The RPi Zero has sufficient power and pins to run additional IoT features.
- Faster and easier development and code change.
Cons:
- Linux! Many steps to setup the controller. See chapter on GitHub Wiki...
- Linux! Potential security leaks to your local network.
- Over 30 sec. boot time.
- A little more expensive (about 20 Euro incl. MicroSD) than an ESP8266 (<7 Euro). Note also that an ESP8266 needs additional shift registers...
Why pigpio-lib?
Pros:
- This lib can handle software PWM for ALL 26 GPIOs without glitches.
- Faster than BCM-lib.
- Development and debugging can be done on your PC, remote-controlling the RPi GPIOs over the network.
- Implementation for several programming languages available.
Cons:
- pigpio-deamon eats 7...10 percent of CPU time continously, independent of how many GPIOs or PWMs are active.
- The lib's documentation leaves room for improvement.
Brilliant project, I have been looking for a while... Many thanks for sharing.