This article is not directly related to the RevPi. I wrote it as a by-product of the DMX article. Since I have done some research on dimming LEDs, I would like to share my current – probably incomplete – state of knowledge on the subject.
What is the issue with dimming LEDs?
LEDs are dimmed by PWM. This is not very complex and saves energy. The basic requirement is that the frequency is sufficiently high so that you no longer perceive flickering. But, you might run into EMC problems. This is simply due to the fact that a PWM is a square-wave signal. Therefore the signal contains a large proportion of harmonics. These in turn can feed back into the grid or be emitted by the LED luminaire.
But what is so special about LEDs that I am writing an entire article to the subject? LEDs switch much faster than incandescent lamps. Furthermore LEDs are often used as long LED strips. Both may lead to unwanted effects.
The right frequeuncy to use
On the internet you can find various articles on the right frequency for dimming LEDs. In my opinion, many articles are written by “would-be professionals”. The quality of the statements in such articles may therefore be questioned. However, I was able to read out a consistent tendency of many articles regarding the PWM frequency to be used.
Many LED dimmers allow the PWM frequency to be set. Most sources recommend min. 500Hz and an upper limit in the low kHz range. The lower limit can be explained simply by the human eye, which can detect frequencies up to about 70Hz by flickering. In motion, even higher frequencies are perceived. The 500Hz, with a certain safety margin, therefore represents the frequency at which the human eye no longer perceive flickering.
PWM and EMC
I am not an EMC professional and would therefore like to reserve judgement, but I have had my (bad) experiences with dimmers, especially with dimmer switches in connection with guitar amplifiers.
Basically you can assume that the higher the frequency, the greater the risk that the LED lamp will act as an antenna. This should apply especially to the installation of long LED strips. So it makes sense to keep the frequency as low as possible for EMC reasons.
However, problems, e.g. with interference in the music system, can also occur below 500Hz. Impractically, the frequently recommended PWM frequency range lies exactly in the audible spectrum. If such effects occur, it is probably due to a mains feedback. Therefore, the first thing I would do is replace the transformer with another model. If effects still occur after the exchange, I would try to shorten the supply lines or use shielded lines.
PWM-dimmed LEDs during video shooting
If you shoot a video with dimmed LED lighting, e.g. with a mobile phone camera, the LED lighting can flicker in the video. This can be explained by the fact that LEDs switch very quickly and are therefore not permanently on as it looks to the human eye, but switch on and off with PWM frequency. The human eye is simply too slow to perceive flickering above a certain frequency.
A video sensor, however, may be much faster than the human eye. Since the PWM frequency is significantly higher than the repetition rate of the video, the video recording is technically an undersampling of the LED frequency. This results in so-called alias effects. If you are not familiar with this topic and would like to know exactly what it is, I recommend the Wikipedia article on the Nyquist theorem.
One solution would be to synchronise the PWM frequency exactly to the repetition rate of the video, which is rather impractical, at least for home use. The much simpler way is to increase the frequeuncy so that the flickering of the LEDs is faster than the video sensor.
This in turn speaks in favour of raising the PWM frequency. If you want to make slow motion recordings, you even need a higher PWM frequency, because the frame rate of the video is higher. Some PWM dimmers offer frequeuncies of up to a few 10 kHz especially for this purpose.
Effects can also occur in photos. Exposure times of 1/1000 s are common in the photo range. This means that the photo may be triggered at the exact moment when the PWM is in the “off state”. When taking photos, this can be avoided by increasing the exposure time.
The PWM frequency used is a compromise between EMC and possible flickering effects. You can probably only find out exactly which frequency is the right one through practical trials. As long as no problems become apparent, a PWM frequency of 500Hz seems a good choice to me.