Which PWM module?

TL;DR: I want to PWM-dim RGB LED strips with MOSFETs and COB-LEDs with CC-drivers that take PWM as an input. Adafruit offers 2 types of PWM IC breakouts - one for LEDs (though I think this reads as "directly drive LEDs") and one for servos. Which one do I need?

I am planning to drive the lights in one room over MQTT, using an ESP8266 (probably in the form of a Wemos D1 Mini).

The lighting will consist of

  • 4 ~4m long RGB strips for indirect lighting at all 4 walls, which I want to control individually like this:
    Usage | RGB LED Strips | Adafruit Learning System
    I will probably use https://www.amazon.de/Netzteil-Laufwerke-Lichtschläuche-LED-Strips-geeignet/dp/B006Z9TQE6/ for powering (and limit the full brightness of the strips a little, since they add up to a little more than 120w at full power). I expect less brightness usually, though, so I am not quite happy with the low-load efficiency of that thing ...

  • 8 5W cob led spots with 300mA current draw like
    these (I like those because I can change the cob led if it brakes - it is just attached with thermal paste and pressed down). I will drive these in groups of 2 (i.e. 4 groups overall).
    I found the LDB-300L as a constant current driver (@300mA) that accepts PWM for dimming and would power them with this
    ULL power supply or the PLC-45-12 as voltage sources (both @12V, since this gives the best efficiency according to the datasheet of the CC driver).

So much for the setup. I appreciate suggestions. The main question is, though: I need a lot of PWM for this. 12 channels for the RGB strips and about 4 for the spots. Adafruit has this
Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface [PCA9685] : ID 815 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits and this
Adafruit 24-Channel 12-bit PWM LED Driver - SPI Interface [TLC5947] : ID 1429 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits

I am not sure if I understand all the differences. The latter one is constant current, so I would rather like the first one? Or don't I? I2C or SPI shouldn't matter, the ESP should be able to deal with both.

Edit: Earlier, I had this paragraph for the spot lighting. I did a little bit more research and found the solution stated above, which suits my needs a lot better. My main question does not change by that, and I keep this here for completeness:

  • 10 3W cob led spots with 300mA current draw [as above]. I will drive these in groups of probably 2-3 (but in at least 2 group).
    I found the LDD-300L as a constant current driver (@300mA) that accepts PWM for dimming and would power them with the
    LPV-35-36 as a voltage source (@36V).

So many questions in one post. Some answers.
The 16-channel PCA9685 can certainly drive CC LED drivers, and logic level mosfets for LED strips.
I use several PCA9685 boards 24/7 in my home lighting setup.
Cable length for I2C control is more forgiving than SPI control (other chip).
Don't know that 24-channel chip, but is seems more for close/direct small LED control.

A 36volt supply for a 36volt max CC LED driver seems not wise.
I stick to 24volt supplies, and mod my downlights to suit.

A 5watt/300mA COB LED has usually five 1watt LEDs in series. 5x 3.3volt = 16.5volt working voltage.
A 24volt supply would be more efficient (for the CC driver) than a 36volt supply.
A 6-string COB (Vf ~19.8volt) is the practical maximum on a 24volt supply.
Leo..

Picture of a home-grown PCA9685 board with 16 onboard constant current LED drivers.

The TLC5947 is a constant current driver where the PCA9685 is just a voltage output. And you want to control CC drivers that will take a PWM voltage, you need the PCA9685. It's pretty cheap on eBay.

You could convert the TLC5947 but that's more work.

And note, the 3W 300mA cobs need around 10V (10V x 300mA = 3W). 3 in series need around 30V. So that's the max to drive from 1 driver at 36V.

And about the led strips, the "normal" 5050 RGB 60led/m strips use around 12W per meter. 4 x 4 x 12W = 192W which is quite a bit more then the 120W....

And to comment on Wawa, although I2C might be more forgiving then SPI they are both not designed for length. They are designed for chip to chip connections so I would keed the wires less then 1m. I also doubt there is a real difference between SPI and I2C as long as you keep the SPI speed as low as the I2C speed...

septillion:
And to comment on Wawa, although I2C might be more forgiving then SPI they are both not designed for length. They are designed for chip to chip connections so I would keed the wires less then 1m. I also doubt there is a real difference between SPI and I2C as long as you keep the SPI speed as low as the I2C speed...

The PCA9685 uses the higher current version of normal I2C. FM+
I am running two PCA9685 boards ~6meters away from a Mega.
Cat-6 in between. Clock and data on separate pairs (shared with ground).
Standard speed. Running 24/7 without any hickups.
Leo..

Wawa:
So many questions in one post. Some answers.

Well, technically, it was just a full description of the setup. Doesn't always everybody say that you should make the problem clear that you want to solve? :slight_smile:

The 16-channel PCA9685 can certainly drive CC LED drivers, and logic level mosfets for LED strips.
I use several PCA9685 boards 24/7 in my home lighting setup.
Cable length for I2C control is more forgiving than SPI control (other chip).
Don't know that 24-channel chip, but is seems more for close/direct small LED control.

