Switching lights with turn signals

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
shotgunefx
Posts: 20
Joined: Mon Mar 08, 2004 1:01 am
Contact:

Switching lights with turn signals

Post by shotgunefx »

I've been working on a lighting system for my car that consists of RGB LEDs (So I can change the color manually or eventually drive off other inputs).<p>What I'd like to do for the lights on the hood, is have the appropriate side light flash orange with the blinkers. <p>Basically what I am trying to achieve is that when the turn signal is high, it disconnects the normal R,G,B(0-5v) for the appropriate side bulb and feeds the R and G lines 5v and disconnects the B line.<p>My first though is 3 relays but is their a simplier, more compact way? <p>Thanks,<p>-Lee
User avatar
haklesup
Posts: 3136
Joined: Thu Aug 01, 2002 1:01 am
Location: San Jose CA
Contact:

Re: Switching lights with turn signals

Post by haklesup »

How much current do you need to light each unit (one color, one lamp assy). You may be able to drive them directly with logic chips. You can get the rules about which lights go on when (using logic) and the drivers in the same circuit. If you need more current, a transistor buffer (inverting current amplifier) can be used to boost the drive current. <p>If you use 4000 series CMOS devices, you can run at 12V else a 5V regulator is easy to implement or obtain seperately. Your logic array would have inputs from the turn signal switch, brake pedal, reverse switch, headlights and any others you need to select the mode and outputs to each color at each lamp location. It could all be combinational if the flash pulses were generated by the car's flasher circuit otherwise you can generate a new flash clock with a 7555 locally at your circuit. Depends on how much isolation you want from the car's systems. (local clock lets you adjust the flash rate)<p>If you plan to use doorpost switches or other manually activated switches, you may need to buffer or debounce them to avoid false signals and you should include double diode protection to the CMOS inputs to prevent accidental electrical overstress. (two diodes in series from 12V to ground positioned so that both are reverse biased. Place the input on the node between the two diodes. Now no voltage greater than 12V or less than ground can get to the pin from the outside world.) Build the basic ckt first without then add protection after you blow a few parts up.<p>You will need to express your design like this:<p>If Signal Switch = Left and mode = amber then flash light 1<p>Or:<p>Left AND ModeAmber = Output LED 1 AND pulse
Right AND ModeAmber = output LED 2 AND Pulse
Left AND ModeRed = LED 3 AND Pulse
Brake AND ModeRed = BrakelightLED
Headlight AND ModeAmber = LED1 AND LED2
Headlight AND Left AND ModeAmber = (LED1 AND Pulse) AND LED2
etc and whatever. you may have many statements<p>From these booleen experssions, you can then design the combinational logic. Check out any basic logic text or email me with the equasions and I'll try to help more. Theoretically you could do this with only NAND gates. <p>I'm sure you could do it with a basic stamp or PIC as well for only a little more effort and cost you would have more flexibility over plain logic and could implement animated flash sequences or mix colors more easily by changing code. Just choose a device with sufficient inputs and outputs.<p>If the LEDs are arrayed and take lots of current, or if you want to do it with incandescent lamps you can still buffer the logic outputs with relays and use whatever voltage and current load you want (within the relay contact specs of course).<p>If you want the LEDs to have variable intensity you can AND the output with a fast clock pulse and modulate the light on and off down to the desired brightness. It should be a fixed frequency and variable duty cycle. A ~1 Khz square wave with variable duty cycle should produce a nice dimming effect with no flicker. This is PWM and is much easier than making a variable voltage or current source for each output. This technique can also be used to overdrive an LED to a higher current (and thus brightness) without leaving the safe operating area of the device (power is I*V integrated over the time it is active). See appnotes from LED and LED display manufacturers for more ideas in this direction.
shotgunefx
Posts: 20
Joined: Mon Mar 08, 2004 1:01 am
Contact:

Re: Switching lights with turn signals

Post by shotgunefx »

