Slow fading LED

Discussion in 'General Electronics Chat' started by hp1729, Feb 7, 2016.

  1. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    The objective was to have an LED slowly fade in and out over some seconds. My first attempt was to use the comparators and latch of an LM555 but I couldn't get it to work. So I tried using an LM393 and a 74LS74 to do the same thing and this worked. Getting away from the LM555 also let me set a wider range between "trigger" and "Threshold" so it worked out for the better, but I can't understand why the LM555 didn't work.
    Using the LM555 the LED came on quick and stayed.
    As it is using a 10 uF cap for the timing it fades on over about 10 seconds, stays on for about 10 seconds, then fades off slowly.
    The question ... other than the voltage divider what is the difference between the LM555 and what works?

    I will have to recreate the LM555 schematic, give me a bit.
     
  2. Jony130

    AAC Fanatic!

    Feb 17, 2009
    3,957
    1,097
    My hypothesis :
    With 555 the voltage at the gate of a MOS is between 3/2Vcc = 3.4V and 1/3Vcc = 1.6V . Also 100k will quickly discharge the cap.
    And this is why you do not see any change in diode brightness. And have you try to configure Q1 as voltage follower instead-of a CS amp ?
    Your second circuit has a much lower frequency of operation because now the cap is charged and discharged via 1MΩ only and this is why you now can see the effect. Also what is the purpose of a R10 resistor?
     
  3. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    Use the CV pin on the 555 to adjust duty cycle.
     
  4. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    That works too. I can adjust Threshold but not trigger. I have yet to do that with much success.
     
  5. crutschow

    Expert

    Mar 14, 2008
    12,991
    3,226
    Move the LED resistor and connect it between the transistor source and ground.
    That will make the LED current more proportional to the input voltage and give a slower fade.
     
  6. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    The below is a fade in/out circuit, if you wish reach to 10 seconds then you can use C1 as 22uf and increase the R1 values or use R1 as 33uf and decrease the R1 values.

    DelayOnDelayOffForNpnLED_ScottWang.gif
     
  7. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    Super! Thanks.

    (edited to add ...)
    Well it fades in and out a little. It looks like it might delay a relay going on and off better. :)
     
    Last edited: Feb 7, 2016
  8. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    Interesting. I'll have to build it just to play with it, but the objective was to have it oscillate.
     
  9. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    You are great to built a oscillator, simulation or breadboard?
    I never did like that and other people also never happened like that.
     
  10. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    A MCU would be able to do this simply. 8pdip avrs or pics are great for this.
     
    cmartinez likes this.
  11. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
  12. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    another great option.
     
  13. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    I am throwing my hat in this ring.

    [​IMG]
    OK, here is how it works. I have not simulated this. Maybe one of you LTSpice experts will fine tune the values. @crutschow

    - The 555 is configured to have a 50% duty factor. So, the voltage waveform at C1 should look like Figure 5 on page 8 of the attached data sheet. The top peak is at 3.33V and the bottom peak is at 1.66V, assuming Vcc is 5V.
    - Q1 is a simple emitter follower (high impedance buffer) to keep from messing up the timing of the 555. We lose .65V through the base-emitter junction so waveform at the emitter of Q1 is 2.68V to 1.02V.
    - Now for the fun part. The B-E junction of Q2 is .65 plus the junction voltage of D1 (schottky diode) equals .65 + .45 = 1.10 volts. This means that at the bottom peak of the waveform (1.02V), Q2 will be off and thus D2(LED) will be off also.
    - When the waveform rises above 1.10V, Q2 will start to conduct. How much it conducts is set by R2 + R3 and the gain of Q2 (100). In other words, R3 adjusts how bright the LED will get.

    Don't nitpick me on lack of decoupling caps and other things. You know they are suppose to be there, so put them in.

    I await your comments
     
    cmartinez likes this.
  14. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    I just thought that you want a breathing light led, the circuit that I designed just for fade in/out once when the power on and off, the circuit you want need an oscillator to drive it to replace the switch.

    If you using the ne555 then you may connecting from pin 2 as Lestraveled attached.
     
  15. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    Yes, it works as you designed it.
     
    Last edited: Feb 7, 2016
  16. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    I don't see how it can work with a mosfet transistor.
     
  17. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    With my approach it is a PWM signal, in which case a MOSFET is perfect.
     
  18. wayneh

    Expert

    Sep 9, 2010
    12,093
    3,031
    The nicest looking throb I've achieved was the fancy way, with a PWM source fed a sine wave for the duty cycle control. You can tweak the min and max duty cycle to achieve the brightness range you want.
     
  19. hp1729

    Thread Starter Well-Known Member

    Nov 23, 2015
    1,942
    219
    It works as you designed it. I mis-wired it the first time.
     
  20. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    Cool
    Were the values for R2 and R3 about right?
     
Loading...