Thanks, that is what I expected. What through me off a little bit is that the 24-channel chip with apparently "more" functionality (CC driver) is cheaper per channel.

A 36volt supply for a 36volt max CC LED driver seems not wise.
I stick to 24volt supplies, and mod my downlights to suit.

I don't quite understand that. The LDD is a pure step-down converter. The voltage drop seems to be about 4V (max. Input 36V, max Output@300mA 32V). A 36V supply seems to be the only way to get 30V out of there. Or is your point that I shouldn't use a driver that is specified for up to 36V at 30V, but should leave more tolerance?

A 5watt/300mA COB LED has usually five 1watt LEDs in series. 5x 3.3volt = 16.5volt working voltage.
A 24volt supply would be more efficient (for the CC driver) than a 36volt supply.
A 6-string COB (Vf ~19.8volt) is the practical maximum on a 24volt supply.

You seem to be mixing 2 setups here (or did I? But it seems fine). I do not want to drive 25W with the step-down-CC driver and 36V. That is for 33W = 30V.
For the 2*5W, that I indeed measured to about 16.5V, I suggested the LDB buck-boost-CC driver with a 12V supply, since 12V gives the best efficiency over a wide range of loads, according to the datasheet. It also allows me to use relatively cheap and efficient supplies - at least, the choice seems to be much larger than for 36V.

And about the led strips, the "normal" 5050 RGB 60led/m strips use around 12W per meter. 4 x 4 x 12W = 192W which is quite a bit more then the 120W....

That is a good hint. I looked only at some Aliexpress page that talked about around 9W.
The issue about all of this stuff is: I will most probably use all of this considerably dimmed down. The room is a bedroom.
For the RGB strip I will not want to blast 192W against my wall for ambient lighting, but I DO want to cover the wall, and 12W/m is just how they come.
For the spots, I will mostly use cosy lighting, but of course will want to have the opportunity to make it bright for cleaning, searching for stuff and so on.

I think the spots are fine. The Strips are an issue, though. Even if I limit the mount of dimming software-wise, it is dimmed via PWM, so I will still draw full power for fractions of the time. Installing a 200W supply will run the strip in a seriously inefficient range, unfortunately ...
Anyone any idea? How about I install a 1mF 80V capacitor at each MOSFET? With 1kHz PWM dimming, this would easily buffer the increased current draw in the duty cycle, if I calculate correctly. Then I could limit the duty cycle by software.

And to comment on Wawa, although I2C might be more forgiving then SPI they are both not designed for length. They are designed for chip to chip connections so I would keed the wires less then 1m. I also doubt there is a real difference between SPI and I2C as long as you keep the SPI speed as low as the I2C speed...

Thanks for the consideration. I will set up a star topology where ESP, MOSFETs and CC drivers are in the center and then use 1,5mm^2 installation cable to get to the corners.

ElCaron:
I don't quite understand that.

What he means is, you are using that driver right on the edge. If you're power supply outputs a halve a volt more, 36,5V, you are completely out of spec for the driver.

ElCaron:
For the RGB strip I will not want to blast 192W against my wall for ambient lighting, but I DO want to cover the wall, and 12W/m is just how they come.

If you are 100% sure you never ever turn them on 100% then it's probably okay. But not 100 sure because it depends on the switching frequency of the power supply en the amount of buffering. Adding more (low ESR) capacitors may help to spread the load.

And if you really never want full brightness you can turn the voltage down a bit. Some power supplies let you tune the voltage. A small change in voltage already has a significant change in current. And yeah, at exactly 12V the strips will probably already run a bit lower then 12W/m. Keep in mind the red dims differently to voltage changes then green and blue.

ElCaron:
For the spots, I will mostly use cosy lighting, but of course will want to have the opportunity to make it bright for cleaning, searching for stuff and so on.

Does not really matter. 4 spots is series need 4 x 10V = 40V so you can't drive with 36V.

ElCaron:
How about I install a 1mF 80V capacitor at each MOSFET?

Don't do it after the mosfet, that will not work. But indeed, adding a capacitor in front (or a couple) will help. Take low ESR ones so they will work better with PWM and switch mode. 16V or 25V is already big enough.

ElCaron:
With 1kHz PWM dimming,

If you can, go higher. Motion under 1kHz, especially low duty cycle, will show pasterns.

septillion:
If you can, go higher. Motion under 1kHz, especially low duty cycle, will show pasterns.

Please calculate the pulse width with a value of 1 from the 12-bit PCA9685 at 200Hz PWM.
You are most likely already over the limit of the maximum frequency of a CC LED driver (50kHz).

In simple terms, with 1kHz PWM you can't dim low enough. With 200Hz PWM you can.
200Hz PWM does NOT flicker. At least not in my 20+ downlight setup.
Leo..

200Hz does indeed not flicker but is VERY visible when you watch motion under it. If made a dimmer @ 244Hz and static it looks great but motion like running water is just annoying. But I'm still to lazy to crack open the box and reprogram the micro....

