Hi, possibly a dumb question, but when dimming a (RGBW) ws2812b, does it do it by PWM? And if so, with what frequency?
What i mean is, when sending e.g. brightness 50 to one led in the chain, how does it dim - does it do "internal pwm:ing", or does it get a pwm signal from the arduino like when dimming a single "normal" led directly (guessing not), or how does it dim?
I am building a sunrise gadget, and would need a flicker-free solution (not just visibly flicker free, but actually flicker-free, on higher frequencies than the human eye can see). My thought was to use a 93 led ws2812b ring(s), and turn on pure white leds, one by one (full power, not dimmed), thus making a "sunrise fade", from one full on to 93 full on.
But started
a) doubting if there is still some pwm cycle even when "full brightness" is sent to the led, and then
b) what if i add a bit yellow in the start anyhow - but that would add a less than full powered rgb blend, i.e. pwm if it uses pwm, it would add flicker to the light anyhow.
I would really appreciate if anyone knows how the dimming workings on a ws2812b RGBW led, Could not get it from the datasheet, but Im no rocket scientist, so..
cwikstro:
Hi, possibly a dumb question, but when dimming a (RGBW) ws2812b, does it do it by PWM? And if so, with what frequency?
That is the only practical way to perform dimming.
Apparently around 600 Hz PWM cycle. IIRC.
cwikstro:
doubting if there is still some pwm cycle even when "full brightness" is sent to the led, and then
Good question. Not sure. If the counter used to generate PWM counts to 256, then a PWM of zero is off and a PWM of 255 will miss one count each cycle and will flicker off for a moment.
Whether they arrange the counters instead to count to 255 I do not know.
Well as the flicker response of a human eye is about 30 Hz then you will not see them flicker anyway.
You can detect if they are flickering by using the Stroboscope effect. Illuminate an area with the LEDs and wave an object about. If you see a blur then the light is not flickering, if you see individual multiple images it is flickering.
A normal domestic florescent light flickers at 100 or 120 Hz depending on your countries mains frequency. Do you see that flickering? But you can spot it is with the above test.
Grumpy_Mike:
the flicker response of a human eye is about 30 Hz
I suspect it depends which part of the eye you are talking about. I think at the centre of the retina, the most sense part, where there are mostly "cone" cells that detect colour, the flicker response is lowest. But in your peripheral vision away from the centre of the retina, where there are mostly "rod" cells, I wonder if the flicker response is higher?
Anyway, I've always found it very easy to tell if a light source is pwm modulated: RGB LEDs, car rear (tail) lights, brake lights etc. Keeping your head still, just flick your eyes left-right or up-down and if you see a line of dots or dashes, you can know instantly that it is pwm modulated. I don't think this technique will work if the pwm frequency is in the KHz range, of course!
I have some led filament bulbs at home, and I suspect they flicker at 50Hz (there's no rectifier or other circuit in the base of the bulbs). I don't find their light very pleasant.
There is a way to dim LEDs without pwm. It's called a programmable constant current circuit. They don't tend to have a high resolution, perhaps 8 or 16, maybe 32 levels. I suspect a circuit like that for 256 levels would be quite complex compared to a pwm circuit.
Well in the cinema the frame rate of 24 frames a second is multiplied by three by a shutter so each frame gets flashed three times giving a total 72 flashes per second. While they call them the "the flicks" I can't say I have ever noticed even peripheral vision flickering.
I've always found it very easy to tell if a light source is pwm modulated: RGB LEDs, car rear (tail) lights,....
Yes, that is the stroboscopic effect, rather than seeing any flicker.
Seeing, noticing, detecting, maybe semantics.
I had a job at a place where the company had sodium or mercury vapor lamps (or some such) on the 40' ceiling.
They were horrible. I could tell there was something going on with them and I'd see these blue and red blinks, more so as they aged, on documentation (prints) that nobody else could "see".
Maybe some are more sensitive to these phenomena than others.
That is the only practical way to perform dimming.
Apparently around 600 Hz PWM cycle. IIRC.
Good question. Not sure. If the counter used to generate PWM counts to 256, then a PWM of zero is off and a PWM of 255 will miss one count each cycle and will flicker off for a moment.
Whether they arrange the counters instead to count to 255 I do not know.
Thanks Paul
yes, in most cases - but that does involve flicker i need to avoid unless going up to high Khz range. But I have understood there is also another way, by current, just dont know how.
PaulRB:
There is a way to dim LEDs without pwm. It's called a programmable constant current circuit. They don't tend to have a high resolution, perhaps 8 or 16, maybe 32 levels. I suspect a circuit like that for 256 levels would be quite complex compared to a pwm circuit.
Thank you again, Paul, that is possibly the thing I'm looking for. I dont have a need for 256 levels, as i use both levels and number of leds. But, presumably finding individually addressable leds with that may be.. interesting. So multiplexing may be next, or something..
On a side note - I know that there are now since a few years back led lights used in the film production industry, that are dimmable, and RGB-able, but cant find any information on how they bypass the flicker, or get it to so high frequencies that it does not show on ultra high framerates, like all "mere mortal solutions" tend to do Or if they in some very clever way flicker exactly in counter-rhythm in pairs, trios or something. However, the panels i have seen dont seem to have the amount of single leds i would imagine that would need..
cwikstro:
On a side note - I know that there are now since a few years back led lights used in the film production industry, that are dimmable, and RGB-able, but cant find any information on how they bypass the flicker, or get it to so high frequencies that it does not show on ultra high framerates, like all "mere mortal solutions" tend to do Or if they in some very clever way flicker exactly in counter-rhythm in pairs, trios or something. However, the panels i have seen dont seem to have the amount of single leds i would imagine that would need..
It is not that hard to design a adjustable constant current source for LED regulation. It is more complicated that a PWM regulation, but for a high end light it is not really significant.
You could also increase the PWM frequency (A couple of kHz is easy enough), that would work for 24 frames/sec (24Hz) and make it invisible for most purposes, but would fail for some slow motion.
I think we deserve an explanation of a "sunrise gadget" and why the flicker is of any significance at all.
The WS2812 - and all similar - use PWM and incorporate constant current control. If they do not suit, then you clearly cannot use them in any way.
There are two factors here. To remove the flicker from the PWM, you use a series inductor/ parallel capacitor "low pass" filter. At higher frequencies, the values of these two parts can be quite small.
To achieve the second part, current control, you would either use a resistor for lower powers - perhaps up to one watt - or for more substantial powers, a switchmode current regulator which in fact contains the above inductor and possibly capacitor because it uses PWM to control the current. These are readily available in a form which accepts a PWM control input but of course are a complete assembly controlling one luminaire each at a modest unit cost.
So if you wish to move forward, what is it you actually want to do?
cwikstro:
Thank you again, Paul, that is possibly the thing I'm looking for. I dont have a need for 256 levels, as i use both levels and number of leds. But, presumably finding individually addressable leds with that may be.. interesting. So multiplexing may be next, or something..
SK9822 LEDs are individually addressable and use a programmable constant current circuit for brightness control and PWM for colour control. But brightness control is only 5-bit resolution (32 levels) and you can't control the colour without using PWM, so you are stuck with "white" however that comes.
PaulRB: SK9822 LEDs are individually addressable and use a programmable constant current circuit for brightness control and PWM for colour control. But brightness control is only 5-bit resolution (32 levels) and you can't control the colour without using PWM, so you are stuck with "white" however that comes.
Brilliant, thanks a milllion PaulRB! I have googled this hundreds of times, without finding a solution!
With some 40-60 white leds coming on one by one, and 32 levels each, its going to be better than i dared hope for. I may throw in some yellow leds (white with yellow coloring) to add a colors shading.
cwikstro:
I may throw in some yellow leds (white with yellow coloring) to add a colors shading.
You might not have to do that. You could make some of the leds yellow in software, by setting the blue channel to zero. Hopefully, the PWM colour control works such that 0 and 100% (255) on a channel are effectively completely off or completely on, with no flicker.
I think we deserve an explanation of a "sunrise gadget" and why the flicker is of any significance at all.
To achieve the second part, current control, you would either use a resistor for lower powers - perhaps up to one watt - or for more substantial powers, a switchmode current regulator which in fact contains the above inductor and possibly capacitor because it uses PWM to control the current.
Thanks Paul__B
Sure, theres actually two separate projects I'm working on - one is a sunrise/sunset light controller for a friends birds and reptilian club. Birds have a much faster framerate, up to possibly some 150 flicks, reptiles' apparently are not as well known, and some insects have up to 300 - however the club wants rates to be well over any possible "flicker risk factor". (Apparently there has been research on the negative impact of pwm (for human speeds) controlled lights on animals). The other project is lighting for slow-mo filming, which needs something in the range of 20+ khz to my understanding.
im not an enemy of pwm as control, i just want to avoid any flickering of the light. Il'll try to find out more about "switchmode current regulator".
PaulRB:
Hopefully, the PWM colour control works such that 0 and 100% (255) on a channel are effectively completely off or completely on.
Good thinking, if the "completely on" actuall is completely on (then again, i assume the situatuion is actually the same for the white, anyhow).. i wonder how that could be tested..
To probe the SK9822 LED driver, I mounted a photodiode in front of one LED and connected it to an oscilloscope. This allowed me to directly monitor the modulation scheme of the LEDs.