LED constant current source: Part II?

Discussion in 'The Projects Forum' started by doug3460, May 31, 2009.

  1. doug3460

    Thread Starter Active Member

    Oct 19, 2008
    87
    0
    Hi all. Would appreciate review & suggestions. Bill Marsden recommended I start a new thread. So this is really a spin-off of this thread: http://forum.allaboutcircuits.com/showthread.php?t=18613

    Attachment 1 is a re-draw of Ron H's & Bill's design in the aforementioned thread, since I want to use it on my motorcycle. I've substituted the parts I have on hand, changed the supply to 12V, & included the LED string connection terminals (closest match I could find in Eagle). Please see attachment 1.

    Only thing not shown is a miniature H[​IMG]O proof switch (appropriately rated) mounted in the cockpit. I use a fused, ignition activated, busbar to run all my farkles, so the power will come off that to the switch to the board.

    Bill did ask about the voltage range/fluctuations. I've measured the volts between 11V to 13.8V, but I have seen it go below 11V (at idle w/ several accessories on, primarily High Power Aux Driving Lamps, ECM & heaters, which I've learned to power down at such times) & up to 14.1V (at start-up with power hungry accessories off). But typically it's between 12.1V & 13.5V at cruise & idle.

    Background: I use a lot of LEDs on my bike(s). While not the greatest, I like the T1 3/4 (5mm) Superbrights. The typical Vf is 2.1V, but sometimes it is higher when I use blue, UV (yes, UV, but that's another story ;)), etc.. Naturally, the number of LEDs in a string are adjusted appropriately. I have yet to run any of the LEDs at their max amps, 18mA is nominal. A good example is the license frame. These are typically at 5mA in the run mode, & boost to 18mA when the brake is activated. I use 3000mcd Reds in this application & they are attention getters. I have a major supplier near where I live & the price is right. I typically make my own housings/mounts. Sgt Wookie (especially) & many others on this forum, have assisted me in the past with the two methods shown in attachments 2 & 3, & they work very well (but they have drawbacks which have been discussed in other posts).

    Attch 2 is used to activate combination running/brake LEDs mentioned above. Usually these are on the license plate frame & bags/trunk. Attch 3 is for constant running lights. Sometimes I also use Atch 3 following relays to twinkle running-lights with my turn-signals.

    Anyway, if a look-see can be had for my re-draw of the design, I'd appreciate it. Thanks for your invaluable assistance & time.

    OT: I did learn how to print-screen into MS Paint. Now if I could just learn how to insert it into the darn text. :rolleyes:
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    You know, it occurs to me that you could use the Joule Thief I showed. It is low current, and makes the LEDs pretty voltage independent. How many are you wanting in a chain? You'll need at least 5, but it can handle many more. It's bright too, and very low parts count. It will need a fuse if something goes wrong. And if your battery is drained the signals will work even if nothing else does.
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Congrats on learning the screen-print into MS Paint ;)
    Now after you've uploaded your image, right-click on the underlined name of it, and "Copy URL" - then click on the mountain icon with the yellow background (Insert Image), clear out the "HTTP://", paste in the URL, then click OK.
    [​IMG]
    In this schematic, you're using an LM358N. I'd recommend using an LM2904N instead; as it's the same part except it has a greater temperature range, specifically for automotive applications. This will make your application more reliable. Since the parts are the same layout, just re-label your LM358N as an LM2904N.

    IC1B: Remove the ground from the non-inverting input. Connect the non-inverting input to the junction of R5/R6. Connect the inverting input to the output. This causes IC1B to be in a voltage follower configuration, with the non-inverting input somewhere between ground and Vcc. Connected this way, the output will not be in constant saturation, keeping things cooler.

    For the 5mm LEDs, look in led2.lbr under the LED subdirectory (if you don't have it, download it from Cadsoft's site). There is a LED5MM that has one round and one square pad; the square being for the negative (cathode) terminal.

    I see you have the left side of R3 (the pot) connected to 12v. Is that a regulated 12v? [eta] See my following post on R3's connection.
    [eta] You don't have the high side of the LEDs (or the opamp supply) connected to +12v.

    See Ron_H's comments about wire length/routing in the other thread near the end.

    On to the next:
    [​IMG]
    This will work, but regulation will be rather poor. Select the resistors for operation at 13.8v, so that you minimize the chance of running your LEDs at overcurrent.
    Note that you are missing a junction at the intersection of R1/R2. [eta] The wire is overlapping the left side of R2, Erc will complain about that; move R2 one click to the right.

    Also, if you attempt to create a board from this schematic, the anodes of D1 and D2 will be wired together due to the use of the +12V supply symbol, and you won't have a pad to connect wires to. Instead, I suggest using something from the "wirepad" library; re-name the wire pad to indicate the function (no spaces allowed). Same thing for GND.

    It's fine to use the GND symbol, but be sure that you have a wirepad named GND connected to a GND symbol somewhere on the schematic, or you won't have a pad to connect a wire to in the board layout.

    The LM358N/LM2904N symbol needs to have +V and -V supply symbols present on the board for the implicit power pin connections. You'll need to use jumpers to connect them to wirepads +12v and GND.

    Behind Door #3...:
    [​IMG]
    Ahhh... what'cha doin' with the 4-terminal output on there? You must NOT wire LEDs in parallel on the output of an LM317x that's wired as a current regulator, as one LED will "hog" more of the current until it burns out, and then the domino effect will wipe out the other LEDs.

    If you're running the LEDs at low current, you can use LM317L's (TO-92 package) to control the current in individual strings. You will need a regulator & resistor for each string.
     
    Last edited: May 31, 2009
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I went back to the other thread to read Ron_H's comments because having R3 connected to 12v seemed incorrect; indeed it is NOT correct. If you connect it to 12v, it will cause T1 to conduct, giving the op amp a very low reference voltage, which will turn the LEDs off. So, if you want the LEDs to turn OFF, you can connect it to 12v using a SPDT switch; the other side of the switch needs a low-impedance connection to GND.

    Pot R3 provides a "soft start"; if adjusted to about midway, the LEDs will take about 1 second to turn fully ON.
     
  5. doug3460

    Thread Starter Active Member

    Oct 19, 2008
    87
    0
    Thanks for such quick responses...

    Bill: I hadn't considered the Joule thief, I will review your design & try to incorporate it. I'll post my results so the group can show me how to fix, lol.:D

    Sarge: (Ref pics insert) Ah-ha, so that's how you do it. LOL. Bill had told me to start a new link that referred back to the old one & you should have seen the gyrations I went thru to make that happen, but got it done! :p

    (Ref Atch 1): Will order the LM2904Ns. The LM358 is what I have on hand so I can prototype with it since the pin-outs are the same. Will also make the corrections to IC1B. I will have to download the LED2.lbr from cadsoft, but will do. Like the idea of the different shaped pads. Also, I will post the revision in Eagle Version 4.16. These were drawn in Ver 5 so I could get a general layout.

    (Ref Atchs 2 & 3). These were also quick drawings just to get the idea down for others to see. The resistors are set for 13.8V. I have three of these on my bike - one for the license plate LEDs, two for the saddlebag lights. I don't use a board on the Atch 2 design - I made a jig & solder all the components in one group, then bench test, then seal in heat shrink & silicon. The In/Out lines end in weatherproof bullet connectors. The LED lines also. I simply splice into the primarys & use the connectors to hook it up. That way I can easily disconnect things. Regulation hasn't been a problem & they are VERY visible in both sunlight & darkness.

    Atch 3: You are absolutely correct - it's a single connector. Just wasn't thinking when I put the drawing together. I will correct it. I have four of these on my bike. They are on boards, but placed in a mini-box & sealed once tested. I don't know if it was necessary, but I did mount the 317 on a 1" x 1 1/8" peace of aluminum. They're used as follows: one runs a couple "hidden" UVs aimed @ my gear; one runs a string of LEDs for cockpit lights; the other two are for side-marker lights hooked through relays into my turnsignals so they "twinkle." Haven't had any problems with any of these arrangements, but I know they aren't the most efficient.

    Just for grins, other LEDs are: all turn signals, forward running lamps & instruments.

    I plan on additional LEDs soon (the ones for "show mode"), but that darn 3V drop for the 317N irritates me & it restricts design. I also would like a common hook-up point. So the original thread seemed like a great jumping off point for the project. I actually was going to use the design posted at the OnSemi site until I read the groups' comments on it. Glad I did, since it probably saved me a lot of grief.

    OT: I've concluded phases of my life can be measured thus: Ecstatic to be allowed to mow the lawn because that's what "big people" do. Happy to mow lawns as a source of income. Miserable while mowing lawns as punishment. Obsessed with lawn mowing to beat my neighbor's lawn's appearance. Now I'm in the angry because I can't get the zoning people to let me replace my lawn with colored rocks so I don't have to mow anymore phase. I suppose the next phase will be ecstatic again as I look out a window & watch other people mow lawns knowing I don't have to anymore. ;)

    Will be back when I get the lawn done...
     
    Last edited: Jun 7, 2009
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Here's an example of using wirepads for off-board connections in conjunction with the supply symbols; I threw in the opamp connected as a voltage follower for a bonus:
    [​IMG]

    Note that you cannot connect two supply symbols to the same wire! This will cause a conflict in signal names, and Eagle will complain about it. If you allow this to happen, Eagle will make your life very unpleasant when you try to make a board layout from the schematic. One solution is to use jumpers to connect the supply signals together, as illustrated in the example.

    Exactly where to place the jumper(s) will have to be determined after you begin the board layout, as otherwise you can wind up performing some wild gyrations with trace routings.

    Sometimes it's necessary to use multiple supply symbols due to different IC's having different names for their implicit supply pins; even though the voltage levels might be compatible, unless you have the exact name for the supply pin that the library part requires, it won't get connected.

    "Erc" (Electrical Rule Check) is your friend. Keep Erc happy, and life will be much more pleasant when it comes to making your board layout. Warnings (depending on what they are) aren't too bad. Errors will stop you cold until they're fixed.

    I'm heading out of town tomorrow for a bit over a week, so won't be much help after today.
     
    Last edited: May 31, 2009
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yup, the Joule Thief is another way to go - but you'd need to supply the circuit with a low regulated voltage. If you tried running it directly from 11v-14v, you'd blast the bejeezus out of the LEDs! :eek:
     
  8. doug3460

    Thread Starter Active Member

    Oct 19, 2008
    87
    0
    Apologies for delayed response. While working in the yard last week, tried moving a landscape bolder without a back-brace :eek: (forgot I was a score older than when I could do such things without one, lol), so have been on the mend.

    Using my time wisely :)rolleyes:), I redrew the circuits for the two schemes I have been using for some time on my bike. This gave me the opportunity to use some of Sarge's suggestions for wirepads. Atch 1 I deliberately left off the resistor values, since they are really dependent on the Vf of the LEDs in use & the mA output desired. Atch 2 is the "standard" 317 in 20mA current mode. I also took the time to begin to learn how to use the PCB functions in Eagle (which isn't as easy as I thought it might be - I've decided Autoroute isn't always my friend).

    The other thing I've been doing is researching PWM & LEDs since Bill had recommended a Joule Thief as a possible solution. Then Sarge added that as designed, it wouldn't work for 12V. :(. Darn. More research...

    Then I found this jewel (pun intended) that the Sarge had posted some time ago for simple PWM:

    [​IMG]

    Since the 4093 needs 5V to operate, can that be supplied by separate line off the Vcc? So when I draw the circuit, I would have Vin splitting, one line to a regulator side for 4093 & the other to the LED string(s)/MOSFETs? The "logic" here is that I would still be able to regulate the LEDs, but with at least 10V from Vcc going to the MOSFET, I could add an extra LED or two to the string. Also, wouldn't a 10K resistor tied to ground on the Vin of the MOSFET be needed to ensure it turns off?

    Just curious if this a possible way to go (that would also permit dimming if desired).
     
    Last edited: Jun 6, 2009
  9. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The 4093 can run up to 16v. However, you'd really be better off using a 555 timer, as it can source/sink a good bit more current than a 4093 (about 100x as much). That makes the MOSFETs' gate turn on/off much more quickly.
     
  10. doug3460

    Thread Starter Active Member

    Oct 19, 2008
    87
    0
    Sarge - Below is a drawing you modified in a different PWM thread that you & Bill were working on - is this what you had in mind? I wasn't sure since the 12V isn't "clean" in my application (we've been figuring 13.8V as typical, which I knew the 555 could handle). Also, from what I read in that thread, Vcc is the same for both the 555 & the MOSFET, correct? Also, I figure where the load is indicated, that resistor is removed & an LED string goes there.

    [​IMG]

    OT: Regarding the 4093, I thought Vin was limited to 5V, while Vdd could go as high as 16V. So I was thinking I had to drop the voltage for the Gate's Vin (which I wasn't sure how to incorporate into the previous post's drawings).

    I just thought there'd be a few less components with the 4093 method, plus the availability of 3 extra gates to run 3 more MOSFETS for extra strings. That would have met the goal of a common tie-in point for the strings.

    Regardless, the 555 is fine & Bill's idea of the Joule Thief might work too using a 556 (assuming I can locate the inductor - don't want to make one, :p) if I can re-configure it for my "12V" system.

    As always, thanks for the assist.

    Doug
     
  11. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    Actually, if you read the post I recommended 5 LEDs, which was over the voltage minimum. If you use a small coil (low inductance) and/or short charge cycle for that coil that could be compensated for nicely, no voltage regulation needed, nor low voltage. You just need more LEDs than the max battery voltage will turn on, after that its tweaking on the design, and is still fewer parts than other ideas.

    It was just a thought, I wasn't wedded to it though.
     
  12. doug3460

    Thread Starter Active Member

    Oct 19, 2008
    87
    0
    I've reworked the two 555 concepts we've been considering. I did attempt to apply the concepts to a 556, so I hope I got it close.:rolleyes:

    Atch 1 has the MOSFETs which will allow for two LED strings (I think! :D).

    [​IMG]

    Atch 2 will only allow one string, but an additional light or a higher Vf. Not sure I understand the advantage in this case of using a 556 since there is still only one output, and the inductor concerns me.

    [​IMG]

    I've also loaded the Eagle 4.16r2 schematics. Any review would be appreciated.
     
    Last edited: Jun 8, 2009
  13. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I'm not sure what I'm seeing on the first drawing. Are you trying to eliminate the resistors altogether, and not use a coil?

    The joule thief uses the inductor to kick the voltage higher. The reason no coil is required is because once the coil discharges the LEDs turn off. The pulse feed to the LEDs is very narrow, and self limits it's current due to the characteristic of the coil.

    If I misread what you're doing, never mind.

    The second picture I recognize, but it has a problem. You LED Vf must add up more than the motorcycle power supply (13.6V). 5 Red LEDs add up to 10.5V, which means they will all promptly conduct fully, taking out the LEDs and the coil. When I said 5 I was thinking white, for which I'm sorry. (5X3.6V=18V). The first 556 section isn't really needed at all, unless you want the LEDs to flash for some reason. You can also use the reset line (pin 4 on a 555) to turn the arrangement on/off.
     
    Last edited: Jun 8, 2009
Loading...