Announcement

Collapse
No announcement yet.

LED strobe circuit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LED strobe circuit

    Not really carputer related but I figured this is a good of place to post as any. I have yet to find a strobe set up just like I want it so I decided to make my own with a simple 555 circuit and a couple rows of LEDs. Unfortunately my knowledge of circuits is limited. Here is a circuit I pieced together with the help of a website:


    Now this will be used with the car's 12v system so instead of a 5v source it will be a 12v with a voltage regulator to drop it down to 5. A few questions about this -

    1) Will pin #3 be a constant 5v? In other words can I hook up say 20 LEDs in parallel without an issue, granted there is the correct resistor?
    2) When adjusting the blink rate is it better to change the 2 resistors or change the capacitor?
    3) Radioshack seems to have a few different capacitors, can anybody recommend a good online source for different capacitors/chips? (I have the LEDs under control)

    Thanks.

  • #2
    vpogv, before I start, please understand this is only constructive criticism, and is in no way meant to discourage you from trying to build your own hardware.

    I recommend, if you would like to get into this sort of thing, that you go to Radio Shack and get the book on simple 555 circuits. Also, get a breadboard and play around with the resistance and capacitance values until you get it right. Oscillating analog circuits are finicky, and you'll find what you think should work (logically) won't work at all.

    I rigged up a setup involving a 555 timer to do modified headlight LEDs in a late '90's Cavalier. It worked out well, but I've long forgotten most of my 555 knowledge as I now deal with microcontrollers. Also of note, my 13.8VDC power supply was a great prototype power supply, but in the car, the blink rate was almost double that of when the exact same board was on the power supply, so keep that in mind.

    A 7805 will take the 11.x-14.x volts from a car and regulate it to 5v, but remember to factor in how much current you'll be pulling out of it. The standard 7805 regulator package will almost surely burn up without any heat sink on it at that voltage, depending on current draw.

    To answer your question about how many LEDs you can light from your 555 output pin, you have to think current, not voltage, on this one. Each LED will take, depending on your LED and current limiting resistor, 10-20mA to power. While your assumption about putting a number of LEDs in parallel is correct on the voltage side, you need to know how much current your 555 timer can source. My bets are that it won't be able to reliably power more than about 2 LEDs before it lets out the magic smoke.

    You can, however, take the output of your 555 timer and feed it to the base of an NPN transistor. Considering you are using 12V from a car battery, and (I'm assuming approximately) 2V LEDs, you could wire 5 LEDs in series powered from the 12V input, and use the output of the 555 timer to the base of the transistor. Connect the negative of the last LED to the Collector of the transistor, and the emittor of the transistor to ground. Use a 100Kohm resistor between the timer and transistor, and the whole row should light. Current required is also negligable, and you should be able to do this 4 times over and create your 20 LEDs from one 555 timer.

    Also, Mouser (http://www.mouser.com) or Digi-Key (http://www.digikey.com) are an excellent source of electronic parts, and will give you a lot more options for parts if you know what you're looking for. Starting out on a breadboard, Radio Shack can get you in the ballpark. Get the capacitor and resistor bundle packs and experiment, or get an electronics book and figure out why changes to the resistance and capacitance make the delay change.

    If you need help, PM or IM me and I'll try to help you out. Or, for a small fee, I can make you something, just give me the specifications. I can make a bunch of different LED display options.

    Comment


    • #3
      Thank you for your help on this. This is my modified circuit:


      Just to make sure I will need a transistor for each 'row' of LEDs I put in and a seperate 100k ohm resistor coming from the #3 pin, correct? Will the resistor coming from the #3 pin change depending on what transistor I use?

      Thank you again for your help.

      Comment


      • #4
        The 555 timer circuit wiring notwithstanding (as I said previously, I don't exactly remember where the support components need to go to make the 555 function as a clock pulse generator), the circuit looks ok except for one point. You have the 12V going to the LEDs (via current limiting resistor) on the left bank, but on the right bank you have it going to the base of the NPN transistor. The left bank is correct, you'll need to change the right bank.

        It probably doesn't matter if you take the output of one 100k ohm resistor and split it to both transistor bases, or if you use separate resistors. I personally use separate, but it probably doesn't matter. As far as what transistor you use, the packs of general purpose NPN transistors at Radio Shack are fine. You don't need anything special to use them in this method. Remeber that PNP transistors will NOT work in this method. 3904-style transistors are what you're looking for. (standard NPN model transistor, though there are tons of other numbers out there).

        What you are doing with the transistor is using it in "saturation" mode, and it functions like a switch. This switch drops approx. 1.4V because of having to go through two diode junctions (typically 0.7V per junction), which is why if you use 5 2V LEDs, and the transistor drops 1.4V, the 12V feed will work quite well. The general rule to working in saturation mode is that the base of the transistor should have either 1/10th or 1/100th of the current applied as the collector (can't remember), so a 100k resistor should work well. If you find that's not enough to trigger the LEDs, you can lower it, but it shouldn't take much more current than that.

        To set this up on a breadboard, I recommend building the circuit in stages. Hook up your 12V power, 5V regulator, and then build the 555 timer as you had in your original drawing - just to make sure you get the timer to actually function. After that, on a separate part of the board, experiment with resistor values for the LED chain you created. The actual way to calculate the current limiting resistor would be: R(cl) = (V(in) - V(led1) - V(led2) - V(led3) - V(led4) - V(led5) - V(q1))/desired current. So, for example, if your LEDs are 2V LEDs (typical with many high-output models), and it takes 1.4V to use your transistor switch, and you wish for the max output of .02A (also typical).. assume a max voltage of about 14V, and you end up with 14-11.4 = 2.6/0.02 = 130ohm resistor. Also, after you get that to work, experiment with what resistance value is needed to trigger the transistor - try 100K from the output of your 5V regulator (simulating the 555 timer turning on) and work from there. Actually, I forget the formula, but if what I remember is correct, 25k should be optimum (1/100th of the current of the C-E path). Also remember that these values are starting points, and I'm assuming characteristics of components that I can't verify, so plug your own numbers in and go from there.

        Once you get started doing this, you'll want to create a ton of different designs. If you want to get really fancy, and have at least a little bit of programming knowledge, look into getting a BASIC Stamp II setup. The normal one comes with 16 programmable outputs (which you can hook up in sets just like your 555 timer, or make each LED separate), all digital technology, and you don't have to play with capacitors and resistors to get your timing right. PWM (Pulse Width Modulation) and digital logic can make your display come alive - everthing from fades to sweeps and whatever else you could want to do. This is the microcontroller for hobbyists who don't wish to learn the more complex circuitry and programming of a commercial microcontroller. They are a bit pricy, but great fun to play with.

        Comment


        • #5
          that diagram is flawed........
          Lez, more widely known as flez1966

          Comment


          • #6
            Originally posted by lez
            that diagram is flawed........
            Where?

            Comment


            • #7
              Originally posted by lez
              that diagram is flawed........
              Fixed I do believe. Had the right transistor wired incorrectly.

              Comment


              • #8
                Let me know how your circuit turns out... good luck!

                Comment


                • #9
                  Calmor - for the 100k resistor, would I be ok with a 1/4watt or should I get a 1/2watt to be safe?

                  Comment


                  • #10
                    Now that I looked at some of my old projects, I used a 10K ohm resistor for this instead of a 100K ohm resistor, and did so reliably without failure of any of my digital (5V) outputs or transistors over extended periods of time and extended temperature ranges. You may find that 100K will trigger the base, you may find that it will only trigger some transistors, or you may find it won't work at all. I *almost* guarantee 10K will work.

                    In any event, to calculate wattage, use the P=I*E formula (Watt's Law), where P is power (wattage), I is current (amperage), and E is voltage. To do this with only the voltage and resistance, Ohm's Law of E=I*R (R being resistance) can help. Replace the I in P=I*E with E/R, and you come up with P=E/R*E or P=E^2/R So, with a 10K ohm resistor and 5V digital trigger signal,

                    P=5^2/10,000
                    P=25/10,000
                    P=.0025W (1/400)

                    Therefore, even 1/8th watt resistors are fine for base bias resistors.

                    The idea is that the base is biased to allow electrons to flow through the transistor. You don't need much current to start the N-electrons from the emitter flowing to the naturally P-biased base... thus turning the transistor into an entire N-region, and allowing the electrons to flow through. Removing the positive voltage at the base turns the transistor back to NPN, thus causing the electrons to not flow freely though the device. This is only one (and probably the simplest) application of a transistor.

                    Your 130 ohm resistors on top, however, will probably need to be a higher wattage:

                    P = I*E

                    P = (current of LEDs, assuming 20mA) * (max voltage, assuming 14V)
                    P = .02 * 14
                    P = 0.28 (1/3.57)

                    This shows that you'll actually need slightly larger than 1/4W resistors to run 20mA and 14V. Assuming maximum values to ensure you don't start a fire under your dash, I'd go with 1/2W resistors here. Either that, or go with a higher (ohm) value resistor, which will lower the current and therefore lower the power requirements. This will also dim the LEDs some though.

                    Comment


                    • #11
                      555's are fun. But with a PIC you can do really neat stuff with LEDs. Patterns, alternating and more. I have several projects like this I designed on my webpage. I currently have a PIC18F252 based "nightrider" design breadboarded with waterclear blue LEDs. Neat and BRIGHT!

                      Here are the projects I have posted: http://www.ke4nyv.com/picprojects.htm

                      Comment


                      • #12
                        Originally posted by KE4NYV
                        555's are fun. But with a PIC you can do really neat stuff with LEDs. Patterns, alternating and more. I have several projects like this I designed on my webpage. I currently have a PIC18F252 based "nightrider" design breadboarded with waterclear blue LEDs. Neat and BRIGHT!

                        Here are the projects I have posted: http://www.ke4nyv.com/picprojects.htm
                        Do you have a video of your emergency vehicle flasher? That sounds like what I'm trying to do. Except the way i was thinking was to build the 2 strobes and then just alternate power either by a simple relay or another 555 timer.

                        Comment


                        • #13
                          Originally posted by vpogv
                          Do you have a video of your emergency vehicle flasher? That sounds like what I'm trying to do. Except the way i was thinking was to build the 2 strobes and then just alternate power either by a simple relay or another 555 timer.
                          I'm sure I can come up with somthing for you. I'm working on a function switch that will make it flash in 3 or 4 different modes.

                          Comment


                          • #14
                            vpogv,

                            You could alternate by using an inverter before the input to one of your LED banks (but not the other) if you only want to do two steps.

                            KE4NYV,

                            Do you program your PIC in its native (assembly) language, or do you have a high level programmer/compiler? I'd suggested the BASIC Stamp II earlier because of it's BASIC front end language. It actually is a specialty PIC. I use mostly 18F452s in my designs, which is typically overkill, but I have a bunch of them lying around. Unfortunately, I never took the time to learn the assembly language. I'd dabbled in it some years ago. I have a BASIC front end language for it, which made programming and designing much easier - it basically lets you program any PIC like you would a BASIC Stamp.

                            Comment


                            • #15
                              Originally posted by Calmor
                              Do you program your PIC in its native (assembly) language, or do you have a high level programmer/compiler? I'd suggested the BASIC Stamp II earlier because of it's BASIC front end language. It actually is a specialty PIC. I use mostly 18F452s in my designs, which is typically overkill, but I have a bunch of them lying around. Unfortunately, I never took the time to learn the assembly language. I'd dabbled in it some years ago. I have a BASIC front end language for it, which made programming and designing much easier - it basically lets you program any PIC like you would a BASIC Stamp.
                              No, I started in Hi-Tech's C compiler, they used to offer a limited processor version that always worked. They then moved to a full featured, 30 day trial version so I stopped using it. I now use Microchip's own C18 compiler for the 18F parts. They have a 30 trial, but at the end of the 30 days only the optimization is reduced but code still compiles. I have made several futile attempts to learn assembly and it just does not click with me. I will go back now and then and tinker, but I still cannot do anything of substance.

                              I'm like you, I get comfortable with one and I stick with it. Just like using a PIC18F252 for blinking LEDs, WAY overkill. I have it running at 20 MHz. I'm also working on a project right now talking to a KS0108 based graphic LCD using a PIC18F252. I have run into a wall because the KS0108 does not have an onboard Character ROM generator, so I had to do them by hand with a 1 dimensional array. I have that completed, but the compiler cannot handle an array over 255 bytes, so I have to figure out a way to get the whole table in.

                              Comment

                              Working...
                              X