
Desklight
dpiegdon/tiny-ws2812-desklight
ATTiny10 powered WS2812 RGB LED strip: hard- and firmware design

ATTiny10 powered WS2812 RGB LED strip: hard- and firmware design
Desklight panel is an open-source printed circuit board by dpiegdon, from the dpiegdon/tiny-ws2812-desklight repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 100 × 100 mm with 256 parts on 10 nets, routed with 928 tracks and 32 vias.
It is built around the ATTINY10-TSH. Its parts include 64 capacitors, 48 resistors, 48 connectors, 16 ICs and 16 switches. It belongs with the lEDs and displays boards and the AVR (ATmega, ATtiny) boards of this library.
Controller firmware and hardware for a very simple desklight that has a button and a digital encoder for color/brightness selection.
Controls a strip of WS2812 RGB LEDs which could e.g. be mounted at the bottom edge of your desktop monitor facing down towards the desk surface.

(Above: bottom side of v1.0 PCB)
David R. Piegdon dgit@piegdon.de
All files in this repository are released unter the GNU General Public License Version 3 or later. This includes the schematic, the routed PCB and the firmware as well as the documentation and accompanying materials. See the file COPYING for more information.
The rotary encoder has a button and can be rotated in both directions. The button cycles through different modes. In each mode you change a different variable by rotating the encoder:
Mode 1: change brightness
Mode 2: change color
Mode 3: change number of enabled LEDs
Mode 4: change starting position of enabled LEDs
Pressing the button for more than half a second resets all values to their defaults.
You probably have to use a recent AVR-GCC Version for compilation. Version 5.4.0 is good, 7.3.0 yields even better results. As the ATTiny10 is very space-constrained, older gcc versions may not optimize well enough to meet the space-constrains with the current feature set.
If you want to change the number of lights in the firmware, please do so in
ws2812.h. If you know what you are doing, you can also change the assignment
to light_count in the firmware files (in ws2812_init(), calca_init(), if
you don't want to recompile.)
Note that with the current master branch firmware you can use up to 126
LEDs. The actual constraint is something like lightcount <= max_value(int8_t)-1.
Supports four modes (brightness/color/enable-count/start-pos), should support 63 LEDs. Required GCC 7.3.0 or similar to fit size-constraints.
Improved binary size. Now supports building with GCC 5.4.0.
Support up to 126 LEDs.
Fixed rotary dial directions to be consistent across modes.
Fixed WS2812 timings to properly work with all LEDs. Allow LIGHT_COUNT to be
overriden via CXXFLAGS.
(no more changes)
You can find a Kicad-based schematic in the hardware directory.
The firmware is written for an Atmel ATTiny10. The latest version does not use the ADC anymore, so an ATTiny9 should do fine, too.
Connect a 5V 1500mA (or better 2000mA) power supply for a strip with 34 LEDs.
Version 1.0 of hardware is fully functional and works perfectly fine. However, a few changes might be useful when doing another revision:
Schematic: Remove comment on questionable 1K resistor value. 1K resistors between uC and encoder are ok. Comment in schematic was already removed shortly after tag v1.0, as already can be seen in released PDF schematic of v1.0.
Schematic/BOM: Create a BOM. Well, maybe just specify the kind of rotary encoder. (Look for EC11 digital encoder on your favourite cheap chinese parts supplier)
PCB: Increase drill size for power lines on P2 and P3, so power cables can be soldered directly to PCB easily.
PCB: Mark RESET pin of TPI so it can be found easily when re-flashing a uC.
PCB: Mark TPI interface as "TPI".
| Qty | Value | Footprint | References |
|---|---|---|---|
| 48 | 1k | Resistors_SMD:R_0603_HandSoldering | R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1, R1 +32 |
| 48 | C | Capacitors_SMD:C_0603_HandSoldering | C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1, C1 +32 |
| 16 | 100n | Capacitors_SMD:C_0603_HandSoldering | C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4, C4 |
| 16 | ATTINY10-TS | TO_SOT_Packages_SMD:SOT-23-6_Handsoldering | IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1, IC1 |
| 16 | AVR_TPI | Pin_Headers:Pin_Header_Straight_2x03_Pitch2.54mm | P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1, P1 |
| 16 | Pwr5V1500mA | Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm | P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2, P2 |
| 16 | Rotary_Encoder_Switch | projectspecifics:Encoder_PEC11R | SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1, SW1 |
| 16 | WS2812_CON | Pin_Headers:Pin_Header_Straight_1x03_Pitch2.54mm | P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3, P3 |
The 192 most common of 256 parts.

dpiegdon/tiny-ws2812-desklight
ATTiny10 powered WS2812 RGB LED strip: hard- and firmware design

valerionew/very-good-uc-doggos
A special graduation present for a special friend. Six microcontrollers in one devboard





yvoronkin/FANSTOP
In a small form factor, an extension of the fan control is implemented.


It measures 100 × 100 mm and has 2 copper layers, 1.6 mm thick.
256 parts, built around the ATTINY10-TSH. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the dpiegdon/tiny-ws2812-desklight repository on GitHub, at the commit this page was made from: the board is hardware/desklight_panel.kicad_pcb and its schematic hardware/desklight.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).