There's tons of literature and tutorials about the 555-timer and it's applications. I thought I would use it in astable mode and change duty cycle, but then I found a circuit that was very close to what I need.
Examining the "Breathing LED circuit"
This circuit is fading the LED up and down, it looks simple and it doesn't use many components. Great!
But how doest it work? Can I modify it, so it won't turn all the way off?
I quickly noticed that this circuit doesn't use pin 7 (discharge), so it's probably not astable mode and it doesn't work like I imagined it would (changing PWMs duty cycle to dim the LED).
From what I understand it works like this: pins 2 (threshold) and 6 (trigger) are "monitoring" the voltage across the capacitor (C1). When the voltage is smaller than 1/3 Vcc (in our case 3V), pin 3 (output) will go HIGH. When the voltage gets above 2/3 Vcc (6V in our case) output will go LOW.
In the beginning, the 555s output will be HIGH (capacitor discharged, voltage < 1/3 Vcc) therefore charging the capacitor (increasing voltage drop across it). As capacitor charges, less and less current flows trough it, and more current goes to the base of the transistor. This increasing current entering transistor's base gets amplified and causes the LED to turn on slowly.
When the capacitor charges up to 2/3 Vcc (6V) the output will go LOW, and the capacitor will begin to discharge trough the transistor. It's output current will drop (exponentially?) with time, which means the LED will fade off slowly. When the capacitor gets below 2/3 Vcc the process repeats.
Getting the RC values right
Obviously, changing the values of the capacitor and the resistor will change the speed of flashing. I tried replacing the resistor (R1) with a 47k potentiometer. I played with it, trying out different capacitor values (from 100uF to 470uF) but I couldn't get the right result.
In every case the LED was fading up/down nicely, but turning off completely. If I cranked up the resistance, I could keep the LED on all the time, but then it wouldn't fade down at all (or really just a little bit, barely visible and too fast).
I guess I should dive deeper into the working of the transistor and start calculating things. Any hints or ideas how to figure this out? Is it even possible to achieve this kind of fading upd/down (but never turning it off completely) with this configuration?