Author Options:

Simple on/off delay switch circuit Answered

Here's what I am trying to do. I am already controling 4 LEDs with a 9 volt zener regulator. I now want to control the source of the regulator (ie voltage from the battery on board my motorcycle) with an electronic switch. Not a big deal, but I also want the voltage to the LEDs to ramp up slowly so that when they initially turn on, they are dim, but get brighter and brighter until they reach their 9 volt regulated source. Then when I turn the motorcycle off, they fade slowly until all the way off. So I guess is what I want is a delay switch. Should I be switching the 9 volts regulated to the LEDs or should I switch the source to the regulator? What is the cheapest and easiest way to do this? Any help would be appreciated. Thanks.


9 Replies

splitreaction (author)2009-04-21

I've done this before and I gotta say it is really easy and looks awesome afterwards.

Using 555 timers and PWM is the right way to do it if you want full control and reliability. But honestly its much more than you need.

Lemonie is right a Big capacitor will do the trick, but what you need to do is find the right capacitor with the right voltage threshold and capacitance.

Now you have a 9V supply so you will need a capacitor rated for at least 9V (I would recommend 20V as a safety)

A cap charges in a nice little ramp. When it reaches the top it will be 9V so your LEDs will be in full brightness. While it is charging the LEDs will glow brighter and brighter until it is 9V. When power is removed the cap will discharge through the LEDs until there is no more current.

So how do you determine how long it takes to charge or power up?

Well you need to figure out the time constant. (RC) just take the resistance times the capacitance and that is a time constant. Lets say you choose a 10Ohm resistor in series with your LEDs and a 1 Farad capacitor. The time constant would be 10. It takes around four time constants to charge so in 40 seconds it would be ramping up from dim to bright. and it would take the same 40 seconds to power it down.

Here is a time constant calculator

And here is an informational site on capacitors. (also where the graph comes from)

Remember to determine how long it takes it going to be The resistor times the capacitor times four.

Now if you're really bored check out my instructable

I'm using the heat from a toaster oven to make that LED glow every time it gets hot and dim every time it gets cold. You could throw a cheap peltier element and a joule thief and the LEDs would glow as your motorcycle warmed up and dim as it cools down. Best part about it. Its free if you power it from you're exhaust. Feel free to pm me for details or better yet vote for me :-)

Select as Best AnswerUndo Best Answer

Motoman9 (author)splitreaction2009-04-21

AWESOME! Thanks splitreaction for all the info, very through. I especially like the video. This definately meet my criteria for being simple. I guess I was over thinking it. Maybe I will post a video of my project when it it finished. Thanks again splitreaction and have a great day.

Select as Best AnswerUndo Best Answer

BaggerV (author)2009-04-20

Just a thought off the top of my head. You may be able to rig some sort of photo-diode setup where the diode has a higher resistance with low light source but when introduced to increased amounts of light the diodes internal resistance is lowered. Just throwing out ideas but if you wanted to get creative and could figure something out that would probably be the cheapest way.

Select as Best AnswerUndo Best Answer

Motoman9 (author)BaggerV2009-04-20

Thanks Bagger V. The more ideas the better. legionlabs got me to thinking about op amps, so I pulled some text books and searched the internet and found some useful info on using op amps. I'm still searching and undecided, so keep the ideas coming. Thanks.

Select as Best AnswerUndo Best Answer

legionlabs (author)2009-04-19

I'm not ultra-familiar with zener regulators, but PWM and a microcontroller seems like the most obvious (and boring) solution, rather than trying to ramp up the voltage.

You might also be able to do it by daisy-chaining two 555 timers, one in astable, the next in stable mode to generate the pulse width modulation. Any steady increase or decrease in the stable-mode 555 pulse length should give you dimming control so long as your power supply won't be bothered by it, and you choose a reasonably high frequency for the 555 in astable mode. It remains a challenge to *control* this circuit, which is why a microcontroller might be a nice solution.

Finally, instead of a big capacitor, you can use an op-amp to simulate a big capacitor in less space.

Select as Best AnswerUndo Best Answer

Motoman9 (author)legionlabs2009-04-20

Sounds like some great ideas. I am hoping for a cheap easy idea. I've been searching some books I have for ideas. I wonder how the automotive industry acheives this dimming action? The courtesy lights in my car fade out as they shut off. Do they acheive this through use of the cars on board "computer"? I especially like the idea of using an op-amp in place of the big cap. Space is limited in my application. I must fit this circuit and the regulator circuit in a space of about 2" X 2". Thanks for your input. I had not thought of use of 555 timers.

Select as Best AnswerUndo Best Answer

lemonie (author)2009-04-19
Motoman9 (author)lemonie2009-04-19

Sure that would work for the off portion, but I still wonder what I could do for the on portion of my project. I still want the LEDs to come on slowly and get brighter and brighter until their input voltage reaches a certain point. Almost like a transistor conducting more and more until it finally saturates. I need some type of transistorized circuit. My automobile has courtesy lights that do the exact thing I want. I wonder how the automobile industry acheives this delay. Probably some type of specialized IC.

Select as Best AnswerUndo Best Answer