Driving LEDs with a battery pack

Fine, have it your way - you add a chosen voltage supply, choose a resistor to work in an active device and then tell the world you are only controlling 1 variable.

Reply to
David Eather
Loading thread data ...

The OP is brand new to the world of electronics. He wants to hook an LED to a battery and have it work. He needs to know ohms law to calculate the resistor he needs but was under the mistaken impression that he cannot control the two variables out of three that he needs to to calculate the third variable. He was also under the mistaken impression that controlling one variable was enough and all he could do. (the fallacy of this is somewhat illustrated by having to make a repeat journey to the store after "letting the smoke out")

Your example of a LM317 is and is not valid. The 317 is an integrated circuit using complex transfer resistors (transistors) and a sense element (the external resistor) to control the needed the resistance of the main transfer resistor (I am using that word because you may be glossing over what a transistor is) to, in that configuration, control the current through the sense element. You also added a power supply. Hence you controlled 2 variables to control the third.

Anyone with some experience simply makes the normal assumptions about the operation of the 317, as you do, and treats the 317 as a black box. Which is fine and dandy if you have the basic info - which the OP did/does not.

The result was a guy who didn't understand a simple problem with and ohm's law solution and responses that assumed he had knowledge that he did not, and those responses further compounded his error.

I am a graduate of QUT (electrical engineering). One of my student assignments would become the most plagiarised in the Faculty's history, being resubmitted, almost unchanged for 12 straight years. I worked as a senior technician at QUT for over 10 years. I have articles published in Silicon Chip magazine sufficient to allow me a full membership to the Australian Society of Author. I'm old, cranky and out of touch, but I still know a little of electronics.

Reply to
David Eather

So *that's* why it didn't work when I put it back together yesterday... !

I tried my variable resistor and it makes a bit of a difference in brightness. I looked at it with an oscilloscope and the resistor changes the pulse frequency.

If you dial it too low the circuit makes a scary whistling sound. A tiny bit more and it shuts off.

I did six LEDs and it works but quite dim. I tried two batteries and it's a lot brighter (maybe twice) but still far less bright then a single LED. In my informal 'point it at the wall' test all six together were only putting out about the same amount of light as a single LED at 10mA.

Unless this can be improved I'm not sure the JT is the circuit for me.

(I tried three batteries and the transistor died. I went back and checked the temp with two batteries and yes, it was quite warm...)

I was using insulated wire because that's all I had. Do you think the magnet wire fix (or at least help with) my brightness problem?

The 60kHz number was from one of the web pages. I measured about 40kHz.when I had the 'scope connected.

Reply to
fungus

That looks almost too easy (and the LM317 price is right).

Would it work for multiple LEDs?

Reply to
fungus

I knew it was too easy - minimum input voltage is 4.2V

Reply to
fungus

To answer my own question:

(Assuming it would work with less than 4.2V input, which it doesn't)

It would work for (eg.) six 20mA LEDs if you put the LEDs in parallel and set the output current to 120mA.

Reply to
fungus

That is a good price. Jameco lists the LM334 at .59 cents each.

I too wonder about the parallel use of LEDs. Stands to reason they won't all drop the same voltage so some may hog more current to their detriment . . . yet it seems a lot of designs call for it.

I notice that some of the 5 chip led lights have a forward drop of ~3 volts @100 ma suggesting that they are in parallel.

formatting link

Reply to
default

hehe.

Yeah. The frequency gets well into hearing range.

Pulse width goes down as the LEDs stack up. It doesn't get better that way. But at least it works!

The computation of the peak current actually requires some reading of the datasheet for the transistor, though you can approximate an overly high estimate without much information.

I_peakmax = Beta*(N*(V_battery - Vcesat) + V_battery - Vbe) / R_base

Note that the transformer's primary or secondary value in Henrys doesn't factor into this. What it affects is how long it all takes. So if you are hearing a terrible racket, that may mean your primary has too high a value. To fix that, unwind some windings. That will reduce the inductance (which goes by windings^2.)

You can see that R_base has a definite impact. So does the battery voltage.

To make much reasoned use of the above equation, N is the ratio of windings: base winding count / collector winding count. If that is 1, which it probably is close to, then N=1. You can boost the peak by increasing that winding ratio a bit. But the risk is that if you wind the ratio too far, during OFF time for the transistor the base voltage will be driven even further below the emitter. More than 5V below and it is likely the transistor will break down. So you need to be careful here. If you are using a 1.5V battery only, you may be able to go to N=3 or N=4. If you are using higher voltages, then N=2 might be a better limit. This is why just keeping N=1 is so safe. It aids battery voltage, which is good, but not so much as to risk the transistor.

As a 0th order aproximation, I'd use Vcesat that is equal to Vbe and beta of 200 (for 2N2222 [which is typical], maybe a little more for a

2N3904.) What happens very near turn-off on the transistor is that the collector current rises along a clean ramp determined by the collector winding inductance and the battery voltage (V/L is the rate.) But meanwhile, the base current remains largely flat (slightly declining for most of the time.) The ratio of the two, Ic/Ib, is the beta. At the first of the ON time, that's basically very close to zero and during which Vce on the transistor is very close to zero volts. But eventually, as Ic increases, this beta value increases past 1 and grows towards some transistor limiting value (say 200.) During this later transition point, Vce also rises. By the time Vce reaches Vbe, the beta is pretty close to 200 on a 2N2222. Maybe a little less. But in that area. So let's assume Vbe is about 0.8V and therefore Vcesat is the same. That should get close.

