Is addressable LED data stream (WS281X, etc) considered DC-Balanced????........ - Page 1
Forum section: electronics / projects

author: Smokey
author_rank: Super Contributor
timestamp: November 15, 2024, 09:27:47 pm
content: The data stream format for the WS2812 and similar addressable LEDs looks like this:Question:Since each bit transmitted consists of both a high and low with similar opposite timing for bit polarity, does this make the the bitstream effectively DC-Balanced? If so (and using appropriate drive circuits), can you directly send this through normal ethernet magnetics??

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 15, 2024, 10:01:04 pm
content: Well, no, it doesn't. That would require alternating 1's and 0's in the bitstream, at least sufficiently frequently, with an identical number of each on average, which can't be guaranteed as the bitstream just directly encodes R,G,B intensity as binary values. Just look at the worst cases where there are all 0's or all 1's.

author: Smokey
author_rank: Super Contributor
timestamp: November 15, 2024, 10:04:49 pm
content: The diagram shows that each bit of RGB data is indeed transmitted as alternating 1 and 0 (with different high and low times, but never long sections of just low or just high).If I wanted to transmit the RGB data byte of 0b11110000 (yes I know the full RGB data per LED is more bits than that), the voltage on that line would look like:HIGH(0.7us) - LOW(0.6us) - HIGH(0.7us) - LOW(0.6us) - HIGH(0.7us) - LOW(0.6us) - HIGH(0.7us) - LOW(0.6us) -HIGH(0.35us) - LOW(0.8us) - HIGH(0.35us) - LOW(0.8us) - HIGH(0.35us) - LOW(0.8us) - HIGH(0.35us) - LOW(0.8us)Lets say its all 0s for a while (which is still alternating but more unbalanced than a long string of 1s). Would the difference between HIGH and LOW timing, even through it's always alternating, cause balance issues?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: November 16, 2024, 12:07:54 am
content: Quote from: Smokey on November 15, 2024, 09:27:47 pmNot quite. They do have duty limits, but they are not DC=0 average as the data pattern is unknown.Quote from: Smokey on November 15, 2024, 09:27:47 pmThe 50us RESET is another problem, but you can get theedge informationacross a transformer, and if you feed that into a symmetric Schmitt trigger, the edges act like SET and /RESET pulses, and you can recover your LED data.

author: aeg
author_rank: Regular Contributor
timestamp: November 16, 2024, 04:18:15 am
content: Quote from: Smokey on November 15, 2024, 09:27:47 pmNo, it explicitly makes the bitstream DC imbalanced. If high and low have "opposite" timing then they have non-equal timing and it is not DC balanced.Quote from: SiliconWizard on November 15, 2024, 10:01:04 pmIt's worse than that. The 1 duty cycle is not the inverse of the 0 duty cycle. So not only are "1" and "0" individually not DC balanced, the sequence "10" is not DC balanced either.I'm not familiar with the WS2812 protocol but I wonder if you could put garbage bits after a command, ignored by the LED, to restore DC balance. Similar to the merge bits in compact disc EFM encoding. That might be fun, but instead, I would probably just manchester encode the commands and put a microcontroller at the receiving end to convert it to WS2812 format.

author: RoGeorge
author_rank: Super Contributor
timestamp: November 16, 2024, 04:59:54 am
content: It isn't balanced, but should be possible to send that through magnetics. If you look at the edges (the positive and the negative spikes after magnetics) it should be possible to restore the original signal.