2
\$\begingroup\$

Is there any easy way to continuously, slowly fade (dim) in and out a couple (5 at most) 12v monochrome LEDs (5050)?

A wild guess would involve a large capacitor (for the fades to be slow) and a MOSFET, but I have no idea where to start designing such a circuit.

Since my project won't need any smarter logic, I wanted to try to avoid using a µC for it.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ If you are thinking of using the capacitor approach due to simplicity, then I suggest using PWM and an Arduino. Using capacitors won't give you a linear fade, it is not gonna be as simple as using the conventional approach and not nearly as flexible. \$\endgroup\$
    – Wesley Lee
    Commented May 5, 2020 at 23:21
  • 1
    \$\begingroup\$ The simplicity of modern day hobbyist oriented microcontrollers make this almost plug and play. Like all you would need is a 1 dollar usb microcontroller, a resistor and a mosfet depending on the current required. \$\endgroup\$
    – Passerby
    Commented May 6, 2020 at 1:27
  • \$\begingroup\$ FWIW: electronics.stackexchange.com/questions/405499/… \$\endgroup\$
    – Sixtyfive
    Commented May 6, 2020 at 12:56

3 Answers 3

3
\$\begingroup\$

A PWM as suggested in the previous comment is possible, you can use a 555 timer or an MCU. A bipolar transistor seems best for this option.

Examples.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ What makes the bipolar transistor preferable? Why bjt instead of mosfet? Won't I fry the bjt? \$\endgroup\$ Commented May 6, 2020 at 8:17
  • \$\begingroup\$ BJTs work better from small signal voltages than MOSFETs do. \$\endgroup\$ Commented May 6, 2020 at 11:06
4
\$\begingroup\$

Any circuit that could generate PWM of varying duty cycles would suffice. You don't need to drive the LEDs; your circuit only needs to source a few milliamps. You will send its output into the input of any common readily available $9 amplifier, and that will drive the lights.

You want the PWM to be up in at least the multiple hundreds of Hz to avoid visible flicker, and it's OK to change the frequency. The amplifier will simply follow the input.

Also keep in mind LED strip tech is all wired "positive ground".

\$\endgroup\$
3
  • \$\begingroup\$ I do have only a couple of LEDs (at most 5), so the amplifier looks overkill. \$\endgroup\$ Commented May 6, 2020 at 9:08
  • 1
    \$\begingroup\$ to be sure, compare their maximum current with what the PWM output can safely drive. are they LED arrays, or just vanilla ~20mA LEDs? 5050 will draw almost 0,5A at 12V (14W per meter, so whatever 5 amounts to) \$\endgroup\$
    – dlatikay
    Commented May 6, 2020 at 11:02
  • \$\begingroup\$ the amplifier calls for to 12 to 24V input signals. the internal picture appears to show optpcouplers, depending on the resistors chosen it may not work well with 5V signals. \$\endgroup\$ Commented May 6, 2020 at 11:11
2
\$\begingroup\$

If you allow me to blow my own trumpet, I made something similar:

enter image description here

This circuit generates a sine triangle wave around a Vbias voltage. The frequency is fixed, but you can vary it by changing the values of the different components. The circuit itself has been ripped from "The Art of Electronics" so if you have a copy, you can find it explained there, in the OpAmps section (don't have it in front of me, sorry, can't reference the page). You feed the Vfade voltage to a transistor

enter image description here

And job's a good'n. You can find more info at my repo (shameless plug). There's an spreadsheet in the support folder to calculate the passive values. In my case, as I was driving a blue LED with a 3V battery, I wanted to keep the voltage from 3V (or whatever the battery was outputting) to just around 2V (so the LED is not on), otherwise the LEDs would be off for most of the time, so instead of a 1.5 Vpp sine wave over a 1.5V bias voltage, I ended up generating a .5Vpp sine wave over a 2.5V vias voltage.

EDIT: I originally said that it generated a sine wave, but that's not true. U2 generates a square wave, which is fed to a integrator, so you get a triangle wave. EDIT2: I used this circuit because it has the side-effect that if you rise the bias voltage, you get uneven positive and negative cycles (the triangle wave has different ramp up and down, so you get a nice breathe-like effect). I will modify the excel on my repo to better represent what's going on and what effect tweaking each component has.

\$\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.