Assuming N=1 and Vbe=Vcesat, the equation becomes:

I_peakmax = 2*Beta*(V_battery - Vbe) / R_base

With a 1.5V battery (fresh) and a 2N2222, an estimate becomes:

I_peakmax = 2*200*(1.5 - 0.8)/ R_base = 280/R-base

With R_base=2800 ohms, that would be 0.1A peak. But as the voltage droops, so does the peak current:

I_peakmax = 2*200*(1.1 - 0.8)/ R_base = 120/R-base

In that case, with 2800 ohms, to about 43mA. Less than half.

Note that nowhere in the above equations is the transformer inductance. That mainly affects frequency. To speed it up, use fewer windings. To slow it down, more. Too fast and the transistor won't keep up. Too slow and it will blink or hum.

Higher battery voltages will improve your duty cycle, too, because the time during which the LED is on is determined by the difference between the required LED stack voltage and the battery voltage divided into the inductance. Higher battery voltages reduce the difference and thereby increase the time. So you might try doing that, just so long as you stay underneath the LED stack's voltage and DON'T risk destroying your transistor's base-emitter junction. (Adding some protection there might be a good idea, now that I'm thinking about it.)

There is another problem I forget to mention (I'm just a hobbyist.) The transformer might get saturated. This really becomes a problem when you are using low frequencies. So one idea is to REDUCE your windings! See what happens.

It probably can be, though I haven't considered your exact situation and I probably need to do some playing, myself, before passing along some ideas. I'm short on these green LEDs (zero), so I need to get some, first.

Ah. Well, there is that. But actually, I'm guessing you may have zapped the base-emitter junction by the reverse voltage. One possibility here is to protect that junction by a reverse oriented diode across it. (Okay, I need to think more about that.)

To be honest, I'm not sure. I think that mostly affects just how much inductance you can wind.. but not much else. When I said "better" I just meant that you have a wider range of choices in winding.

Okay. That suggests that you are about right, to me. I wouldn't reduce your windings much, then, unless you do that in conjunction with reducing your base resistor value. Cutting down the base resistor value increases the peak current. But getting there takes longer. Making that take less time, while keeping that lower value resistor, means cutting down the inductance on the transformer's collector winding. So the two kind of go together.

Jon

Reply to
Jon Kirwan

I think they are well covered, though. Shipping will be very cheap (two stamps, at most, I think.) Parts cost should be under $1. So the rest is for 'handling', such as carefully breaking out those tiny board pieces and packing and sending them out, etc. And in any qty, the parts go way down in cost, which I'm sure they enjoy. But yes, it's very sweet of them to provide a nice kit of parts for low cost like that.

I've been professionally involved in helping LARGE companies that produce LED products bin them by color and brightness for their customers. I have at least SOME feeling for just how much variation there is between LEDs from the exact same wafer! It shocked me just how much when I first was learning about it. I had a completely opposite opinion when I was more ignorant about it. Now, I'm pretty cautious having had that experience. I wouldn't want to wire them up in parallel. Even if they came from the same wafer.

By the way, the human eye is VERY sensitive to color variations, too. Especially away from the red end. Even slight variations in peak can be picked out with shocking ease. And customers DO complain about it

-- especially if they are paying real money. So what I did was to help bin LEDs on both apparent wavelength AND apparent brightness -- two axes. That way, when a customer bought a batch they could be assured they'd all look close to similar in their products which used more than one nearby each other.

I got "This page may have moved or is no longer available."

But that's possible. Of course, they might also have some super fancy circuit, too.

Jon

Reply to
Jon Kirwan

Not a good idea to put LEDs in parallel. It can result in burning out each of the LEDs. A constant current source feeding parallel LEDs does not control the current through each individual LED. The current drawn by two or more LEDs in parallel does not necessarily divide equally. LEDs are non linear devices, and do not operate the same way resistors do. You need to limit the current through each individual LED to less than the max rating. For a common LED rated at ~30 mA MAX, 20 mA is a good figure.

Ed

Reply to
ehsjr

You could try this:

formatting link

set it up as a voltage inverter, and connect the LED's between the +ve voltage and the -ve voltage via 330 ohm resistors one for each LED)

From the specs. you have given this will drive 5 LEDs at 17ma - 21ma with new batteries and with the batteries discharged to 3.3v (your spec.) the same LEDs will run at 10ma - 11ma (compared to 0ma - 6ma for connecting directly to the supply via 180 ohms)

There are lots of pin compatible substitutes for the CAT660.

Reply to
David Eather

The link worked for me just now. I dumped the browser cache and reloaded the page.

ebay store by the same vender:

formatting link

I got some RGB LEDs from them months ago.

Reply to
default

OK, another round of experimentation.

I reduced the number of windings. Fewer turns definitely makes it brighter. I got down to four turns and I was like, "dude, one less turn and it'll be there!"... but when I got down to three it stopped working.

Now, my ferrite ring is about an inch across - much bigger than the ones on the web pages. Would a physically smaller transformer with better wire let me raise the frequency that last little bit...?

See pic here:

formatting link

(FWIW, the frequency was about 250kHz at four turns)

Yep. I'm back on three batteries again because the difference in brightness is huge.

With three batteries and four turns my little transistor heats up rapidly and would probably only last half a minute if I left it switched on. I assume I can get a higher wattage transistor to fix that problem.

... or maybe there's another fix.

It gets brighter with every turn I remove! See above.

It's getting closer. If I can up the frequency a little bit more and solve the transistor overheating problem we could be there.

Here's my LEDs lit up:

formatting link

On the right is a green LED running at 20mA, you can see it's putting out way more light than all the others combined.

I'm using a mixture of colors in my little test circuit - white, red, green, blue

Changing the base resistor value has very little effect in the three battery/four turns version. If the resistance gets too low the LEDs actually get dimmer.

Reply to
fungus

Yep.

That's a massive difference. Would never have imagined that from such a small difference in internal tolerance. It would definitely be visible in a "point them at the ceiling test".

Volts bad, current good.

I"m starting to believe...

Reply to
fungus

Hey, that guy's got some real macho LEDs...!

eg. 33000 mcd red ... 2.0V @ 20mA: 70000 mcd blue ... 80000 mcd green ...

I could put some of those in my joule thief and not worry too much about achieving full brightness - half brightness would still be fairly blinding.

Wonder if he'll do me a grab bag of assorted colors...

Reply to
fungus

Those volt-seconds are killing you. Saturation of the core, my ignorant hobbyist self tells me.

Hehe. It had to happen at some point! Imagine what zero turns would have done for you, otherwise!!

Egads! That's a whopper!

I don't know just yet what's better here. The smaller core will likely saturate out earlier and that's not the right direction. I'm beginning to understand why those 60Hz transformers weigh a ton. (More cross section is better.) But it would be smaller.

I'm wondering about the core material itself, though -- iron? Or ferrite? For higher frequencies, eddy currents become murder and the ferrites that insulate lots of the little bits stomp on the currents. But it's like lots of little air gaps, which can dominate the reluctance.

In this case, the transformer is being used for two things -- each of them in a bit of contrdiction to the other, as I understand it right now. It's being used to boost the battery voltage as seen by the base of the transistor (the voltage across the collector winding creates a rate of flux change that is 'seen' by the base winding as aiding the battery voltage.) For that, you want your basic transformer thing that does NOT store energy but provides a low reluctance path to transfer it to the base circuit. On the other hand, when the transistor turns off and the collector winding (might as well call it the primary, I suppose) is left flapping in the wind, you want stored energy that is now dumped via the LED. For that, it's more like a flyback thing (if I'm not abusing the term.) You _want_ energy stored in the magnetic field so that you can recover it now. So now a nice high reluctance air gap looks good to store the energy without worrying over saturation issues.

However, the base doesn't require a 100% transfer of power. It just needs access to the voltage to help drive a small base current (low power.) So perhaps the air gap approach would enhance the situation without a lot of sacrifice on the benefits of boosting what the base sees for voltage.

Makes me wonder a little about slicing a nice thin (sub-millimeter) wafer out of that donut you have so that there can be good energy storage without saturation issues.

Here's a good place for some magnetics guru to chip in. I'm getting out of my depth.

Yeah. Which is pushing things. What was the base resistor value?

You are probably pumping some serious current through it.

Larger transistors will have lower beta, probably. So that will reduce your peak current. Plus, they are probably slower. You might also consider some means of heat-sinking or finding something in a TO-220 package (but with good beta) -- which makes adding a heat sink very easy, plus the package is already pretty good.

Yes. But that may actually be because of saturation in the core, itself. It turns out that it is the area underneath your volt curve (volt-seconds, Webers, etc.) that saturate the core. With low frequencies, the applied voltage hangs around longer and therefore the volt-seconds goes up. That's bad, mostly because at some point the whole thing just stops accepting any more volt-seconds and to fix that the voltage goes to zero (and this means your transistor gets the entire voltage applied to it and that makes it very hot if it stays ON for long.) When you upped the frequency by reducing turns, you shortened the time and therefore also lowered the volt-seconds. Which is a good thing. If you were saturating with more turns and a slower ramp, you'd lose useful energy and the light would look weaker because the duty cycle would be very low. Reducing to fewer turns might have kept you from saturating the core with the effect that the duty cycle was better and more energy got to where it belonged.

Don't know about your camera, but keep in mind that your eyes also have their peak sensitivity in the green -- something like 555nm, or somesuch. At least, your photopic vision. Scoptic is slightly different, peak-wise.

I'm kind of worried about the base-emitter junction, then. With 3 batteries and let's say 6 LEDs, you are likely murdering the poor thing.

What happens when the LEDs are pulsed on? The collector winding has (LED stack voltage - battery voltage) across it. This induces that voltage into the base winding, too. That's going to be more than 10V by itself. It's got to drive the poor BJT far into the negative region relative to the emitter. Perhaps you should look at that with a scope. If you see it going more negative than about 4V, problems. Espectially if you don't see a ramp, but instead some kind of flat (square wave looking) bottom at a negative voltage from 5-7V or so. That means your poor BJT is zenering, I think.

Need that base protection, perhaps.

Jon

Reply to
Jon Kirwan

That suggests the circuit is operating inefficiently due to the transistor switching time being a significant fraction of the pulse time.

Switchmode power supplies use special transistors designed to switch fast while carrying a heavy current. You might like to seek out one of those. Don't use just any old high power transistor, it probably won't be fast enough.

That sounds like it's on the high side as far as switching power supplies usually go. I don't think I'd try to raise it any higher; rather concentrate on making it work more efficiently at that frequency, or even get it down a bit lower. At too high a frequency, switching losses in the transistor will kill you.

You may actually want to use a *bigger* core so that it doesn't saturate so quickly, allowing you to store more energy on each cycle and not need so high a frequency.

Also, do you know what kind of ferrite your ring is made of? There's a huge range of different grades of ferrite available for use at different frequency ranges. You need one designed for about the frequency you're using.

--
Greg
Reply to
greg

Hang on a moment -- unless I'm mistaken, this type of circuit *relies* on saturation of the core for its operation. As soon as saturation occurs, the transistor turns off.

So saturation isn't bad, it's necessary! The only question is how long you want to let the inductance charge up before it occurs.

--
Greg
Reply to
greg

They are damn bright.

They also have some impressive mcd numbers ALONG with fairly large beam spreads.

Reply to
default

I tried a fresh transistor and it worked with only three turns!

(Though I can't say it was any brighter than with four ... seems we've plateaued)

I tried loosening the wire around the ferrite ring. I can't see any difference with the wire tightly pressed against it or with great big loops. Any thoughts of special magnet wire have been dispelled.

1k

See above. I tried a fresh one and the circuit worked better. I guess I damaged the other one. I'm only switching it on for a few seconds at a time at the moment....

Yes, but there's an identical green LED in the group on the left... All things being equal, the left hand group should be at least as bright as the single LED.

:-)

I see about -10V

That too.

Don't know what that implies ... but it sounds scary

Reply to
fungus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.