Hello all I'm facing the good old common cathode and common anode issue.
Before you ask I'm not trying to create a circuit that outputs to an anode RGB led to light it up, its actually the reverse of that, I'm trying to obtain RGB color information by referencing the voltage output from a WS2812B anode only LED driver chip (they don't make common cathode version that I could find) so where the led is connected to the output of this driver chip I want to remove the led and try and tap into the 3 independent grounds
If anyone has some information on how to connect this without adding a tone of hardware, I would be forever grateful, It seems I always take on the most difficult road blocks when it comes to these sort of things.
Or if there is a better way to read the color of the last Ws2812B led as if the Arduino was the led driver chip receiving the information from the digital output of the last led that would be nice to but from what I've read that can't be done.
@Grumpy_Mike I summon you lol I've been reading a lot of similar topics regarding this what I think is the same problem that you've been a part of, How've you been?
You CAN measure it relative to ground (or relative to +5v).
If you have common anode, the LED is off when the output is 5V (no voltage "across" the LED) and it's on when the voltage is low enough (enough forward voltage across the LED) to turn it on.
The logic is reversed (+5V is off) and with an LED connected it doesn't go all the way to ground but the voltage is still ground referenced.
It's not an analog voltage, it's PWM, which is generated inside the WS2812 itself.
Of course if you are controlling the WS2812 with an Arduino, the Arduino already "knows" the state (color & brightness) of the LED.
yes as @DVDdoug says, you can measure the three PWM signals and work out the colour from that. The PWM on the WS2812 is quite slow so should be easy enough to decode.
Nice of you to ask, but not so good lately. At the start of May In had a stroke, most of me still works but my right hand is not working. I can grip stuff with it, like a car steering wheel, or a pint pot. But holding things like a knife, spoon or pen I can't do. My sense of touch in some fingers has turned into a sense of pain. I can't even open a zip lock bag. Still it is a lot better than it could have been.
I do understand that a common anode is always getting a plus 5 volts, and can understand now that the driver chip I'm referring to,
So it uses PWM to very the ground potential thus resulting in forward voltage that's the result am understanding this correctly?
but again, that varying voltage is relative to the output of the LED drivers three independent output grounds, I can't probe just one of the grounds and get three different voltages. I have to probe each individual ground with the common anode that would normally go to the RGB LED, I'd like to understand how to wire this to my Arduino, so that I may analyze and reproduce an output from the Arduino to a common cathode LED. Hence I bought the wrong ones in my fancy RGB switches.
Are you saying I would see a response if I connected the three ground wires that would normally go to an anode LED being driven from an external Arduino and driver chip to analog input pins of the second Arduino?
Addressable LEDs are neither controlled by voltage, nor Pulse-Width Modulation. They are controlled by a carrier signal. This 800kHz signal has a format that describes to the chip what each of the colors should be, what the brightness should be, and also what every LED in the chain downstream should be too.
(This is my original idea thinking I could just listen to the carrier signal from one of the last LEDs DO pin but found some lack of understanding reasons why this wouldn't work)
Dang Grumpy Mike. Are you pulling my leg or are you for real? You said it could have been worse? Just know I look up to you highly, to me you are like one of those of all and be all great grandfathers in all of this.
I would use three 220 ohm resistors in place of the LEDs.
That will create a 0.018A * 220 ohm = 4volt PWM signal across the resistors, which can be integrated with an RC filter and measured with three Arduino analogue pins, with the A/D referenced to 5volt (not ground). Downside is that it could be slow-ish.
RC could be 100n between 5volt and Arduino pin, and 10k between pin and WS output.
Or use three 470 ohm resistors, and measure the LOW pulse across each resistor with pulseIn().
This could be much faster than analogRead-ing integrated voltages.
Never done this, so you're experimenting on your own.
Leo..
@Grumpy_Mike. Sorry to hear that. Wish you a speedy recovery.
Sorry I should have posted this image in the beginning but it's the driver chip with everything else it needs for the LED resistors and cap as well,
I totally get that this is a dirty board. I had to dissect it out from an encapsulation of resin, I'll use some flux off to clean it up nicely but right now I'm just testing I'll have to look more closely to what you're saying. And it doesn't have to be super fast. It just needs to match the rest of the project which generally stays on solid colors for long durations.
Common reference is usually associated with GND or -V.
A common anode instead suggests a different association with just the anode.
Using a DVM you measure the voltages between the anode and the RGB legs. With the ADC and the anode and AREF on Vcc you get 1023 for zero voltage, and higher voltages (1023-x) with lower figures.
No not quite. PWM works by turning the LED on and off rapidly. The ratio of the on to off time is what controls the brightness. You can add a filter and turn the PWM into a DC level but you don't want to do that for an LED, it will spoil the linearity of the brightness.
So I found this, and will give it a try. I like to see how you guys would connect using your mentioned ways, I just have a hard time understanding for some reason.
Best of luck because I can't follow that diagram. It doesn't seem to make sense to me. Especially those diodes don't seem to be doing anything.
What is SV1 and SV2? And why are you inverting the signal between them?
You seem to think you have different grounds, you have not, there is only one ground.
That chip WS2811, has an input and an output for the 800KHz data signal. Leave that alone you can do nothing with it. This is because when the Arduino is generating this signal the interrupts are turned off, so there is no time to measure stuff.
Instead use the signals that the WS2811 generates for the three colours R, G & B.
In the absence of any actual LEDs then connect a resistor from each of the three outputs to your supply. As explained by @Wawa.
You can then connect the R, G, & B pins to separate input pins of the Arduino. Each pin will be going up and down with the PWM rate. You measure the time spent high and the time spent low to find the ratio of high to low. That represents the brightness of your LED, if you were to have one.
I question that to, but the user is inputting from the output of WS2811 driver which is 5v, and R G and B are if I understand are the PWM @Grumpy_Mike does that sound right? and should I change the title?
"Using 3 pnp transistors it inverts the R-, G- and B- to R+, G+ and B+.
In order to create ground for the led's I connected 3 rectifier diodes to R-, G- and B-.
I am very happy with the results of this circuit and the fact that I don't need an additional wire for ground to drive the common ground leds." bellow I responded to TomGeorge with the link to where I found it. I think in this situation there is more then one way to skin a cat.
If I can eliminate the need for the Arduino I pass on using it, just to keep my project simple.