Build Your Own LED Turn Signals!

Discussion in 'Electrical' started by likearock111, Mar 8, 2008.

  1. likearock111

    likearock111 Guest

    Hey all,

    I figured that posting an easy how-to for the electronics behind making your own LED turn signals might be helpful to some people. I'm trying to make this post a good balance between simple, educational, and fun to build. To all you Electrical Engineering buffs out there, be forewarned that the circuit I drew up to share is a little overly simplistic (couple optional resistors missing, etc.), but it will work just fine for our purposes. Also, I'd just like to say that this is pretty basic and has probably all been done before by someone else, so I'd just like to let you know that it's not very original. But it does work great!

    Hope someone can get some benefit out of this! Feel free to question away.


    How to Build your own LED Turn Signals

    You will need:
    - 2x medium-sized 12V LED modules. I got mine at AutoZone (kind of like this one), but you can find them all over the net. What you're looking for is a red or yellow housing that contains maybe 5-10 LEDs. There should be 2 wires sticking out of it. Just about any type that fit this description will work.

    - A means for powering your LEDs. For this how-to, I'm assuming that you have a 12V SLA battery like I do. This setup should also work for 6V systems, although I've not tried a "white wire" setup before.

    - 2x N-channel MOSFETS with sufficient current and voltage capabilities. I used International Rectifier's IRLML2803 (datasheet here), but I wouldn't recommend them, for reasons I'll explain later. If you don't know what MOSFETs are, don't worry. We'll get to that later, and they're easy to work with - I promise.

    - 1x astable multivibrator or oscillator. I used Texas Instruments' CD4047BE in astable mode (datasheet here), but a standard 555 timer could also be modified to fit the system. Again, don't let the terminology freak you out. We'll clear all this up in a bit.

    - Wire, solder, soldering iron, multimeter.

    - 2x Dual-pole, Dual-throw switches, one resistor, and one capacitor (details below). RadioShack has them.


    So, I guess now would be the time to dive in. First of all, let's think about what we're trying to do. What I was shooting for were two tail lights that, when connected to the battery, were always on, except when I wanted to turn. When turning, I wanted to be able to flip a switch and have one of the two lights go from always on to flashing.

    That means that we need to be applying 12V to each of the LEDs continuously, then throw a switch and apply 12V to one of the LEDs intermittently and the other continuously.

    So how can you do this? Well, imagine two parallel ways of powering the LEDs. One way is 12V constant, and the other way is 12V/0V intermittently. The switch changes which of the two powering methods the LED is connected to. Now would be a good time to bring up the circuit.

    Astable Multivibrator
    In the lower left part of the circuit diagram, there is a block (an "integrated circuit") in the lower left labeled "CD4047BE". It's called a "multivibrator," and it is currently set up to run in "astable" mode. Now, this is really just a bunch of fancy-schmancy lingo that EE's came up with to make their jobs sound complicated :). All it really means is that if you watched the voltage at pin number 10, the voltage would go from 0V (ground), to 12V (high), then back to 0V, then back to 12V... for as long as you have it set up this way and are giving it power. That's why I labeled it with an up-down square wave. It's called "astable", because it never stays at the same voltage - it keeps on switching back and forth.

    So what determines how fast the voltage goes back and forth? Well, basically, there are two circuit components - a resistor (actually a potentiometer in the diagram) and a capacitor - that determine the frequency at which the voltage at pin 10 goes back and forth. The capacitor is going between pins 1 and 3, and the potentiometer is going between pins 2 and 3 in the diagram.

    So how do you actually control the flashing frequency? Well, resistors and capacitors have certain values associated with them that quantify how they will behave if you put them in a circuit. Let's say that R = resistance and C = capacitance. In order to get a certain flashing frequency, you need 1/(R*C) to be, say, F (for frequency). You could have R be really big and C be really small, R be really small and C be really big, or R and C both be medium-sized, and you could get the exact same F. Therefore, the way the diagram is set up, you can vary R from very small (a few ohms) to somewhat large (3 kilo-ohms), and C is fixed at 100 uF. This allows you to dial the frequency value in by changing the R through twisting the knob on the potentiometer. For you circuits-minded people out there, this is on page 3-135 of the CD4047BE datasheet linked to above.

    The other two most important pins on this integrated circuit are pins 7 and 14. 7 is where you attach 0V (GND), and 14 is where you connect +V (12V in this case).

    CD4047BE Pin Recap
    Pins 1-3: Attach resistor/capacitor to determine flashing frequency
    Pins 4-6: Connect to V+, to "tell" the IC you want it to run in astable mode
    Pin 7: This is the GND pin of the IC, where you should connect 0V
    Pins 8-9: Connect to GND to "tell" the IC you want it to run in astable mode
    Pin 10: This is the output of the chip, going back and forth between 0V and 12 V
    Pin 11: Do nothing
    Pin 12: Connect to GND to "tell" the IC you want it to run in astable mode
    Pin 13: Do nothing
    Pin 14: This is the V+ pin, where you should connect 12V

    I get all of my circuit components from Digikey or Jameco. I provided Digikey links above.

    LED Current Draw

    You may be wondering why, now that we have a component that will output a flashing 12V/0V/12V/0V signal, we don't just hook 'er up to the LEDs and go. Well, as it turns out, the astable multivibrator isn't capable of actually powering the LEDs directly. In circuit-speak, the astable multivibrator isn't capable of sourcing enough current to operate the LEDs, even though its output voltage is just right.

    Now I'm sure you're thinking, "So HOW much current do you actually NEED to power the LEDs?" Good question. :) We need to figure that out now.

    First, put your multimeter on the "mA DC" or "A DC" setting. To be safe, start with the highest current setting your multimeter has and work your way down. Also, be sure your multimeter probes are plugged into the correct holes (this is really easy to switch up). Black goes into "COM" or "GND", and red goes into "mA" or "A".

    Next, attach the red wire (or positive lead) of your LED module to the red (+12V) terminal of the battery. Attach the black wire (or negative lead) of your LED module to the red probe of your multimeter. Attach the black probe of your multimeter to the black (0V) terminal of the battery. Your LED should light up, and your multimeter should be displaying the amount of current going through it. This is the amount of current you should pay attention to when selecting your MOSFETs. Mine turned out to be 60 mA for each of the two 5-LED light modules I went with.

    N-Channel MOSFETs

    So what the heck is an N-channel MOSFET? Well, for the sake of this project, its just a glorified switch. That's it. I swear. The only thing special about this switch is that instead of controlling it with a physical lever or pushbutton, you can control it with voltage! So, if you give it a high voltage (but not toooo high), it "closes the connection" (current can flow through it freely), and if you give it a voltage right around 0V (GND), it "opens the connection" (no current can flow through it). Unlike a relay, nothing mechanically opens and closes. Instead, the voltage applied to it changes the conduction properties of the materials inside. No moving parts? Even better!

    Because we can control this "switch" with a voltage, we will use the output of the astable multivibrator mentioned previously to control its operation!

    A MOSFET has three connections (terminals): a Gate, Drain, and Source (labeled with G, D, and S in the diagram). The gate is the pin where you apply a voltage to control the switch. As a result, we'll eventually hook pin 10 of the astable multivibrator directly to the gate of both MOSFETs (<EE's grit teeth in anguish>:p). When the "switch" is closed, current is allowed to flow from the drain to the source. Therefore, we'll put the drain-to-source path of one MOSFET in the current path for one of the LED modules. Then when the astable multivibrator outputs 0V, the LEDs will be "off", and when the astable multivibrator outputs 12V, the LEDs will be "on".

    As I said earlier, I picked International Rectifier's IRLML2803, due to availability. I wouldn't recommend this particular MOSFET to anyone, because it is a surface mount component (basically, it's super-tiny and kind of hard to hand-solder to without good equipment). Therefore, you'll need to pick yourself out a couple. Here is what to look for:

    1. Get one in a nice big package. Any of the through-hole form factors listed on this website (down at the bottom) should work great for you. This will make soldering sooo much easier!

    2. Pick one that can handle the current levels you need. Remember that LED module current measurement we did earlier? That's the one. Your MOSFET needs to be able to have a "continuous drain current" of at least 120% of the measured current. This is often labeled as "Id" in datasheets.

    3. Pick one that can handle the voltage levels you will require (12V). This means that the maximum "gate-to-source voltage" (Vgs) and the "drain-to-source breakdown voltage" (Vdss normally) BOTH need to be at least 15V.

    4. Make sure that the threshold voltage will work. The threshold voltage is the exact voltage between the gate and the source where the MOSFET switches between "OPEN" and "CLOSED". Typically, this is around 1V. You need it to be somewhere between 0V and 12V.

    Just to point you in the right direction, take a look at International Rectifier's IRF1503. It should be able to handle just about anything you could throw at it. I'd order from Digikey.

    So, just to recap where we're at, we now have the two LEDs flashing continuously and in sync at a frequency that we can control with a potentiometer. Now we need to get them to only flash sometimes.

    DPDT Switches

    A DPDT switch has two throws, which move in tandem, each between its own two poles. Instead of trying to explain why I designed the switch setup the way I did, I'll just walk you through the circuit behavior.

    If DPDT#1 is in its current position, there would be no positive voltage connected to the astable multivibrator, meaning that it would not be outputting its flashing waveform. Additionally, the D terminal of MOSFET #1 would be connected to ground, applying +12V directly to the LED module. Therefore, LED #1 would be on continuously.

    If DPDT#1 switches to its other position, +12V would be applied to the astable multivibrator, causing it to power on and output the flashing waveform to both of the MOSFETs. If DPDT #2 were in its current position, LED#2 would still be on continuously (D term. of MOSFET #2 connected to GND). However, because the D terminal of MOSFET #1 is not grounded any longer, LED #1 would flash on and off in time with the output from the astable multivibrator.


    So... that's it, really. Two independently-controlled turn signals. And it only took 2 types of IC's! If you decide to give this or something like it a try, feel free to post questions. Good luck!

    Last edited by a moderator: Mar 8, 2008

  2. likearock111

    likearock111 Guest

    Circuit diagram

    Here's take two on the circuit diagram.

    Attached Files:

  3. gone_fishin

    gone_fishin Guest

    ok...i'll say, i so wish i understood this because it looks like the real-deal! what an informative, detailed post, i'll surely be trying to find a local friend who is willing to take this on...

    likearock111, thanks for a great contribution, i hope we can find some minds willing to help develop this into a layman's ready-wired universal system, that would rock (pun intended) :cool:
  4. cooltoy

    cooltoy Member

    Wow, so much to read, so much to understand , it's midnight, I think I'll save this for the morning. Great thread likearock!
  5. azbill

    azbill Active Member

    very nice 'how-to' !
    thanks :D
  6. likearock111

    likearock111 Guest

    Thanks, guys! If anybody has any questions, feel free to post them, and I'll try to answer them as best I can. As a side note, anyone looking to learn a little more about circuits may want to check out All About Circuits - it's a great reference, especially for beginners.
  7. spad4me

    spad4me Member

    Thevenin's and Norton's theorems are too much like work!

    My brain does not like this. Thevenin and Norton are bad for me.

    How about a boosted zener circuit to trickle charge a 6 volt battery.
    Lead acid, Nicad, or Nimh.
  8. hot70cc

    hot70cc Guest

    lol i stopped reading this until i seen the first direction of 2x medium-sized 12V LED modules lol. I'm sure it is great setup, but i go with hands on not by directions lol. I'm sure someone on hear will find this very helpful. Great direction though A+++
  9. gone_fishin

    gone_fishin Guest

    6v whatchamacallwhat? maybe for another thread/project...let's please don't distract from this one :)

    'rock, you have any ideas about spad's notion? another brain-numbing post would be cool ;)
  10. eltatertoto

    eltatertoto Guest

    like a rock, after reading this about 3 times, im still pretty much clueless lol. my biggest question---in that diagram, that is a circuit board right? and i know you took tons of time to write this, but would it be possible to do a 1st hook this thingy ma bobber to this doohickey ect ect so peeps like me that are clueless can figure it out? thanks. if this is not possible i found a set, but it would cost 40 bucks for front and rear lights.... and i gotta do this on 2 bikes.

    oh, and aug.. if i could figre this out, i would be MORE than happy to make kits, but i would need to figure how to do it 1st :)
    Last edited by a moderator: Mar 9, 2008
  11. likearock111

    likearock111 Guest

    Hey Spad4me,

    Although I haven't had a ton of experience designing battery chargers, I think I get your drift as far as using a "boosted zener" diode - you're thinking of going the BJT route? At any rate, I'd need to see a schematic of exactly what you're thinking, but whatever you end up with, you need to be sure that the applied voltage/current output of the charger tapers off as the battery recharges. Batteries have optimal "quick charge" and "floating" voltages, so I'd be sure to take a look at those for whichever battery you decide to go with. I'd actually point you toward this SLA charger design. Although I haven't done this build personally, the author takes a lot of good things into consideration, and I'd bet you'd do just fine following that lead. Good luck!
  12. likearock111

    likearock111 Guest

    Hey eltatertoto!

    That's an excellent question about the diagram. If by circuit board, you mean something like this, then the answer is yes... sort of. :) Actually, it's kind of a mix between what the circuit components would look like from an "aerial view" on a real-life circuit board (the CD4047BE) and the circuit symbols that are commonly used to depict circuit devices on paper (the resistor as a squiggly line, the capacitor, the LEDs as triangles with a line, the DPDT switches, etc.). Think of this diagram more as just an on-paper representation of the circuit, not as an actual depiction of what the circuit board would look like. In fact, when I did this, I didn't even use a green circuit board - just wire and solder.

    As for the step-by-step description, I can definitely do that. I won't have time to do it tonight, but I should be able to get to it this week. Hopefully that will help in understanding exactly what needs to be done.

    Glad you asked!
  13. eltatertoto

    eltatertoto Guest

    thanks, and i already am getting a battery like that one for my radio project. but if i send kits, i dont think its legal to ship lead acid batteries. what with all the terrorist carp. so if i make kits yous guys will have to buy yr own batts. but i might make options as to what box you want and such. i might even mount the board near the battery, and use 2 boxes so you wont have a huge box on yer bars. but i think ill wait till ya get the step by step up, cause i dont want to bother my dad, its just starting to warm up and my dad is on his vacation, and hes trying his dangest to get the harleys ready, within his 10 day vacation. he bought tons of new stuff over thhe winter.
    Last edited by a moderator: Mar 10, 2008
  14. likearock111

    likearock111 Guest

    Step-by-step instructions

    Here are step-by-step instructions on how to make the 12V LED turn signal setup described in the first post. These instructions aren't designed for understanding the circuit; they're really just for helping people put the pieces together properly. Let me know if you have questions.

    1. Go buy:

    - 2x 12V LED modules of your choice. (don't get too crazy here - the circuit is designed for a generic LED setup, not a 4,000,000-lumen LED searchlight...)
    - 2x RFD3055LE N-channel Mosfets from (0.79 USD each) -datasheet here-
    - 1x CD4047BE Multivibrator from (0.48 USD each) -datasheet here-
    - 2x DPDT switches of your choice (what you'll be switching to turn on and off the turn signals). Radioshack is a good bet. They can be bought from Digikey, but I like to see/feel a switch before I buy it.
    - 1x 100uF electrolytic capacitor - go to RadioShack, or tack one onto your Digikey order
    - 1x 2-3 kOhm trimpot/potentiometer/variable resistor/whatever else you'd like to call it. Nothing fancy here. I'd get one for $0.50 at Radioshack. Will probably have 3 pins, but might have only 2.

    ORDER EXTRAS - THEY'RE CHEAP! If you've never soldered to integrated circuits before, you should definitely buy extras. Prolonged exposure to the soldering iron's heat can damage them, so be careful!

    2. Solder pins 4, 5, 6, and 14 of your CD4047BE together (see diagrams), and solder a wire coming off of one of these pins. These pins will all be connected to +12 V eventually. Check for continuity of these connections using a multimeter in resistance-measuring mode. Put one multimeter probe on the free end of the wire, and move the other probe from pin to pin. The resistance measurements should be 0 ohms or very small (<<10 ohms).

    3. Solder pins 7, 8, 9,and 12 of your CD4047BE together, and solder a wire coming off one of these pins. These pins will all be connected to 0 V (GND, the negative side of the battery) eventually. Again, check for continuity of these connections with a multimeter.

    4. Determine the pinout of your trimpot/potentiometer/etc. Basically, you need to use your multimeter to identify two pins (normally of three pins total) between which the resistance changes when you twist the knob. Normally this is the middle pin and either of the two outer pins. By spinning the knob, you should be able to change the resistance you're measuring from ~0 ohms to the max for your potentiometer (probably 2-3 kOhms).

    5. Solder one of these two pins on the potentiometer (you identified these in the previous step) to pin 2 on the CD4047BE, and solder the other pin to pin 3 on the CD4047BE. You may want to use wire for this, you may not.

    6. Identify which one of the two pins on your 100 uF capacitor is the positive pin. If you didn't buy an electrolytic capacitor, don't worry about this step. If you did buy an electrolytic capacitor, one of your capacitor's lead wires is probably longer than the other one. This is the POSITIVE one. Also, there may be markings on the plastic wrapper of your capacitor indicating the lead polarity. In my original schematic (from the first post), you will notice that half of the capacitor is shown as curved, while half of the capacitor is shown as straight. The curved side of the capacitor is the negative side, and the flat side of the capacitor is the positive side.

    7. Solder the POSITIVE lead of the capacitor to pin 3 of the CD4047BE, and solder the NEGATIVE lead of the capacitor to pin 1. You will note that your potentiometer is also soldered to pin 3 (step 5). Try not to damage the solder connection you already made.

    8. Make sure you know which pins are what on your two Mosfets. These are labeled with "S" (source), "D" (drain), and "G" (gate) in the images I attached to this post.

    9. Using wire, solder the G pin on each of the Mosfets to pin 10 on your CD4047BE.

    10. Using wire, solder the S pin on each of the Mosfets to the connection you made earlier between pins 7, 8, 9, and 12 on your CD4047BE (step 3).

    11. Solder the negative wire of one of your LED modules to the D pin (middle pin) of one of the Mosfets. Also do this for the other LED module and the other Mosfet.

    12. Use a multimeter in resistance-measuring mode to determine the operation of the six pins on each of your DPDT switches. You really need to understand how a DPDT switch works in order to do this. In general, the two middle pins are the throws, and the four outer pins are the poles. If you're having trouble with this part, post a question.

    For each of the two switches:

    - Throw #1 should be soldered to ground.
    - Throw #2 should be connected to +12 V on the battery.
    - When the switch is in position A (arbitrarily assigned), throw #1 should be connected to pin D of one of the Mosfets. Throw #2 should be connected to nothing.
    - When the switch is in position B (the OTHER position :)), throw #1 should be connected to nothing. Throw #2 should be connected to the connections you made between pins 4, 5, 6, and 14 on your CD4047BE (step 2).

    13. Finally, connect the positive wire of your LED module to +12V on the battery.

    -- I almost forgot to mention that if your turn signals are flashing really quickly or really slowly, you need to twist the knob on the potentiometer until they flash at a speed you like.

    -- Also, as an optional suggestion, I usually cover the small, fragile connections between components in a hefty layer of hot glue when I'm done. It protects the solder joints both from shorting to other metal objects and breaking under stress. Just be sure your circuit is working before you do this :).

    All of these connections should be identical to what is drawn in the original schematic, so if you're having trouble conceptualizing what it should look like, head there.

    Good luck!

    (sorry I picked such a long name when I joined... "Rock" is much easier to type, lol.)

    Attached Files:

    Last edited by a moderator: Mar 10, 2008
  15. eltatertoto

    eltatertoto Guest

    rock, thanks a bunch for doing this.... i will read once the fumes leave my head lool, i just patched a tank, in a shed, and i wasnt about to open the door cause i had the heater on..... soo once my fume induced headache goes away ill read it. i have been out there since noon doing various things,... and it is 950 now :shock: wow! 950, it jhust hit me how late it is as i typed that! holy carp! 10 hrs ive been in that danged shed! wow i need to get a clock out there. sorry about side trailing.

    EDIT: rock, i just read it and i find it VERY easy to understand, and now, after reading it, i am confident it is possible. i just gotta get a soldering iron and a multimeter. all i have now is a carpy cold heat p.o.s. melts solder my azz!

    i have had experience soldering. i used my dads iron to make this little circuit board starter kit that in the end made a fan blow and an led blinked. to learn to solder (he wanted me to learn so i would know how to do stuff like this)

    oh, and congrats on becoming a member, and not a jr.member rock!
    Last edited by a moderator: Mar 10, 2008
  16. likearock111

    likearock111 Guest

    Excellent! And I totally agree with you about those "cold-heat" gizmos. Definite carp, plus the current used to heat the tip can accidentally fry your circuits.:-/
  17. eltatertoto

    eltatertoto Guest

    oh! rock, i almost forgot. if i were to hook up front ones also, i would just splice into the led lights' wires, after all is wired and hookes up, right? thanks.
  18. eltatertoto

    eltatertoto Guest

    i will be buying everything tommrow. i will buy 5 of everything (except batterys), and 7 of the multi thingy so i will have 3 kits ready to go from the get-go. (mabey 2 depending on if i hook one up to my racing bike.) but i definately will not be making these in bulk til i get orders. i dont wanna waste my money (or what little i have) but if i get a system going, i promise ill be making lots of kits in the future.
  19. likearock111

    likearock111 Guest

    Right. Instead of having one LED module going from +12V to the D pin on each Mosfet, you would have two LED modules going from +12V to the D pin on each Mosfet, in parallel. The only thing this now introduces into the situation is twice the current going through each Mosfet ("continuous drain current", labeled Id). I picked these Mosfets out for a good balance between better-than-needed properties and low cost, and they can handle an Id of up to 11 amps. Each LED module should draw about 60-80 mA of current, so you should be around just 2% of max.

    Keep us all updated with your progress - I'm interested to see what you think of the circuit!

    PS - don't forget to buy 10 Mosfets!
  20. eltatertoto

    eltatertoto Guest

    thanks again rock! it wazs a silly question, but i wanted to make SURE. i might even wire an led into the board for each switch, so i know when the lights are on.