Thanks for the input. This is my first undertaking and it's been through so many revisions. I figured it was a good learning project that I could keep extending.<p>The red and green only draw 20ma each so if I have two on each side (which is the most I'm expecting) I would think I could get 80ma easy from the chip.<p>Currently I'm only looking two drive it off the blinker when it's hot. (The lights are powered off a 317T based 5v regulator currently)<p>I'm planning on replacing the 3 RGB pots with an astable/monostable 555 PWM circuit. (That's next)<p>After that's done it will be PIC learning time and I'll most likely redo the whole thing yet again. <p>A couple of things I'm hoping to do.<p>Modulate the lights to my stereo (when I'm not driving)<p>Dim the green and blue when the RPMs climb to make the lights burn red with the revs. (I'm been futzing with a LM2917 for this)<p>Thanks again for the pointers.
shotgunefx
Posts: 20
Joined: Mon Mar 08, 2004 1:01 am
Contact:

Re: Switching lights with turn signals

Post by shotgunefx »

I had an idea on an alternative way of wiring the turn signal into my RGB leds and I was hoping that somebody could tell me if it's an inherently flawed idea.<p>Bear in mind that I am new to electronics and I really don't know what I'm talking about (yet anyway).<p>What I'm trying to do, more or less is I have 2 RGB (common cathode) leds with each leg supplied by a 5V power supply.
The intensity of which are controlled by 3 pots (one on each feed).<p>What I would like to do is wire them to my car directionals so that when the direction bulb is on, the R and G lines get 5V and the B gets 0V. I'll need to draw about 80ma max.<p>Could I tap off the directional + wire (For now assume it's around 13.5V) to the Red and Green with a 5v Zener diode in series
and another tap to a comparator which would be wired such that when the directional is hot, it outputs 0V? (I know some comparators have problems near the top rabge of the supply) <p>I'm thinking the big problem would be to prevent voltage leaking from the RG led feeds to the directional bulb. Would the Zener prevent this reverse current or would I need another diode?<p>I would assume the other problem would be the potential for a reverse voltage to travel the R and G lines. Could I put a diode (schottky?) on each feed to prevent this?<p>If this is in anyway hairbrained, please feel free to tell me so. From my limited understanding it seems like it would.<p>Thanks for the help.<p>If anyone is interested BTW, here are some pics<p>Image<p>Image
User avatar
haklesup
Posts: 3136
Joined: Thu Aug 01, 2002 1:01 am
Location: San Jose CA
Contact:

Re: Switching lights with turn signals

Post by haklesup »

Have you considered powewring the LED from the cars 12V (13.5V) supply directly. All you need is a bigger resistor than you would for the 5V option. And there is no reason that the resistor cannot include a pot (I would put a pot in series with a resistor so I could not dial it to too low a resistance) Just put the LED and R in parallel with your turn signal lamps.<p>The Zener is not required and neither is 5V for that matter. (select devices for your supply V, not the other way around) The brightness of a LED is a function of current. A minimum current will light it and a maximum one will burn it up. The manufacturer states something in between. Since in any diode, current is a function of voltage (and don't get me going on curve tracing, that's my thing) we tend to think of the voltage drop as being more important but in fact the operating point is V and I and thats what you gotta hit.<p>A typical LED might be spec'd at 1.4V, 80mA. Now if your supply is 12V you need a resistor that will drop (12-1.4) 10.6V and flow 80mA V=IR R=10.6/0.08 = 132.5. For brightness control use a 120 ohm resistor in series with a 20 ohm pot. Plug in your numbers. <p>As for the blue, simply power it from a seperate switch (dome light might be a reasonable choice)<p>"Directionals" You must be from the east cost, when I use that term in CA, people look at me funny (me = former Bostonian)<p>BTW I think this is the first post I have seen with a photo. Why don't we all do this more often?<p>[ April 15, 2004: Message edited by: haklesup ]</p>
shotgunefx
Posts: 20
Joined: Mon Mar 08, 2004 1:01 am
Contact:

Re: Switching lights with turn signals

Post by shotgunefx »

Thanks for the input. Hopefully this won't come off rambling but I'm starting to get over my head so bear with me.<p>The lighting system is already all installed and runs off 5V (a 317T regulator). This is my first project and I ended up making many running changes. If I had to to it over again, I would do 12V but some of the LEDs are hard to get at and I'm not opening them up again. (Not for awhile at least) It's taken a lot of frustration to get it this far and I'd like to enjoy it for a bit before I do any serious modifications. :) <p>What I'm basically trying is modify the lighting circuit by the action of another existing circuit in the easiest way that won't cause damage or major retrofitting.<p>What I want to do is when the directional is hot, to pull a segment of R + G high (5v) and B low. When current isn't flowing through the directional, it would work in the normal fashion getting it's power from the existing supply. (Which could be anywhere from 0-5V for each line controlled by 3 pots cut into the dash)<p>I don't want this to effect any of the other lights inside the dash or on the side opposite the operating directional. If I'm taking a right and my lights are green, I want the left exterior to stay green and the right to blink between orange and green with the directionals.<p>My first thought was a transistor using the directional as the base, but the R + G lines might be turned down or off (say the lights are blue) so I might not have the 5v I need. My understanding is that I can't use transistors to just make more power if it's not there. Then I considered and dismissed relays (though I'm thinking about them again, more on this later)<p>So I started thinking that there should be more than enough power in the directional. But it's 12~13V. I supposed I could use a resistor to get the needed current or an IC regulator, but what about the current already there and how do the voltages interact? If the directional has a higher voltage in reference to R, will it flow backwards through R? From my very limited understanding, an appropriately rated zener would regulate the voltage and being a diode, hopefully stop current from R (or G) from flowing into the directional when it has a negative voltage relative to R. Then I could use a comparator to wired to the directional to ground blue.<p>But I've looked a bit more into relays and it seems like it might be an easier solution.<p>Do you think I could use a 3 Pole Double Throw relay? It seems like that might be the easiest route. <p>BTW, I'm from Boston, but I'd normally say Blinker but I didnt' know if that was an east coast thing.
Thanks,<p>-Lee<p>[ April 16, 2004: Message edited by: Shotgun ]</p>
User avatar
haklesup
Posts: 3136
Joined: Thu Aug 01, 2002 1:01 am
Location: San Jose CA
Contact:

