LED fade in/out without microcontroller?
Try the following: When a button is pressed, an LED starts to get brighter and brighter until it reaches its theoretical maximum (like when LEDs are connected directly to the power supply with a resistor). It stays there until you release the button, then the LED slowly goes out.
If you release the button before it has reached full brightness, it will go out just as slowly.
Very easy with a microcontroller (button On = brightness++, button Off = brightness – -) but I can't figure out how to do it without one.
Unfortunately, I can't find a module that can do this. I imagine it could be done with capacitors, but I've never worked with one. If possible, what are the chances of salvaging a suitable one from old electronics?
Ultimately, it doesn't matter how long the fade effect lasts. The main thing is that it doesn't go on/off. It shouldn't be too long either.
How difficult will it be to synchronize red, green, and blue LEDs? I don't want the red to fade much faster. I can already simulate an RGB LED with individual LEDs and mix colors well.
If you really want analogy: There are several possibilities… it also depends on whether it should be even brighter/darker.
The simplest option: RC element, when the probe is pressed, capacitor is charged via resistor when the capacitor is released. The voltage of the capacitor may be connected to a controllable constant source.
With 2 OPVs you could improve the whole… one as an integrator, one with Mosfet at the output as a constant current source.
Other approach: generate PWM, also with comparators/OPVs/integrators.
Since microcontrollers are now cent-articles, there is no reason to fry here with an analog grab. For a single small LED you could just imagine this (a large inductance as a switch-on current limit, a large capacitor for supporting when switching off), but if it goes beyond a few mA, you don't get around PWM dimming. This would also be possible with analogue means, but the effort would be absolutely insane.
I'm more concerned about the power consumption as I'm planning to operate the whole thing with 2 AA batteries and heard most microcontrollers would only last a few hours. Maybe I should deal with batteries.
This is not true. It is crucial that the very energy-saving rest modes (sleep modes) are used correctly.