1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Fading LED's with a delay

Discussion in 'Modding' started by Gman22, 14 Nov 2006.

  1. Gman22

    Gman22 What's a Dremel?

    Joined:
    15 May 2004
    Posts:
    82
    Likes Received:
    0
    Hello,

    I'm trying to help out a friend. He is powering a few of these from a 12v car battery.

    After the car is turned off, he wants the LED's to stay on for approximately 20 seconds, and then fade out over a 5 second interval. What is the easiest way to do this?

    One idea I had was to use a PIC 12F675. I would hook the 12v from the into a 78L05 to get 5v, and hook that into an input on the PIC. I could then set up a loop to check when the input goes low, and then maybe run a wire from the fuse box to get 12v when the car is off.

    How could I get the LED to fade out? Capacitors?

    Thanks for any help,
    Gman22
     
  2. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    Last edited: 14 Nov 2006
  3. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    you could always shove a cpacitor in series with the positive line in the circuit, its inaccurate though, you would have to do trial and error, and it wouldn't do exactly what you want it to do, it would kind of fade out as soon as the power was cut off, the length of the fade would depend on the capacity of the capacitor.

    jakenbake's 555 timer idea is probable better, you van get those at maplins - try order code QH66 or RA76

    dragon2309
     
  4. Gman22

    Gman22 What's a Dremel?

    Joined:
    15 May 2004
    Posts:
    82
    Likes Received:
    0
    Alright, I researched the LM555 a little bit, and I think what I need for the delay is a monostable oscillator circuit. Correct me if I'm wrong.

    How can I detect when the power from the car is shut off? Would transistors work some how?

    Thanks,
    Gman22
     
  5. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    If you know how to program a PIC12F675, then you can easily program some software PWM to control the brightness, or even easier - use the 12F683 and use the built in CCP module...

    However, I wouldn't rely on a 7805 on it's own. The automotive environment is just too noisy - you'll see high voltage peaks in excess of the maximum ratings of the 7805. Have to be a bit clever when designing the PSU to reject any HF high voltage content.
     
  6. LuitvD

    LuitvD What's a Dremel?

    Joined:
    13 Aug 2006
    Posts:
    263
    Likes Received:
    0
    correct me if i'm wrong, but the LM75xxC series is rated at a maximum of 35V, as long as the heat it produces doesn't get it to more then 150 degrees C... do you think a car's power supply will spike up to 35Volts?
     
  7. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    It's widely known you get peaks as high as 60V while the car is running. I actually found some peaks in excess of that with my DSO. It's a terribly noisy environment. You'll see if you open up any car stereo the amount of filtering where the power enters.
     
  8. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    theres a +12V ignition wire going to the stereo to tell it to shut off when you turn the car off. its the same thing aftermarket amplifiers use to turn on and off.

    edit: maybe this is a cleaner voltage than straight off the battery?
     
  9. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    The 12V ignition wire will still be noisy. You could possibly use an optocoupler to avoid getting spikes at the input.
     
  10. trailblazer

    trailblazer What's a Dremel?

    Joined:
    10 Nov 2004
    Posts:
    131
    Likes Received:
    0
    There are probably kits you can buy for this, that would be the easy option, pcb, components etc. If I was building it from scratch though, I might look at a decent +5 volt regulator with some hi pass/lo pass filtering, and say a zener diode with resistor across the main supply rail (+12v) to reduce spikes and noise to the 5volt reg, although they are pretty good at rejecting noise anyway. then a NAND gate with one input tied high and the other to the switched 12 volt line (this would have to be dropped to 5 volts before going into the chip) so when your ignition is on you have two high inputs which will give a low output,then, when the ignition is switched off (and you have a high and low input) the nand will give a high output (might need an inverter here as I think the trigger input to a 555 is active low or use an AND gate). Configure the 555 for the time delay you want, then use the output to drive a power transistor which will turn on the led, a large capacitor across the led supply should give you a fading effect. Never tried it, without getting right into it thats my thoughts, there are probably lots of ways to do it. Anyway,whatever you build or install make sure its well wired, safe and fused properly and all that good stuff. Cascade more 555 timers and power transistors for more leds.
     
    Last edited: 16 Nov 2006
  11. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    One problem here is these LED fittings are built for a car supply so the 10 LEDs will be hard-wired in some series/parallel arrangement in the tube. PWM will certainly dim it, but if you can find how the light level varies with voltage when supply is reduced from 12V down to dark there may be simpler ways.
     

Share This Page