Controlling LED brightness without using PWM directly


I have to control the change of led brightness (by using Arduino or raspberry Pi) to check the growth of bacteria. Because the blink of the LED affects the result I can't use PWM directly to control LEDs.

Is there any method to control LED brightness by using Arduino (or raspberry Pi) without impacting LED blink? I want to control about 40 small LEDs at a time.

Thank you very much for your precious help.

You can run PWM at high rates so the "flashing" will not be visible - the same as for your monitor screen or domestic lights.
Also if necessary (it wont be) you can add a capacitor to smooth out the current.

One of my projects uses pwm to produce a smooth voltage, and you can find it here, with the sketch that shows an easy way to set pwm frequency

use a low pass filter and a FET to control the LED´s.

That requires explanation. :roll_eyes:

You could turn on different banks of LEDs.

Turn on 5 LEDs then 10, 15, etc.


Any number from 1 to 40.

And a very big heatsink :sweat_smile:

I want to use LED for an experiment that check the photosynthesis based on light intensity.
Flashing will have an effect on photosynthesis without changing light intensity so I can't use PWM for this work.

Thank you.
I want to use LED for an experiment that check the photosynthesis based on light intensity.
Flashing will have an effect on photosynthesis without changing light intensity so I can't use PWM for this work.

How can a light flash without changing intensity?
You can easily run PWM at 31kHz I dont believe photosynthesis can respond that fast. Anyway just put a capacitor filter to smooth it.

.. and a reference.

You CAN use a seperate DAC to provide a linear voltage, and an amplifier to provide the needed current. But why make life hard?

Thank you for the comment.
Sorry, I'm not a native speaker, so my wording may be misleading.

I mean maybe the same light intensity (average, measured by 1 sensor) but supplied by 2 sources with different frequency can lead to different results of photosynthesis.

You can check out this article. Growth and Photosynthesis under Pulsed Lighting | IntechOpen

Even at 100KHz there are certain effects.

OK; you WILL need a bit of external electronics as AFAIK most pre-built LED drivers are non-linear.

Growth and Photosynthesis under Pulsed Lighting | IntechOpen FASCINATING!

I'll provide more details but I need to know what current and voltage the LEDs will need. Do you intend to wire them in series, parallel, or series-parallel?

Are they all the same color? different colours require different voltages.

Pre-built modules, probably yes. But there are many led driver IC's out there that support linear dimming by applying a small voltage to their en/dim pin. I've been using the MP24894 a lot lately, and it also has this feature (although I don't use it). The drawback is that these IC's only dim down to about 10% and no dimming is available below that threshold. Implementing such drivers is fairly easy; it takes one or two capacitors, a resistor and an inductor basically.

Another option is linear dimming through a shunt-controlled constant current source.

In both instances (led driver & shunt current source) a bias voltage could be generated from a microcontroller either through a DAC (preferably) or if needs be by outputting a PWM signal through an appropriately dimensional RC filter.

That uses PWM for dimming!

That would be my suggestion - although depending on the configuration I'd maybe go for series control.

It also supports PWM dimming, but can use Analog dimming.
That is why the inductor is included in the circuit.


Exactly. There are many led driver chips that offer this dual dimming functionality.

Btw, the inductor is neede not just for linear dimming; it's also used as an efficient means of current limiting. But you are probably well aware of this given your experience with SMPS design.

Thanks for notes.
Yep, I thought to emphasize that it is possible to do Analog dimming when it has the inductor.

Yes, it certainly is. Switching frequency with the part I mentioned is generally around 100-300kHz or so. A smoothing capacitor across the led keeps the current through it quite stable. I think this kind of approach would be the easiest solution; it's a lot less engineering work than designing a shunt CCS for this, although that wouldn't be very difficult either.

Yes - it uses FAST PWM for "analog" dimming; true analog dimming would potentially involve dissipating 1A / 60V and nowhere near the claimed eficiency of 95%
however with the choke and a smoothing capacitor it will certainly BEHAVE like analog dimming.

I agree it looks like a very good choice for this application, provided the OP is happy with the limited control (20 - 100%)

The OP will still need to provide a suitable analog input voltage, so use a DAC or .. PWM and a filter!

What is "small LED"?
How quickly and how precisely do you need to change the intensity?
Each LED independently or all at once?
What is your programing and electronics experience?
Do you have a plan to measure the light output? I think you should do this.

Thank you.
I am thinking about using a capacitor to smoothing capacitor too.