I friend of mine already uses some FT2-Chips (not only a chip a real PCB) from
from https://www.lighttoys.cz
He wants to remotely control a EL-wire. (Electro-Luminscence) The newer version of the so called "chip" The FT2-chip is designed to work with WS2812-RGB-leds. Hence the output sends out the WS2812-datastream not suitable for switching on/off EL-wires.
The FT1-chip is sold out. So one option would be to feed the WS2812-datastream of an FT2-chip in some kind of WS2812-receiver that does not control leds but controls digital IO-pins.
Does somebody know if such a WS2812-receiver does exist. I had no luck with googling so far.
Another option would be to use a single real WS2812 Neopixel and to combine the neopixel with a phototransistor or photodiode with matching wavelength sensitivy to visible light.
But this would be somehow cumbersome.
So you want to have the FT-2 pretend it's driving a WS2812 string that contains a only single Pixel? Then capture the WS2812 data stream and turn it into "digital outputs"? What do you mean by "digital outputs"? How many? How do you want to map the 256(R) x 256(G) x 256(B) possible different WS2812 colors into those "digital outputs"?
Hi StefanL38,
not sure, what is exactly intended. So far not fully understood.
But it should be a solvable problem to progamme any arduino to receive and interprete the WS2812 protocol and do what ever you want to do with this.
According to the data sheet, you do not need to receive any data back, making this a simple bit stream with specific timing restrictions. Based on this, I'll take a SWAG (Scientific Wild-Assumed Guess) and suggest that CMOS 54/74xx logic chips or buffers should work fine for your application.
More information on what you want to do will help us help you.
That's what I'm guessing. I'd look into capturing the WS2812 data with hardware using an ESP32 and it's RMT Peripheral. That will capture the high / low interval time of every pulse. Then the code can scan through the intervals and determine the 1 / 0 state of all 24 color bits.
Any kind of translation from whatever RGB-values to minimum 1 digital IO-channel to simply switch this IO-channel On/Off or as a maximum 16 IO-channels
As an example of the functionality:
WS2812 datastream sends red with full brightness and this switches on a single EL-wire
WS2812 datastream sends black red = 0, green = 0, blue = 0 and this switches off a single EL-wire
Of course a microcontroller can be used to analyse the datastream.
If there is a special chip that does receive the datastream the effort would be to buy such a chip and connect it to the WS2812-datawire - job done.
So maybe I should expand my question to
"does there exist a ready to use WS2812-receiver library ?"
Even a Nano can reliably capture, or send, WS2812 data. It's up to the programmer to manage the problem, the CPU is fast enough if you avoid monstrosities like digitalWrite() and digitalRead(), and prevent interrupts from making life difficult.
Exactly.
Capture the edge timings with interrupts and interprete the timings. Of course the different controllers have slightly different mechanisms for this. But should be possible with any controller.
That's why I suggested ESP32. It's RMT will capture the WS2812 stream in hardware without interrupts or intervention from the user code. It will then measure the high / low time of every pulse (again without user code intervention) and will then present the user code with a data structure of those intervals. The user code just scans through them. No need for interrupts or having the code poll the data line trying to measure the individual pulse widths:
I need to look at the RMT of the ESP32, sounds interesting. I did some time capturing with ATmega8, while probably any tiny would do the trick as well. A very small interupt routine is needed to capture the timing in a small buffer quite accurate, wich can be slowly digestet in the left time in between.
It's original purpose was to receive and transmit IR Remote protocols. It includes the option of modulating and demodulating with a carrier (eg 38KHz) as is done with IR Remote Controls. The WS2812 signal is analogous to a baseband version of this, so the carrier capability isn't needed.
So duty-cycle for a bit with value zero is 0.4 / 1.25) = 0.32
So duty-cycle for a bit with value oneis 0.85 / 1.25) = 0.63
So one way of detecting it could be
creating a datastream for many LEDs to make the 50µsec gap short compared to signaltrain
And then using a LOW-pass DAC with small values
to get a voltage 32% Vcc versus 63% Vcc feeded into a comparator with hysteresis that switches LOW/HIGH.
Just a technical concept. Not sure if this would work in practive.
@gfvalvo I understand the underlying concept of the ESP32 RMT internal hardware but I have zero knowledge about how to configure this ESP32-RMT-module make this RMT module deliver somehow a pair of values representing HIGH / LOW
Depends on the source - if they're constantly doing updates, sure, but otherwise, no dice. There's no requirement that the datastream be repetitive, the source can go about other business and only update the LEDs on change.
Anyway is there anything wrong with using a WS2811 ?
Those are 3 channels for you, returning a 1Khz PWM signal with open collectors.
If you want it to become a real switch it becomes a tile different i guess.
Hey look i am not that sure about that. Just counting the pulses is hard enough, i don't really think there is enough time to do any processing within the time a byte arrives. An ESP32 maybe an esp8266 but an AVR. i don't think so, but we can agree to disagree.
Yes, there is basically 2 parts to the protocol, the breaktime which resets to the first chip, (basically it resets all chips really)
and the duty-cycle. Actually the easiest way to capture would be to
Trigger an ISR on Rising,
Wait half of the duty cycle and measure the pinState
store the bit in the appropriate place
exit ISR
Optional the wait can be done using a timer interrupt and that may provide more background processing power.
Has to be tested with real thing if this FT2-module does repeat sending on itself.
If not it could be forced by programming a pattern inside the FT2-control-software that toggles a single bit
or
This FT2-module is intended to control standard WS2812 RGB-leds.
So the controlsoftware could be configured to have for example 16 leds.
And then programming a pattern that switches on all 16 LEDs for a short moment just one single time = single-flash or a double flash to have a signal to determine ON/OFF