LED Fade in and out - timed.

Discussion in 'The Projects Forum' started by Roxy2, Jan 4, 2013.

  1. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    I am building an led fade in / out circuit. It fades in when powered and out when the power is removed. I have found a circuit on the www but the website chap hasn't been so forthcoming with more information. I don't currently have a bottomless reserve of varying resistors and capacitors to help find out what I need to change the time taken to fade. I have been told to replace the 100k resistors and 100u capacitor but haven't been told to what. The circuit I am building is exactly as shown in the attachment. I don't know what the rate is either for the given values shown but from a whole days research am guessing its only a few seconds. Also from what I have found out on similar circuits that its only the capacitor and the resistor (shown to the right of it, I believe this is generally known as the draw down) that should be changed. Inevitably I will build the circuit and end up experimenting but would appreciate it if I could get a better idea of where I should be going with the values.

    Thanks in advance.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    The time constant of an RC tank is simply R in ohms times C in farads. So your 100µF capacitor will charge thru the 100k resistor with a time constant of: 10E-4 times 10E5 equals 10 second.

    Your Darlington will need about 1.2V on its base to begin conducting. When the cap is fully charged to 8V, the base will see 4V (ignoring current through the base, which will pull that voltage down to 1.2V).

    Note that this won't fade if power is removed, only when the switch is opened. Removing power will cause the lights to immediately go out.
     
    Last edited: Jan 4, 2013
  3. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Ok. Bit heavy for me that one! Are you saying if the values were multiplied by 10 the fade would be ten times longer? I know about the switch needing to be opened and not removing power. In the circuit I'm building it into the switch will actually be a relay operated by a timer.
     
  4. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Pulse width modulation would give you a lot more flexibility and control on your fade times. It shouldn't be too difficult. What sort of fade times are you shooting for?
    Do you really want to control it with a switch?
     
  5. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    It would become 100 times longer if you make both R and C 10X larger. There are practical limits of course, but certainly you could play around with the values to get the timing you like.
     
    Metalmann likes this.
  6. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Thanks. That's what I needed to know.
     
  7. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    I've seen pwm controls but couldn't find a circuit diagram anywhere for it. Also I'm using a timer not a switch. The idea is to switch on at a given time, fade in then several hours later switch off and fade out. I'm ideally looking for around 30 minutes fade but would be happy with 10.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    Whoa, I don't think an RC tank is a good choice for such long times. Ten seconds maybe, 30 minutes, no way. You might be able to do it by using an op-amp in between the RC and the power transistor. Still, 10-30 minutes is a long time for an RC timer.

    Do you want the fade to take that long, so that for instance you are at 50% brightness after 10 minutes, or do you want a delay and then a fade out over a second or two? The former requires PWM to be practical.
     
  9. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    I'm after a long fade period, not a delay then a short fade. If I can get a 10 minute period I would be happy. Ive seen several circuits about. 1 has a base power supply maintaining a minimal voltage at the capacitor so dimming starts straight away so you dont have to wait fir there to be sufficient charge in the capacitor - im avoiding discussing this though as that can easily be added later.

    I've seen pwm circuits but they've all been based on a manual potentiometer to adjust the brightness. I need this to be automatic. Another circuit using pwm used an LDR.

    Ive also seen this for sale where the period is near 15 days. http://www.ebay.co.uk/itm/Aqua-Mari...261&pid=100015&prg=1006&rk=1&sd=221167259418&
     
    Last edited: Jan 5, 2013
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    A microcontroller would be the sensible way to do PWM with such long fade times. I don't think you will be able to do it without some sort of digital circuitry.
    Here is an interesting (to me, anyhow) article about electrolytic capacitor leakage. Note that leakage is is a complicated function of rated voltage, capacitance, and time.
     
    thatoneguy likes this.
  11. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Thanks. I really need to find a circuit for pwm. The original circuit I posted was just a starting point.
     
  12. Phitur

    New Member

    Sep 7, 2009
    11
    0
    Roxy, I have an idea of what you are trying to do and it is something that I would like to do as well. I want to build a circuit of LEDs for my reef tank and have a fade in and fade out for varying banks of them to mimic sun up and sun down going across the tank. I believe I'm going to have to incorporate some sort of program with an IC to do it. I have a Raspberry Pi that I was going to experiment with to get the functionality that I wanted, possibly through some Arduino combination. Once I figured out the circuitry and logic, I was thinking I'd write python code to put into firmware on an IC (after learning Python, if I can even put python on the chip. I'm pretty sure C++ would work. There are also some stock Arduino program that Steve (below) says will work on his controller.) At least, that's the hope. It's mainly a goal at this point, because I haven't purchased any of the components I need just yet.

    There is a site called Steve's LEDs where he has a driver for LEDs. They have a PWM input on them for fading and automation. From what I've read in forums, he has the best prices out there. He also has general information here.

    I'm interested in what your application is and how it progresses. I'll also share my insights from what I learn in my pursuit, but I can't promise timeliness (seeing as how I haven't started my own project yet...;).

    Cheers
     
  13. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Don't forget that during the fade, the transistor will be dissipating a LOT of heat. The transistor would eventually fail, unless it is connected to a large heatsink.

    Programming PWM has gotten far easier for hobbyists with microcontroller products like PICAXE (Very low cost, <$5, BASIC programming language) and the Arduino ($30, C like programming language) to give good PWM for virtually any period of time you would like. The switching transistor also dissipates far less power as it is either switched on or off, rather than behaving like a resistor.

    Good non-microcontroller methods for PWM can be found using the 555 timer IC.
     
  14. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Im aware of the heat dissipation requirements, its the same for the led arrays I will be using.

    Ive seen the 555 pwm circuits but there is still little info on how to use it as a fader or alongside a fader circuit.

    Any hoo, Im investing in a circuit module that I have found and the designer is happy to reprogram the code to give me an 18 hour fade time, 9 hours up and 9 down. The circuit will be powered via a timer kicking in at 3am, then there will be sufficient light from the leds when the main lights kick in and vice versa at the other end of the day.

    Im, still going to have a play with this circuit though, just out of interest!
     
  15. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Actually, this article shows how to do fade in/fade out using PWM. It is very simple, a 555, LM393, transistor, and a few discrete parts. Using PWM the transistor will not get hot, just don't exceed the current requirements.

    LEDs, 555s, Flashers, and Light Chasers
     
  16. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Ive been through that site a few times but cannot find anything about lengthening or shortening the fade times, as there are no times stated for the shown diagrams.
     
  17. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    The duration of the 555 (and the formula is shown as part of the schematic) is the duration of the fader. This is explained in the theory of operation. Reading is your friend.

    I have helped a friend develop a sequential fader using a similar technique, complete with PCB layout. It is also posted here.
     
  18. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Maybe a link to the exact page I need to look at could help.
     
  19. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Look at Figure 5.3, it is the base setup.

    Figure 10.4 shows how to do this with high current setups, MOSFET are typically better than regular transistors (called BJT).

    Are you wanting only fade in/out once, or cycle?
     
  20. Roxy2

    Thread Starter New Member

    Jul 4, 2012
    26
    0
    Thanks. I'll have a look at those. The idea is to fade up. Stay on until power removed around 11 hours later when it is needed to fade down. I'm familiar with adapting circuits to run larger powered LEDs via optocouplers. I did that to a project last summer when I converted a 'dice' circuit to run 3watt LEDs.

    I've seen fade circuits but they only fade over a couple of seconds. I can adapt the circuit for power but its the timing I am unsure of. Hopefully I can work something out from the paragraphs you suggest.
     
    Last edited: Jan 6, 2013
Loading...