septillion:
What he means is, you are using that driver right on the edge. If you're power supply outputs a halve a volt more, 36,5V, you are completely out of spec for the driver.
[...]
Does not really matter. 4 spots is series need 4 x 10V = 40V so you can't drive with 36V.

That is true. Good thing I am not going for that setup :slight_smile: The buck/boost driver with 12V supply should do it though. 2*5W will require around 33V, which is away from the maximum of 40V, while being on almost top efficiency.
I also don't think I ever wanted to drive 4 3W spots with one driver. If that is written somewhere, that is a typo :slight_smile: The text this refered to was the reason why I don't just install less bright spots.

septillion:
If you are 100% sure you never ever turn them on 100% then it's probably okay. But not 100 sure because it depends on the switching frequency of the power supply en the amount of buffering. Adding more (low ESR) capacitors may help to spread the load.

And if you really never want full brightness you can turn the voltage down a bit. Some power supplies let you tune the voltage. A small change in voltage already has a significant change in current. And yeah, at exactly 12V the strips will probably already run a bit lower then 12W/m. Keep in mind the red dims differently to voltage changes then green and blue.

This strongly converges into the parallel discussion from an originally quite different question for the same project which I posted here: Efficiencies of power supplies with PWM - General Electronics - Arduino Forum
Grumpy_mike also suggested a capacitor, but in #16 I think I calculated that I would need one >>1mF to make sense at 1kHz. He never followed up, though.
I would appreciate your input there. Unfortunately, the discussion seems to have gotten slightly edgy since there are a few different opinions, apparently.

Don't do it after the mosfet, that will not work. But indeed, adding a capacitor in front (or a couple) will help. Take low ESR ones so they will work better with PWM and switch mode. 16V or 25V is already big enough.
If you can, go higher. Motion under 1kHz, especially low duty cycle, will show pasterns.

Thanks, also to Wawa, for those hints. I don't quite understand this:

Please calculate the pulse width with a value of 1 from the 12-bit PCA9685 at 200Hz PWM.
You are most likely already over the limit of the maximum frequency of a CC LED driver (50kHz).

In simple terms, with 1kHz PWM you can't dim low enough. With 200Hz PWM you can.
200Hz PWM does NOT flicker. At least not in my 20+ downlight setup.
Leo..

I don't know how those dimmable drivers work. Does the pulse length of one PWM pulse have to span at least one cycle of the CC LED driver? 1 is 1/4096 duty cycle, so that would be the length of one 4MHz period, if I am not wrong. What does "over the limit" mean, here?
The datasheet of the LDB states that it operates at 350kHz and can take PWM input between 100Hz and 1KHz, BTW.

If it comes to that, I could just use two PWM boards with different frequencies for the spot dimming at on drivers, and the strip dimming on the MOSFETs.

ElCaron:
I don't quite understand this:I don't know how those dimmable drivers work. Does the pulse length of one PWM pulse have to span at least one cycle of the CC LED driver? 1 is 1/4096 duty cycle, so that would be the length of one 4MHz period, if I am not wrong. What does "over the limit" mean, here?

The datasheet of the LDB states that it operates at 350kHz and can take PWM input between 100Hz and 1KHz, BTW.

I think you have already answered the question yourself.
You can't ask from a CC LED driver to work shorter than one cycle of itself.
The working frequency of a CC LED driver depends on voltage difference.
A driver that is supplied with 24volt and has to power three 3.3volt LEDs works on a different frequency than with a string of five LEDs. The PT4115E datasheet might enlighten you.
Max PWM frequency is confusing. I think minimum pulse width should be used.
10-bit 1Khz with a PWM value of 1 has a lower "frequency" than 12-bit 400Hz.
Yes, you can set the PWM frequency per board. I would try default (200Hz) first though.
Leo..

Wawa:
A driver that is supplied with 24volt and has to power three 3.3volt LEDs works on a different frequency than with a string of five LEDs.

Does it? I thought that was also done by some kind of PWM. Why does the datasheet of the LDB only give one frequency - 350kHz?.
If I see correctly, f_CC/f_PWM gives the number of possible equidistant dimming steps. 350 would be more than enough, I guess.

ElCaron:
Does it? I thought that was also done by some kind of PWM. Why does the datasheet of the LDB only give one frequency - 350kHz?.

If I see correctly, f_CC/f_PWM gives the number of possible equidistant dimming steps. 350 would be more than enough, I guess.

  1. Look at the frequency graph on page 8 of this common PT4115E CC LED driver chip.
    https://people.xiph.org/~xiphmont/thinkpad/PT4115E.pdf

  2. I only use 256 dimming steps.
    This library works for me.
    GitHub - brunnels/PCA9685: Arduino library for the PCA9685 LED Driver
    It converts the PCA's 12-bit PWM into 8-bit (256) percieved brightness steps from a lookup table.
    Leo..

  1. Ok, I see that driver does that. But does every driver do it like that? :slight_smile: Well, I will try as soon as the stuff arrived. The spots have only just been send from China.

Thanks for the lib, that sounds really handy.