0
\$\begingroup\$

I would like to build a project in which 15 groups of LEDs are set to a brightness level. I have an Arduino with digital PWM outputs (which can mimic a range of voltages.) How can I do this?

One idea: connect each LED to a capacitor and use a transistor array to charge these capacitors with a voltage which will produce a controllable brightness in the LEDs? I was thinking that I could charge each capacitor with a different voltage, then re-charge them every 10th of a second of so to maintain the set level of brightness.

If so:

Will I need to use a small capacitor to turn the initial PWM output into a voltage?

How big will the individual LED capacitors need to be to maintain illumination?

How often will the capacitors need to be charged?

How will I need to use resistance in the circuit?

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • \$\begingroup\$ You should add a schematic diagram to more concretely describe the circuit you are suggesting. You can use the built-in editor or add an image. \$\endgroup\$
    – akaltar
    Commented Mar 28, 2016 at 20:21
  • \$\begingroup\$ If you think you need a capacitor to convert PWM to voltage to control a LED brightness I think you might be fundamentally misunderstanding how PWM varies an LED brightness. Did you manage do control a single LED with PWM yet? \$\endgroup\$
    – Wesley Lee
    Commented Mar 28, 2016 at 20:31
  • \$\begingroup\$ How do I use the built in editor? \$\endgroup\$
    – Hoytman
    Commented Mar 28, 2016 at 20:32
  • \$\begingroup\$ @Hoytman edit your question and either click the "schematic" button, or press Ctrl-M. \$\endgroup\$
    – Steve G
    Commented Mar 28, 2016 at 20:49
  • \$\begingroup\$ I think you are asking, "Can I somehow use one PWM output to control various LEDs to different brightness?" If so, please edit your question to clarify and give some idea of how you would switch the PWM from LED to LED? Hint: you're going to need digital outputs to do that - one per LED - and once you have an output per LED you can control them individually making your own PWM driver for each pin. \$\endgroup\$
    – Transistor
    Commented Apr 1, 2016 at 15:55

3 Answers 3

2
\$\begingroup\$

This is not exactly what you asked for, but if you want to control multiple LEDs with a single signal, I would look into WS2812 (and similar) family of LEDs and LED drivers. They only need one wire signal(plus supply rails) to control a very large number of LEDs (the more LEDs, lower the "framerate" you get).

Any "diy" implementation of a single PWM to drive multiple LEDs with independent brightnesses would require much more than a "transistor array" and capacitors. (although, yes, an IC is an array of transistors, but what I mean is that doing it from scratch might not be viable solution).

If you are willing to use more than one signal, you can look into ShiftPWM (based on 595 IC's), or into i2c based port expanders, such as PCA9685.

TLC5940 might also be useful.

\$\endgroup\$
2
  • \$\begingroup\$ I really like the ShiftPWM solution \$\endgroup\$
    – Hoytman
    Commented Apr 1, 2016 at 16:11
  • \$\begingroup\$ depending on what arduino you are using and how many LEDs/resolution/PWMfrequency you need it might be a bit heavy for the mcu. If you are not doing anything too complex it will be ok and uses readily available shift registers \$\endgroup\$
    – Wesley Lee
    Commented Apr 1, 2016 at 16:13
1
\$\begingroup\$

Yes, it is possible to connect each LED to a capacitor. And use a PWM to control the power going into the capacitor/LED. But we don't understand why you think you need any capacitor to implement brightness level? LEDs are typically directly driven and use the human persistence of vision to integrate the brightness. That allows for faster control of brightness.

\$\endgroup\$
2
  • \$\begingroup\$ I would like to use the PWM to set the brightness level of several different LEDs. I was thinking that I could charge each capacitor with a different voltage, then re-charge them every 10th of a second of so to maintain the set level of brightness. \$\endgroup\$
    – Hoytman
    Commented Apr 1, 2016 at 15:45
  • \$\begingroup\$ Yes, you COULD do that, but nobody knows WHY you would want to go to the extra step of charging capacitors when you could simply drive the LEDs directly? \$\endgroup\$ Commented Apr 2, 2016 at 4:05
0
\$\begingroup\$

Will I need to use a small capacitor to turn the initial PWM output into a voltage?

NO, you don't need any ANY size capacitor to control the brightness of LEDs.

How big will the individual LED capacitors need to be to maintain illumination? How often will the capacitors need to be charged?

You don't need any capacitors at all. So you don't need to charge any capacitors.

How will I need to use resistance in the circuit?

You need resistance in your circuit to limit the current through the LEDs. Else they will self-destruct.

We typically connect the positive end of the LED (or string of LEDs) to a positive power supply, and then use a transistor between the negative side of the LED(s) and circuit ground. Then you can drive the transistor from any kind of logic-level output without having to worry about how much current the LEDs require.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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