ws2812
current system setup
2 fbsd machines, networked using cat5. one amd64, one allwinner h3. embedded one is nanopi neo core on my custom pcb with poe splitter and usb wifi. poe splitter is wired in a hack way so it provides ethernet transformer. almost like nanopi neo pcb. armv7 runs current
current test string is 200 leds. it was usb powered and has it's own pissy ble controller which has useless programs and bad fade. and it limits the leds to what usb and thin wire can do
i updated it, it's now incredibly bright. seems like they used full power leds. just skimped on wiring. those are wires that you can break if not careful, definitely not for power bus. if i turn it to 100% rgb white. it self limits current to like 2a. other end is 2v and red. i'm surprised ws2812 survives that intact and working
i don't know which ic is in mine. bit order is forward and color order is rgb
i added 1mm monofilament to the center of string to pull it up from. string is loosely wrapped around it. not twisting wire itself, just like how it feels like to go. the wires nor leds carry load. 10cm seems too many leds so i need 20cm pitch but i lost my first 1k set of 5v 20cm 0.5mm2 ones in china for year 2025 display
power and data is made of lenovo 65w laptop psu, 20v. using 1:1 opposite ended noname wagos. some wagos make up makeshift 5a glass axial fuse holders
power goes from this via 2*0.75mm2 / "0.75mm2" cable (? :p) to 5 mp1584en dcdc's. they are actually underrated for currents here. esp. the middle ones. 5v from them goes to 5 points in string in parallel, every 50 leds. while bad practice, this works. i don't have scope so no idea if it rings. string itself is resistive enough. power draw is like 2.2a so 45w
20v distribution is 3 10m 2*0.75mm2 in middle and 2 2*10m 2*0.75mm2 in ends
one end feeds sbc power badly from the low loaded 5v output via 10m 2*0.75mm2 cable
ideally this needs 230v mains direct to 5v. or at minimum shorter dc upstream wiring. the draw is massive. it's high enough to justify direct power
data is fed from spi mosi to "spi amplifier", actually some 7400 series buffer probably, which levelshifts it from 3.3v gpio to 5v. it's then fed to 2 max485 + buffer boards and then into leds. one is right next to leds, other near sbc, connected with 10m 2*0.75mm2 cable
as i don't have working hot air nor transparent glue lined heatshrinks yet, i wrapped it all in kapton (ehm, "koptan" (!!!)) tape. while observing potential anti water electrolysis separation. parts of system i wrapped in reused packing film, while others got inside bucket under a tub with rock / concrete slab, lid, tire, whatever on top. i'm huge fan of reusing items like that
i only use natural trees and bushes for leds as i have many in my garden. it's filled with them
for code i skipped all that arduino, avr, fastled, esp, wled, wifi, etc. on purpose! instead i chose fbsd, perl, shell, ssh, (patched) spi(8) in c. and a spi bus directly. felt much better and sane. it generates requires waveforms using 3m spi bus, it's ^t has output like
-----------------------------------------------------------------
/root/files/ws2812/spi.pl loop,bin
real uid = 1013, real gid = 1013 1013 47
effective uid = 1013, effective gid = 1013 1013 47
AnyEvent::MODEL = AnyEvent::Impl::EV
led count = 200, type = forward/rgb, data rate = 800k
gamma = 1, correction factor = 2.8
autofps = 123, fps = 123
dynamic fps = ~ 10.000
measured fps = 10, fps diff = 113
frames = 22475
stdin anim = 0, server anim = 0, server rgb = 0
server colors = 0 0 0
anim = 23, anim time = 100 ms, rand anim = 1
start anims = 29
rand anim list = 10 12 13 14 21 23 27 33 34
descr =
blue / yellow end to end bounce
raw spi output = 2012 byte/frame, 20120 byte/s
161k bit/s (base 1000)
uptime = 28 minutes and 28 seconds
conn count = 2, conns = 2
-----------------------------------------------------------------
additionally, i looked deeper into dmx and it's cousins and reaiized it's awesome unified universal old legacy stage solution but it would limits me with fps, amounts, etc. even dmx ip solutions like artnet are as if piggypacked on. or it's like lipstick on a pig. ohm2013 did use it. supposedly it has no limits but meh. i even asked bob & dudes why. told it was enough, no wheel reinventing needed. but i was like wait a sec. in fact other, both open and close guys have made their own proto that's more suitable for fast color data. this is of course joke compared to real screens but fast enough. faster than dmx. and it seems like i could get away with perl here. people might say interpreted language is not a display driver and if i set it to real high strobes i can see it jittering. i mean rates high enough that it as if pwm dims the led down. actually at super high rates, i didn't see anything anymore at all. except slight perception or expectation that it's not solid color. we are way past visible here. this means it's fast for and outdoor christmas lights in the garden
example of max perf test on 1 c2d core (100% cpu, as fast as it goes)
@ 1766998867 = 3000 leds, 144 fps @ 1766998868 = 3000 leds, 140 fps @ 1766998869 = 3000 leds, 158 fps @ 1766998870 = 3000 leds, 159 fps @ 1766998871 = 3000 leds, 160 fps
some animations it runs
number description
-----------------------------------------------------------------
0 -> all off / black
1 -> color fade
2 -> all white
3 -> red / green slow swap
4 -> blue / yellow slow swap
5 -> red fade
6 -> yellow fade
7 -> blue strobe
8 -> faster white flash every so often
9 -> slower white flash every so often
10 -> few color blinks
11 -> one led color chase
12 -> one led end to end bounce
13 -> kitt scanner
14 -> somewhat slow color fill / change on all leds
15 -> all red
16 -> all green
17 -> all blue
18 -> white end to end bounce
19 -> all yellow
20 -> warm white
21 -> rainbow end to end bounce
22 -> all fast color blinks
23 -> blue / yellow end to end bounce
24 -> green fade
25 -> white fade
26 -> all red / green, odd / even alternating
27 -> color sweep
28 -> static random colors
29 -> static random red / green mix
30 -> static random red / green / 50% blue mix
31 -> all cyan
32 -> all magenta
33 -> blue / black / white end to end bounce
34 -> random color bar end to end bounce
35 -> server direct rgb control
more things are documented as comments in a code
photos
http://ketas.si.pri.ee/photos/ws2812-2025/
videos
http://ketas.si.pri.ee/videos/ws2812/
code
http://ketas.si.pri.ee/misc/ws2812/
documentation started @ 2025-12-28 11:04:04 +0200
who: sulev-madis silber, ketas in irc