I'm planning to build an aquarium lightning system with individually controllable LED's, I don't have much experience with electronics except from the irregular tinkering, but I'm a programmer and I think I'll be able to put something decent together.

The system will consist of about 30 * 3W LEDs, I already have those as well as heat-sinks, lenses, thermal glue and a couple of PWM-boards similar to this. My initial plan was to build some kind of simple transistor switch between each individual LED and the power supply, a switch that I could control with the PWM-board, which in itself is controlled by an arduinio/raspberry pi.

Then I read on and discovered that LEDs are supposed to be current regulated, not voltage regulated. So now I'm not sure about how to move on.

I've considered just buying a bunch of individual constant current drivers like these, but I don't see how I'd be able to pwm those properly. (I realized that most of my LEDs aqually are in the 700mA range instead of the 300mA that I first thought, now it's starting to get unreasonable expensive to buy one of these for each single LED, in an otherwise quite cheap system...)

What I really would need is some kind of variable current driver, from between 0(?)-800mA (I've understood that very dimmed LEDs draws very little current, so I need a big range there), that I can control with pwm, but that does not seem to be a thing I can buy like the regular constant current circuits.

Any ideas? I've considered to buy a current sensor for each LED and to use this data to properly modulate the individual LED's myself. But I'm not sure I can find some that reliably can measure the low currents that I need. Or does the spec sheet for that MAX471-chip really say that it has a resolution of 0.5 mA per A (Current-Sense Ratio)?

Clarification on functional needs

  1. I need a lot of light in order for the plants in the aquarium to thrive. I need as much white light as I can get from each watt.
  2. I want to be able to control the light in aspect of intensity as well as tone/temperature (I have different temperature LED's).
  3. I want to be able to control exactly what parts of the tank are lit and how those parts are lit. E.g., I want to able to simulate similar dynamics as to clouds passing by or lightning, or just to selectively light certain parts of the landscape.
  4. Not critical but valuable: Scalability. The ability to easily to add or remove LEDs.
  • \$\begingroup\$ @Alex sorry about that -- missed the 3W LED part. Case of the Mondays. \$\endgroup\$ – calcium3000 Jan 9 '17 at 15:04
  • \$\begingroup\$ Some LED constant current drivers will accept an analog/PWM signal and drive the LED proportionally. They are generally more suited for a few LEDs in series though (3+). I don't recall seeing such a solution for individual LEDs. \$\endgroup\$ – Wesley Lee Jan 9 '17 at 15:46
  • \$\begingroup\$ To make the question easier to answer, you should explain the purpose of this control function. More of a higher level description. \$\endgroup\$ – Sean Houlihane Jan 9 '17 at 16:02
  • 1
    \$\begingroup\$ Since this is a planted tank -- have you considered just adding more macros and CO2 when your LEDs bleach the chlorophyll right out of the leaves? That's my plan when I finish my lightbar :) \$\endgroup\$ – Bryan Boettcher Jan 9 '17 at 20:35
  • 1
    \$\begingroup\$ @Alex It all depends on your LEDs, I suppose. Ones I've used (only a few, I admit near this power) were \$3.2\:\textrm{V}\$ at \$700\:\textrm{mA}\$ so only about \$2.2\:\textrm{W}\$. But who cares? If it gets you close, that's probably good enough. Just wanted to mention it as something to consider. When you test these, measure the voltage across the LED when operating them with those boards or with a resistor paired with a bench supply you may have. That will tell you the full truth of the situation. In any case, its more about efficiency converting power into light. Different thing. \$\endgroup\$ – jonk Jan 9 '17 at 21:34

To answer your question about current regulation, a handy feature of LEDs is that the forward voltage across them is approximately constant, regardless of the current. So a red LED drops about 1.5V, a blue LED about 3V, and the other colours are in between.

Knowing that, it's possible to use a simple resistor to limit the current through the LED to a suitable value. The resistor value will depend on the supply voltage. If the supply voltage is well above the voltage of one LED, consider wiring a few LEDs in series, otherwise you'll have to deal with a bunch of unnecessarily hot resistors.

  • 2
    \$\begingroup\$ This. This is how to drive a LED. You emphatically do NOT want constant-current drivers, current sensors, or all the other stuff you mention - I'm afraid this is a case of a little knowledge being a very bad thing! Except for some very specific niche applications, you always set the current through the LED using a current-limiting resistor. A good little calculator for the resistor value you want is here: led.linear1.org/1led.wiz And then you do PWM to set the brightness, and everything just works. \$\endgroup\$ – Graham Jan 9 '17 at 17:41
  • 1
    \$\begingroup\$ At 3 watts, that's ~1 amps per LED. Even with 0.5 ohm resistors, that's a lot of power wasted overall and it still doesn't give a very good current control with a resistor that small. If you increase the resistor, you end up with even more wasted power. What you state applies better to smaller LEDs. PWM or PWM with an inductor on power LEDs is often the better way to go since the current/voltage relationship isn't super steep. \$\endgroup\$ – horta Jan 9 '17 at 19:08
  • 4
    \$\begingroup\$ @Graham I worked professionally for Siemens/OSRAM and we definitely did use constant current drivers and did NOT use current limiting resistors. One I worked on was an \$80-100\:\textrm{W}\$ RGB LED module. A fixed voltage rail was supplied to each of three rails, which each had a low-overhead constant current driver. These were tweaked to provide 100% drive. Then PWM was used within that to set the brightness of each color. Widely used modules (millions sold), too. Just a note. \$\endgroup\$ – jonk Jan 9 '17 at 19:23
  • \$\begingroup\$ Hmm... The simplicity of this is very attractive, I just so happen to have these star-shaped cylindrical heat-sinks that I've planned to use, that just so happens to have a center hole in them where I probably could fit a quite beefy resistor which I could embed in thermal glue... Although when I enter my numbers (6v supply, 3.5v drop, 700 mA) here, it looks like the resistors are going to consume almost half of the total power consumption (1.6/2.2 W). That does not feel so attractive. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 19:45
  • \$\begingroup\$ Unless maybe if I find a more efficient way to bring down the supply voltage to like 4v instead, and take that as my mains... Then I'd probably could buy a regular 12v supply that is easier to find. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 20:11

Assuming that the goal is decorative rather than functional, you could consider using digitally addressable individual LEDs, like neopixels (the bare LEDs are available if you want to assemble something. These are RGB, but a bit less than 3W (probably less than 1W). In this case, you'd need several high-current 5V supplies rather than constant current power supplies. A microcontroller can drive quite a large number of these (the digital signal is daisy-chained).

If you really want to PWM 30 individual LEDs, you do need 30 individual current regulators. If its OK to arrange them in strings, each string can be PWM with a single switch, but you risk generating electrical noise. Depending on the scenario where you want to use this, it could be a problem.

The PWM driver which you identified can only supply about 10mA per channel (at best), so would be OK with small LEDs, not your 3W target.

  • \$\begingroup\$ Thank you for your answer. There are actually some functional needs here: I need a lot of light. It's a planted thank, and my aim is to give them as much I can. And I generally need white light, I already have a mix of different LEDs with temperatures 2.5-10.000K, and a random bluish and a redish, and a couple of UVs. The light strips would be very convenient but I'm not sure that is what I'm looking for here. And my plan with the PWM was to drive a power circuit that powers a LED, not to power the LEDs themselves. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 16:13
  • \$\begingroup\$ @Alex Are you aware that the spectral output of white LEDs may not be what's better for such plants? See: en.wikipedia.org/wiki/Light-emitting_diode#/media/… for an example. \$\endgroup\$ – jonk Jan 9 '17 at 19:26
  • \$\begingroup\$ @jonk Yeah, I'm kinda aware of that the plants have some special preferences for a certain wavelengths, although my primary goal will probably be to start with the regular white LED's in different temperatures and experiment with appearance and growth. Then maybe adapt when I see how stuff works. Thanks for the heads-up. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 20:03
  • \$\begingroup\$ @Alex Okay. Just wanted to be sure you had at least some information. Old incandescent lamps emit black body radiation, shifted to lower wavelengths than the sun itself of course, so they weren't perfect, either. I think careful formulation of the phosphors might make some good plant lights. So look for LEDs that have been crafted for that purpose, I think. Research is a good thing. \$\endgroup\$ – jonk Jan 9 '17 at 20:12

I would matrix them into a 5X6 array as your title suggests using time division multiplexing. This works by turning on one set of 5 on at a time for 1/6th of the time. Then you switch to the next set of 5 for 1/6th of the time. If you do this fast enough, higher than 30hz, to the human eye, it will look like it's always on, just dimmer. You can increase power to some degree to compensate for the 1/6 dimness.

Use 5 or 6 transistors to power the low side of the LEDs. Control the transistors with PWM or PWM filtered with an RC filter. Since 3 watt LEDs don't have a vertical voltage/current relationship (it has some slope to it), you can use a regulated supply voltage to get you within a region that won't damage them.

If you need more accuracy/control than what a PWM with a transistor would give you, you can add in 5 or 6 low side current sense resistors. Then use the ucontroller's analog input capability to determine how much current is flowing and adjust the pwm accordingly.

  • \$\begingroup\$ Thank you, I'll try to make sense of what you wrote and see if that is something I can do. I'll get back to you. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 16:14
  • \$\begingroup\$ Just as you know, I realized that the matrix itself might be an implementational detail so I removed that from the title, even though it might be an excellent solution. \$\endgroup\$ – Alex - Stop it SE Jan 9 '17 at 16:32
  • \$\begingroup\$ @Alex matrixing your LED's is a sure way to simplify your circuit design needs and reduce your BOM(build of materials) size and cost. \$\endgroup\$ – horta Jan 9 '17 at 16:33
  • 1
    \$\begingroup\$ I suspect that despite fooling the human eye for a brighter effect, multiplexing would not be the actual light energy equivalent of all the LEDs being lit simultaneously, as far as the plants are concerned. \$\endgroup\$ – Randy Jan 9 '17 at 23:30
  • \$\begingroup\$ @Randy It wouldn't be. You have to overdrive the LEDs for a shorter time which has diminishing returns. Still, it's a much more scalable than a non-matrixed solution. \$\endgroup\$ – horta Jan 9 '17 at 23:55

Thank you all so much for your invaluable suggestions. You helped me find these cheap constant current drivers with built in PWM support at the 700mA that I need. That feels like the perfect solution for me, it's basically just plug n' play into my power supply, PWM-driver and my LED.

Not as sophistical as building my own matrix, but definitely easier and a safer bet considering my inexperience in the field of electronics. Not as simple as just using a resistor, but more efficient and hopefully cheaper long-term.


10-bit control of each LED in a string of 12 programmable via UART: Texas Instruments TPS92661

LED Matrix Manager


Not the answer you're looking for? Browse other questions tagged or ask your own question.