Adding a delay to a LED

Discussion in 'The Projects Forum' started by rhille, Feb 29, 2016.

  1. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    Hello all

    I just signed in today and although I was always interested in electronics, I just started to try and actually figure out how it works instead of just copying whatever interesting projects I could find in books or on Websites... So, I figured that the best way to learn it was to actually try and build a circuit. But I have been playing around with this part of my project for at least a week, looking, searching and figuring out stuff but I think I have hit a wall!

    Here is what I am actually trying to achieve: It is actually going to be a part of a bigger project but I broke it down in pieces trying to figure out each one. So, I simply would like a LED to turn on after a delay of approximately one second when the project is plugged into an AC main voltage outlet. Sounds simple but it is not for me...

    First things first, in order to keep the current draw as low as possible, I did not want to use some transformer, bridge rectifier and voltage regulator. These will be used when the main switch is turn on. I just want a visual indicator that the project is plugged in and that there is power so it would fit between the AC main and the Main power switch. The small LED will be on the back of the enclosure. So after some research, I came across a way to use capacitors to build a transformless power supply, which in turn would be hooked up to the LED. Unfortunately, I was not able to find a way to easily add a delay before the led is turned on since it is all AC. So I decided to add a Zener diode and maybe a voltage rectifier to turn it into DC. That way, I could add a RC time delay to turn on the LED after a while.

    But, when I tried to run the schematic in Multisim (see schematic after this block of text), it looks like the LED is turning on after a little while and the intensity gradually increases based on the current supplied to the base of the transistor. I am trying to actually make it turn on past a set point... Please note that the switch is only there to start the process. It would not be part of the project. Also, the resistors and capacitor values might not be ideal since I tried different values while experimenting.

    upload_2016-2-29_18-53-2.png

    Is there a better way to do it? Am I missing something?

    Thanks for any input you might have.


    Rick
     
  2. dannyf

    Well-Known Member

    Sep 13, 2015
    1,835
    367
    For sharp turn-on/off, use a comparator, like TL431.
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    To avoid any possible confusion by the OP, the TL431 is a voltage reference that can be used as a comparator with the reference voltage being the trigger level.

    It's difficult to get a sharp delay turn-on with a simple BJT circuit.
    A logic-level type N-MOSFET would work better.

    Note that shorting a voltage source to ground is not good practice as you are doing with the switch. :rolleyes:
     
  4. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    Thank you both. I tried playing around with the TL431 as per DANNYF's suggestion but I am not familiar with it, so I could not get it to work as of yet.

    To CRUTSCHOW, at first, I tried with a MOSFET but since the current was only about 20 mA, I thought a transistor was a better choice. If you suggest a MOSFET, I guess I will look into it. Now, I am not sure I understand what you mean by shorting a voltage source to ground... I basically used a circuit that I often saw in different circuit. But here is where my lack of formal training shows... What would be the best way to do it?

    Thanks again


    Rick
     
  5. dannyf

    Well-Known Member

    Sep 13, 2015
    1,835
    367
    A mosfet wouldn't work - your issue is due to the slow-rising voltage across the capacitor. A mosfet or a bjt fundamentally doesn't solve that problem.

    You can think of a comparator like TL431 as a npn, with a sharp turn on at 2.5v (equivalent of Vbe). A drop-in replacement for your bjt.
     
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,835
    367
    A 33k/47uf network will yield a ~1s delay (to 2.5v).
     
    rhille likes this.
  7. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Look at Figure 25 of this data sheet.

    Just a nit, but a MOSFET is a transistor (metal–oxide–semiconductor field-effect transistor).
    A small, logic-level MOSFET will work fine to switch 20mA.

    Actually the switch is okay as you showed. My thinking cap was on backwards. :oops:
     
  8. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    Good evening again to you both.

    Here is what I came up with, based on your information. Is that what you were thinking?

    upload_2016-2-29_21-44-54.png

    The delay looks perfect but I was wondering, why does the B channel go up in voltage? It went around 65v!

    Thanks again


    Rick
     
  9. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    I forgot to ask. I put a Rin resistor as suggested in the Data sheet supplied by CRUTSCHOW. Would a drop-down resistor be advisable?

    Thanks a million


    Rick
     
  10. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    Here is another test. With this one, the voltage stayed at 5 v or under so I guess this is a better version. What do you think?

    upload_2016-2-29_22-2-51.png

    I appreciate your inputs


    Rick
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    In your second version R2 provides a small bias current to U1 when the LED is off, so that probably gives a more reliable switch point.

    You could increase the value of R8 to increase the delay time.
     
    rhille likes this.
  12. rhille

    Thread Starter New Member

    Feb 29, 2016
    7
    1
    Hello CRUTSCHOW

    you are right, of course, that increasing R8 would give a longer time delay. I modified the value in order to test it more quickly. I will set it back to 33k as suggested by DANNYF since the delay was perfect.

    I was able to create a transformless PSU integrating this function and it works well except for the fact that there is 120hz ripple on the output of the voltage regulator as soon as there is a load.

    I will play around with the values and see how it goes. I will also post a schematic when I have chance in order to share with the other members.

    Thanks again


    Rick
     
Loading...