Transistor and LED without current limiting resistor - Page 1
Forum section: electronics / beginners

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 10:19:28 am
content: Hello everyone,I have a transistor being switched by an ARM micro, this transistor is turning an infrared LED on and off.My problem is, the LED is only bright enough to control a TV with it just 10cm from the IR receiver, any further and it doesn't work.I'm powering the LED from 5v going through a 150ohm resistor. If I remove the resistor then the LED is bright enough to work from a distance of a few metres. I'm assuming the combination of PWM of the LED to send the IR code and the current limiting resistor is what's causing the LED to be so dim.My question is, do I need the resistor? Everything works great without it.Should I just reduce the value, maybe make it a 10ohm?Thanks guys.- Anthony

author: Rerouter
author_rank: Super Contributor
timestamp: August 15, 2013, 10:34:25 am
content: assuming the led drops 1.5V, it should need 175 Ohm for 20mA current draw, which should be plentythe fact your led hasn't spontaneously let out its smoke while omitting the resistor would lead me to think your switching transistor is in saturation, e.g. its being governed by the available base current, and that that is where your issue lies,

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 10:51:21 am
content: Thanks Rerouter.The PWM of the led at 38kHz and the fact that I'm only turning it on for 0.5 seconds at a time is probably helping limit the magic smoke.I'm using a PN2222 transistor (http://www.fairchildsemi.com/ds/PN/PN2222.pdf).VCE(sat) (IC=500mA, IB=50mA) = 1VVBE(sat) (IC=500mA, IB=50mA) = 2VHFE (VCE=10V, IC=0.1mA ) = 35HFE (VCE=10V, IC=150mA) = 100 (300 max)Micro Output:V = 3.3VI = 6mAThe base resistor has a value of 520ohm.

author: Psi
author_rank: Super Contributor
timestamp: August 15, 2013, 11:06:32 am
content: Maybe your IR led is the wrong wavelength for the IR receiver&filter in your TV, that would definitely cut the range back.

author: Rerouter
author_rank: Super Contributor
timestamp: August 15, 2013, 11:14:05 am
content: the pwm would not help much....i'm kinda agreeing with psi on his thoughts,if you exceed the current spec of an led its output shifts to a lower frequency, could be what is improving the range,

author: cravenhaven
author_rank: Contributor
timestamp: August 15, 2013, 11:22:24 am
content: I suspect that you are not driving the transistor hard enough. The 520 ohm base resistor would only allow approx 5mA base current at 3.3V so is probably not in saturation which is where I think you need it to be. You really need to scope it to see what is happening.If it was me I would be using a FET such as a 2N7000 and leave the resistors as they are to start with.Also it might help to know which IR LED you are using to enable us to know what its operating characteristics are.

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 11:24:54 am
content: Hello Psi,The only thing that varies between devices is the carrier frequency and encoding format, the wavelength of the IR light doesn't vary/matter so much. I know it's a brightness issue as I have looked at the light with a web camera and it's dim compared to standard remote controls.

author: sleemanj
author_rank: Super Contributor
timestamp: August 15, 2013, 11:25:48 am
content: Turn the transistor on solid with the current limiting resistor in place, and measure the voltage drop across your current limiting resistor, and thus deduce the current, no point chasing wild geese if there could be a fat one sitting in front of you.

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 11:32:07 am
content: Hello sleemanj,I will measure the voltage drop across the resistor and then get back to you.Is there anything else I should measure to help diagnose this. I'm new to using transistors without a complete and tested schematic being provided.

author: Psi
author_rank: Super Contributor
timestamp: August 15, 2013, 11:35:26 am
content: Quote from: AMyatt on August 15, 2013, 11:24:54 amIt could matter quite a lot if you just picked a random IR led from somewhere and not one intended for remote control.The IR sensor in the TV probably covers a pretty wide range of wavelengths but the IR filter on the front of the sensor can be quite narrow to reduce interference from other sources. CFTs etc.If your IR led is 1300nm for example, it will only work point blank when used with a typical 940nm IR filter and sensor. It will also show up dimmer than other remotes when viewed on a web cam due to the webcams IR response falling off at higher wavelengths.But i do agree that the transistor is a more likely reason for the issue.

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 11:41:40 am
content: Hi Psi,Thanks, I hadn't thought of that.The LED is a Vishay TSUS5400 (http://docs-asia.electrocomponents.com/webdocs/0e22/0900766b80e22d5c.pdf)

author: Rerouter
author_rank: Super Contributor
timestamp: August 15, 2013, 11:45:08 am
content: OK, its made to be driven far harder than i was thinking,Try 33 ohms, which brings you up to 100mA,

author: Psi
author_rank: Super Contributor
timestamp: August 15, 2013, 11:46:07 am
content: 950nm is fine and should work no probs to control a TVThat led can handle 150mA @ 1.3VSo driving it at absolute max would be.. 5V input - 1.3V = 3.7V/0.150A = 24.6ohmsI would try a 33R and see how that works.

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 12:01:50 pm
content: Thanks guys,Should I also investigate the base resistor value to see if this is causing problems or if this works will it suffice?Using the calculator athttp://kaizerpowerelectronics.dk/calculators/transistor-base-resistor-calculator/and specifying the values from the PN2222 datasheet I get a base resistor value of 216ohm (220ohm). I am currently using a 520 ohm resistor based off of another online calculator I used a few weeks back. This is a huge difference and I'm not sure which to trust.As I said in a previous reply, I am new to using transistors and I really appreciate you all taking the time to help me work this out.

author: Psi
author_rank: Super Contributor
timestamp: August 15, 2013, 12:03:28 pm
content: I would try a 160R base resistor with that 33R led resistor.(Assuming your 3.3V i/o can handle 20mA)

author: AMyatt
author_rank: Contributor
timestamp: August 15, 2013, 12:06:51 pm
content: Hello Psi,The specs for the I/O are:3.3v logicSource current of 6mA

author: Psi
author_rank: Super Contributor
timestamp: August 15, 2013, 12:11:31 pm
content: ok, well that may not be enough to drive that IR led at full power given the gain of that transistor at saturation.You could try two transistors in a darlington config.Or, as others have said, try a 3.3V logic level N channel mosfet (with no gate resistor)

author: AMyatt
author_rank: Contributor
timestamp: August 16, 2013, 04:58:05 am
content: In a circuit simulator I have set the circuit up with a 300ohm base resistor and 33ohm current limiting resistor and this gives me 1.2v @ 92mA for the LED with only 6mA being drawn from the MCU I/O pin. I will test this out on the actual circuit when I get home tonight.If this fails then I might have to go back to the drawing board and use an N-Channel 3.3v Logic Fet as has been suggested (If I can find one; RS, DigiKey and Element14 have come up empty when specifying "N-Channel" and "2V Logic" or "3v3 Logic" as the filters).

author: sleemanj
author_rank: Super Contributor
timestamp: August 16, 2013, 05:13:03 am
content: Quote from: AMyatt on August 16, 2013, 04:58:05 amI think the surface mount world tends to have more selection in logic level mosfets than the through hole one, try the SI2302DShttp://de.mouser.com/ProductDetail/NXP-Semiconductors/SI2302DS215/?qs=sGAEpiMZZMvKM5ialpXrmhvhsJkB2qKwIn brief; N Channel SOT23, max current 2A, RDSon 85mOhm at VGS 4.5v, 115mOhm at 2.5v VGS, 830mW

author: ve7xen
author_rank: Super Contributor
timestamp: August 16, 2013, 08:24:59 am
content: Quote from: Psi on August 15, 2013, 11:46:07 amSince the duty cycle of the signal is going to be somewhere around 50% at a reasonably high frequency, it should be safe to increase the peak current substantially. The datasheet specifies a maximum peak current of 300mA (2x) with 50% duty cycle and a period of 100us (10kHz). It should be safe to run it at at least 250mA if the only mode possible is the PWM.Once you've tested your code well, of course, so you can'teasilyburn the LED out by leaving it on.

author: Stove
author_rank: Contributor
timestamp: August 16, 2013, 09:05:22 am
content: The LED can be driven much higher for 50% duty cycle: 300mA. Furthermore you are forgetting the voltage drop in the transistor, but granted it's rather low, 0.2V @ 300mA. I have put some graphs and calculations together in this image, please excuse the crudity of the drawing. Final result 12.3Ohm. If you really want the maximum out of it, find a way to measure the current and trim the resistor till it's 300mA. ve7xen was pretty close.

author: Zero999
author_rank: Super Contributor
timestamp: August 16, 2013, 09:28:21 am
content: Quote from: Stove on August 16, 2013, 09:05:22 amThat won't work, the MCU output is only 3.3 V so the LED current would only be 18mA with a 12R series resistor using an emitter follower.

author: Stove
author_rank: Contributor
timestamp: August 16, 2013, 10:26:08 am
content: Quote from: Hero999 on August 16, 2013, 09:28:21 amI'm sorry, you are right, the transistor should be like it is now (updated the image) and even then the transistor is too weak, 6mA * 35 = 210mA, so would have to darlington indeed.

author: Zero999
author_rank: Super Contributor
timestamp: August 16, 2013, 11:05:40 am
content: With no base resistor, it might overload the MCU output which could cause it to overheat, unless it's adequately protected.

author: AMyatt
author_rank: Contributor
timestamp: August 16, 2013, 01:43:43 pm
content: Hi Guys,Thanks for all your help. Would changing to the MPSA13RLRAG (http://www.onsemi.com/pub_link/Collateral/MPSA13-D.PDF) Darlington transistor work?I am ALWAYS driving it with a PWM signal of around 38-40kHz at 50% duty cycle.When first building this circuit I underestimated the base resistor value, the MCU shut down. I have no doubt it could have been much worse though.

author: Stove
author_rank: Contributor
timestamp: August 16, 2013, 04:00:15 pm
content: Redid the crude drawing with the new transistor. Also calculated base resistor. Hope this helps. Let us know the results, maybe some pics of your setup? Values for base resistor are not exact. Anywhere between 2kOhm and 350Ohm will work. Taking it on the high side because it's useless sinking the full 6mA from the MCU when you don't need it. Just heats up the transistor if it's higher than required to go into saturation.

author: edavid
author_rank: Super Contributor
timestamp: August 16, 2013, 04:24:45 pm
content: You shouldn't need 300mA! I wonder if you damaged the LED or transistor at some point. I would back off on the current to 25mA and try using a visible LED to make sure things are working the way you think (or stick with the IR LED, and use a digicam to view it).When you say PWM, are you actually trying to PWM it, or do you just mean the RC pulse code?Are you sure you are using the right carrier frequency (e.g. 38kHz)? The IR receiver in the TV will only respond to the right carrier. You could try scoping the receiver output pin to see if it's detecting anything.

author: AMyatt
author_rank: Contributor
timestamp: August 17, 2013, 10:57:41 am
content: edavid, As I stated in one of my other replies; I have been looking at the output using a camera. What I didn't say is that I have also looked at the output using a scope and logic analyser. The carrier frequency is exactly 38kHz and the code being sent is correct. As I said in my first post, this works from a small distance from the TV (10cm) but not any further. These are new components fresh out of their anti-static packaging. Other forum members have linked the dullness of the LED to the transistor I'm using not reaching saturation because of the limited current from my MCU.Stove, thanks for the calculations/diagram I have ordered some MPSA13RLRAG transistors and will let you know how I go.

author: edavid
author_rank: Super Contributor
timestamp: August 17, 2013, 02:58:26 pm
content: Quote from: AMyatt on August 17, 2013, 10:57:41 amI don't think so, the transistor beta should be at least 100, so there should be no problem. Did you look at the transistor's collector voltage with your scope?

author: AMyatt
author_rank: Contributor
timestamp: August 17, 2013, 03:05:25 pm
content: edavid, from memory it was about 1.2v.It's my understanding that the transistors beta value documented in the datasheet (100 in this case) is only accurate at its saturation point. Is this not correct?It's also my understanding that 6ma is not enough to saturate the transistor. Is this not correct?Thanks

author: edavid
author_rank: Super Contributor
timestamp: August 17, 2013, 04:18:55 pm
content: Quote from: AMyatt on August 17, 2013, 03:05:25 pmIf you are remembering right, something is wrong, because it shouldn't be that high.QuoteYes, it is not correctThe beta values in the data sheet are valid at the conditions listed (but please note that the minimums are conservative). Saturation is defined as the condition where the base current is greater than collector current divided by beta.QuoteAlso not correct. 6mA is enough to saturate the transistor if the collector current is not too high - in this case beta should be 100 or greater, so as long as the collector current is less than 600mA (which it should be, or you'll be frying your LED), the transistor should be saturated.However, it really doesn't matter much if the transistor is saturated, we're just concerned with how much current is going through your LED. Use your scope to measure the voltage on each end of the current limiting resistor when the LED is on, then you can determine that current.

author: Zero999
author_rank: Super Contributor
timestamp: August 17, 2013, 07:14:43 pm
content: Quote from: edavid on August 17, 2013, 04:18:55 pmNo, the Hfe of 100 is specified with VBC= 10V, the saturation voltage is specified when IB=0.1*IC

author: edavid
author_rank: Super Contributor
timestamp: August 17, 2013, 07:47:14 pm
content: Quote from: Hero999 on August 17, 2013, 07:14:43 pmVCE, but so what, the beta should not be much lower at a lower VCE.QuoteAgain, so what? That is the spec, but the transistor is saturated at a lower base current.

author: AMyatt
author_rank: Contributor
timestamp: August 18, 2013, 01:13:40 am
content: edavid, what do you think the problem is then?Both in the actual circuit and in computer simulations my LED isn't getting enough current.

author: edavid
author_rank: Super Contributor
timestamp: August 18, 2013, 01:26:40 am
content: Quote from: AMyatt on August 18, 2013, 01:13:40 amHow much current is going through the LED?

author: megajocke
author_rank: Regular Contributor
timestamp: August 18, 2013, 09:36:12 am
content: Quote from: edavid on August 17, 2013, 07:47:14 pmBeta most definitely is lower at lower Vce. The table in the Fairchild datasheet says "Vce(sat) of max 1 V at Ic=500 mA, Ib=50 mA", which in other words means that the transistor is not guaranteed to have more beta than 10 at a Vce of 1 V and 500 mA of collector current. (!) Also note that the Vbe may be up to 2 V in this condition!(http://www.fairchildsemi.com/ds/PN/PN2222.pdf)

author: edavid
author_rank: Super Contributor
timestamp: August 18, 2013, 02:16:54 pm
content: Quote from: megajocke on August 18, 2013, 09:36:12 amIt doesn't mean that at all. When you are spec-ing VCE(sat), you use a low forced beta.However, there is some relevant information on the Fairchild datasheet... the 150mA beta is given as 100 min at VCE= 10V, and 50 min at VCE= 1V. So I suppose the high current, low VCEbeta might be 20ish, pretty poor. I still don't see why the LED needs to be blasted with 500mA to control a TV a few feet away.

author: megajocke
author_rank: Regular Contributor
timestamp: August 19, 2013, 04:51:35 am
content: Quote from: edavid on August 18, 2013, 02:16:54 pmWhat datasheet are you looking at and where? I can't find any 50 min spec for beta at Vce=1V in the datasheet linked by the OP (see below or in post 3 of this thread). What I mean is that you can deduce from the Vce(sat) specification that the beta will be at least 10 at 1V of Vce and 500mA of collector current. And without further specifications, that's about all the guarantee you will get. If the specification you speak of really exists, then of course you are right in that the 1 V Vce, 150 mA Ic beta is at least 50.(http://www.fairchildsemi.com/ds/PN/PN2222.pdf)

author: AMyatt
author_rank: Contributor
timestamp: August 25, 2013, 04:17:20 am
content: Hi everyone.I'm not sure if with a bit more time and a better datasheet that we might have gotten the PN2222 working to energise the LED with enough current to control a TV from more than an inch away, but I couldn't afford to spend more time on it.My MPSA13RLRAG transistors arrived and worked a treat. I will try and get some stats to you guys shortly.I would like to thank Stove for taking the time to calculate the resistor values for me.

author: Stove
author_rank: Contributor
timestamp: August 25, 2013, 03:21:01 pm
content: I'm glad it worked, from what distance does it work now? Like AcHmed99 said, you could go lower in duty cycle (if your controller can do that) and increase the current and range even more.