Re: Switching lights with turn signals

Post by haklesup »

You said a lot but I think this was the crux of it " What I want to do is when the directional is hot, to pull a segment of R + G high (5v) and B low. When current isn't flowing through the directional, it would work in the normal fashion getting it's power from the existing supply. (Which could be anywhere from 0-5V for each line controlled by 3 pots cut into the dash)<p>First, the second part. You are presently biasing the RGB LEDs from a circuit at 5V. This must be a real simple 5V supply with pots in series with your LED segments. Right so far?<p>Now you want to sense the 12V pulsed signal at the turn signal lamp and use that as an input to change the way the LEDs light.<p>As far as bringing the 12V down to a 5V that is compatible with whatever logic you might create, you can use a resistor voltage divider. For example if 500uA is an acceptable loss then the total resistance should be V=IR or 13.5=.0005(R) or R=27K for a 5V split, the bottom resistor needs to be 5=.0005(R) or 10K and the top one needs to be 17K. Now you have 5V at the node between the resistors you can put on an IC input.<p>Skipping how you might make logic to do this, A relay might be the easiest way to go. The relay would need to simultaniously disconnect your LED from the 5V dimmer circuit and connect it to either a 12V blinker voltage with appropriate dropping R or to another 5V circuit.<p>There are probably several ways to use either a SPDT or DPDT relay to do it (one of each side) or 3 relays, one to disconnect, two more to flash.<p>Since you want to toggle between (RG bright, B Off) and (RGB Dimmed) states try this: <p>Image<p>When the signal is activated, it closes a DPDT relay that opens the circtuit to the B LED on one pole and connects 13.5V to the R and G LEDs. An additional diode is inserted to prevent current from the car supply from going into the 5V supply when that node is flashing. The relay toggles between 12V and open because this node cannot be grounded which is what the turn signal Line would do without this relay.<p>I wouldn't worry about sending curerent into the car blinker circuit, more likly to damage your 5V supply or fry an LED if it is overloaded. Use a regular diode if you want to limit the direction of the current, Zeners are good for setting a reference but not always advisable to use for load regulation if the current is high.<p>"understanding is that I can't use transistors to just make more power if it's not there." No you cannot violate a law of physics but you can amplify the power of a signal so long as the output power does not exceed the power of the source that is powering it.<p>On second thought, here is a simpler circuit without the diodes or 12V
Image<p>[ April 19, 2004: Message edited by: haklesup ]</p>
shotgunefx
Posts: 20
Joined: Mon Mar 08, 2004 1:01 am
Contact:

Re: Switching lights with turn signals

Post by shotgunefx »

Thank you for the detailed response, haklesup.<p>When no one responded initially, I decided to forge ahead. I ended up using 1 2PDT and 1SPDT relay for each side. I put another 317T regulator at 5v for power (for amber). I didn't want to run another 5v lead through the firewall as it was really hard<p>After much testing, everything went fine. It worked great and looked great until...<p>*Sigh*, when I was installing it (It was already hooked up but not in it's case), in it's case, I must have somehow made an unintended connection because somehow I blew out all the red LEDs. Somehow 12V must have went back through. I think because red have a lower voltage the short burst of current destroyed them but not the Red and Green which have a 4V max. <p>So know I have to replace all the bulbs :(
I'll probably start fresh and use a 12V supply<p>The hardest part of all of this was soldering and wiring the LEDs. Some of them are in extremely tight spaces. So I've got to keep it extremely compact.<p>Do you think I could use Molex KK connectors or similar (like a pc fan)? If you (or anybody) has a recommendation for small connectors (4 lead), or techniques to make it easier, I'd greatly appreciate it. I've seen 2 lead LED solderless connectors but I've not seen 4.<p>Thanks again for the help.<p>-Lee
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 12 guests