Transistor Equations - Page 1
Forum section: electronics / projects

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 18, 2011, 01:38:49 am
content: Hi,I am trying to get my head around some equations for a transistor that I am going to use in a 3x3x3 LED cube controlled by an Arduino and I know I can find the answer in some one elses project but I would like to know how to calculate it for my selfThe problem/question how to calculate the transistors resistors. I plan on using a BC548 to control which level of the cube is connected to ground to allow me to charlieplex (Only one level lit at a time)So in my research I have found thisR1 = RbLED cathodes connects to the top of the above diagramIc is max current from the LED's to ground (9*20mA = 180mA)Beta is 110 for a BC548 (off datasheet)so Ib is 1.64mAthenVin = 5vVbe = 0.7so Rb = 2.622k ohm (2.7k closest e12 resistor)and finally R2 should be 10*Rb so 27kDoes the above look about right, I am not at home for a while so I can not hook this up to test it. Also all 9 LED's won't be on for long if at all. As 180mA is close to the maximum of 200mA the BC548 can handle.Any help or corrections greatly appreciated

author: codeboy2k
author_rank: Super Contributor
timestamp: November 18, 2011, 03:10:41 am
content: The calculations are ok, but there are a few things:1) the BC458 is only rated at 100 mA DC continuous current.The 200mA rating you state is the peak current rating, and that's usually specified (but not often said) at some frequency of switching operation.Some data sheets specify the peak current at a frequency of > 1 Mhz, some say >1 Khz, etc.. At 1 Mhz, that peak current can be sustained for less than 1us. At 1 Khz, it's 1ms.Since you're charlie-plexing, I assume you are switching at much less then 1 Khz, so you should look at the DC max current of your selected transistor, and for the BC548, that'sonly 100 mA. So it's too low. Find something with at least 200-300 mA DC sustained max collector current.2) to ensure saturation, a rule of thumb is to double the calculated base current, and use that to determine your base resistor. This protects you against a batch of transistorswith lower than specified hfe3) as a final step, you should also do a power dissipation calculation, to make sure you don't exceed that. In saturation it's difficult, but not impossible to exceed the power rating.In this case, you would multiply the saturation voltage Vce(sat) * current = .2 x 180 mA = 36 mW so make sure your transistor can handle that, and is rated for at least twice as much,to be safe. In this case, more than 80-100mw. Also note that if you run the transistor near the maximum rated current, the saturation voltage can be higher than .2 volts and as muchas 0.7 to 1.2 volts depending on the transistor so check the data sheet and do your power dissipation calculation with the proper Vce(sat) to ensure you are not exceeding themaximum rated power of the chosen transistor

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 18, 2011, 04:59:29 am
content: OK thanks for the reply good to know my calculations are in the right direction. (Will make sure I save them.I will find a more suited transistor, need to read that data sheets more carefully as well I see.I will make sure that I double my base current as well to ensure complete saturation. Should be good I have already made a LED cube like this as I said ages ago. It got destroyed by a soccer ball I believe. Things are always better when there designed by your self though. Last one was a follow the bouncing ball.

author: joelby
author_rank: Frequent Contributor
timestamp: November 18, 2011, 05:02:41 am
content: Quote from: ashley.hughes on November 18, 2011, 04:59:29 amIt sounds like you'd be better off keeping those bouncing balls away from your fragile electronics

author: Armin_Balija
author_rank: Regular Contributor
timestamp: November 18, 2011, 04:38:26 pm
content: It depends on if you want an emitter-biased or base-biased circuit for your LED driver. Base-biased circuits set up a fixed value of base current and emitter-biased circuits set up a fixed value of emitter current. Because of the problem with current gain, base biased circuits are normally designed to switch between saturation and cutoff, whereas emitter-biased circuits are usually designed to operate in the active region.Knowing this, I'd say we move your resistor over to the collector side of the transistor and set it for hard saturation with a base bias circuit.So we know our VCC is 5 V, we calculate the Ic (sat) by dividing our VCC by our intended current (15 ma in this case) and we get ~330 ohms. So we put a 330 ohm resistor on the collector side and we then take 10% of that current and use that for our base current Ic(sat) * .1 = 1.5 mA. We then calculate our base resistance by dividing our Vbb - .7 / 1.5 mA. We get 5K for our base resistance. So our circuit should look something like this.

author: Zero999
author_rank: Super Contributor
timestamp: November 18, 2011, 05:29:59 pm
content: Quote from: codeboy2k on November 18, 2011, 03:10:41 amHe's using the BC548 which is rated to 500mA continuous.Quote from: ashley.hughes on November 18, 2011, 01:38:49 amRead the datasheet more carefully, the beta is specified as 110 minimum when VCEis 5V.You'll need to use a higher base current to ensure saturation.The datasheet specifies the saturation voltage as 0.6V maximum when IC= 100mA and IB= 5mA, a forced beta of 20.You could use the BC338 which has its beta specified at 60 minimum with a VCEof 1V and ICof 300mA

author: ejeffrey
author_rank: Super Contributor
timestamp: November 19, 2011, 10:20:15 am
content: For switching operation, you want to look at the collector-emitter saturation voltage, and take the base current listed there. For the bc548, you see that with a collector current of 100 milliamp and a base current of 5 milliamp, the Vce = 0.6 volt. That is a good place to start. The harder you drive the base within reason, the lower the total power dissipation in the transistor.

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 19, 2011, 11:51:39 pm
content: Thanks for all the input I will work off my original calculations with better study of the data sheets. I will also give my self a bit of a buffer in them as well. I am home on Wednesday think there will be some good old hook it up and look for the magic smoke

author: ChrisKiwi
author_rank: Contributor
timestamp: November 20, 2011, 02:08:14 am
content: Quote from: Hero999 on November 18, 2011, 05:29:59 pmI think that BC458 might have been a typo, the BC548 datasheet I am looking at says that ICis 100mA

author: Zero999
author_rank: Super Contributor
timestamp: November 20, 2011, 01:22:51 pm
content: That's odd, the Fairchild data sheet says 500mA but the Motorola one says 100mA.http://www.pira.cz/pdf/bc548.pdfhttp://www.datasheetcatalog.org/datasheets/150/128424_DS.pdf

author: amspire
author_rank: Super Contributor
timestamp: November 20, 2011, 01:45:13 pm
content: Quote from: Hero999 on November 20, 2011, 01:22:51 pm100mA continuous is the correct spec for a bc548.Here is the definitive data from the company who designed it:http://www.b-kainka.de/Daten/Transistor/BC548.pdfIt looks to me that the Fairchild "bc548" is not a real bc548 but a better spec'ed PN100A transistor which can handle more current. The PN100A was designed as a generic replacement for hundreds of older NPN transistors with the idea of reducing the unnecessarily large range of transistor models existing. I think Fairchild have decided that the PN100A exceeded all the bc548 specs, so they are selling it as a BC548.

author: jimmc
author_rank: Frequent Contributor
timestamp: November 20, 2011, 02:44:08 pm
content: Interesting, the later datasheet on the Fairchild sitehttp://www.fairchildsemi.com/ds/BC/BC548.pdfquotes 100mA.On all of the datasheets hFEis shown as dropping like a stone above 100mA which would limit the usefulness of the device above this current. (The Fairchild sheet uses a log scale which doesn't show the effect as clearly.)I seem to remember that with most small signal transistors it is the fall-off in hFEthat limits the collector current rating.Jim

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 21, 2011, 05:39:53 am
content: Hey, just continuing on from all the above comments,I am getting confused at the datasheet being learning a bit more. Beta is not a set figure it changes with current through Collector to emitter and the voltage across collector to emitting as well. This is confusing me I'm looking at the fairchild PN2222A datasheet.(This part might not suit my requirements just using it to learn at the moment)It is based on Ic and Vce now I know my Ic max is going to be 180mA (If all LEDs are lit) and Vce of 5V? 5V is what the leds will be getting to start with each dropping lets say 3.2V leaving 1.8V left.What beta do I use? and how do I choose it? as its needed to calculate my resistance everyone seams to use it's around 100 but it seams to vary a lotAny help is greatly appreciated

author: amspire
author_rank: Super Contributor
timestamp: November 21, 2011, 06:18:50 am
content: You always use the lowest current gain spec, as it doesn't matter if you put too much current in the base when you wanting to saturate the transistor.So the 2222a will saturate to 0.3V at 150mA with a base current of 15mA. The gain will be even lower at 180mA, so lets give it 22mA base current. That will be fine.If the on signal to the base resistor was 5V, and allow for a 1V base voltage. That would mean you need a 4V/22mA = 180 ohm resistor.Now what would happen if you worked off the 1V Vcevoltage gain spec ? Not much - it would not saturate as fully so the LEDS get a little less volts. The transistor is a bit warmer, but is not too hot. So you could work off a gain figure of say 30 for the PN2222A- that should be safe. That would give a base resistor of about 680 ohms, and the transistor might turn on to perhaps 0.8V maximum at a guess.Basically, as long as you pick a base current that should at least turn on the transistor to below 1V emitter-collector voltage, nothing bad will happen, and after that it is just a matter of seeing how much more base current you can afford to supply to turn the transistor on even better. With the figures I have used above, for 180mA, it would be a good idea to have at least a 680 ohm resistor with a 5V driving signal, and the closer you can get to 180ohms without overloading the driving signal the better. You would not need anything less then 180 ohms.Richard.

author: ejeffrey
author_rank: Super Contributor
timestamp: November 21, 2011, 12:56:09 pm
content: If you don't want to muck around calculating base current load, you can just use a MOSFET switch. There are plenty of mosfets that can switch a 200 milliamp current with a 5 volt logic signal, and they draw zero DC current. You probably want a pull-down resistor, but something on the order of 47 kohm is sufficient.

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 22, 2011, 01:24:49 am
content: From what I have read around every one seams to worry about the Ic part of the hfe section in the datasheet and leave alone the VceIs that about right? So if i was using the BC338http://www.farnell.com/datasheets/11801.pdfand my Ic needs to be about 180mA my beta would be around 80ish and if I set my Ib at two times the min to ensure saturation I should be safe as houses would I not?

author: amspire
author_rank: Super Contributor
timestamp: November 22, 2011, 01:43:45 am
content: Yes, the BC338 is a 800mA transistor from memory, so it would be excellent.If they quote a beta of 80 for a 1V Vceand you double the base current, then you will be fine.

author: ashley.hughes
author_rank: Regular Contributor
timestamp: November 22, 2011, 01:56:04 am
content: Thanks I will order some on my next order of partsStill don't quite understand how to get values out of the hfe section of the datasheet but I will play around a bit, see if I can test them out

author: IanB
author_rank: Super Contributor
timestamp: November 22, 2011, 02:19:44 am
content: Question for EE's:When a model has parameters like hfe for bipolar transistors that are not constant but vary all over the place depending on other parameters, then such a model is not usually considered a good model. Why therefore is there so much emphasis on this (poor) model of a transistor in design equations instead of a better model that has more fundamental and nearly constant parameters? Is it because the "real" model is too complicated for hand calculations?(I have read for instance that the common presumption that the bipolar transistor is a current amplifier is wrong, that a bipolar transistor is in fact a voltage amplifier like an FET, but with side effects; and that the false assumption that it is a current amplifier is what leads to the ugly variation in gain depending on the operating conditions.)

author: amspire
author_rank: Super Contributor
timestamp: November 22, 2011, 03:21:03 am
content: First, when many of these transistors originally came out, they came with copious data and graphs. After 40 to 50 years of making the same part, many manufacturers are now just releasing very abbreviated data sheet.Secondly the specs tend to allow for a very big variation. It is common for transistor current gain to be anywhere between 100 and 800.So when you design, you pick a transistor that exceeds certain critical specs, and otherwise you design so the specs don't matter much.Adding emitter resistors lowers the gain, but it also lowers distortion and eliminates a lot of the variation between transistors. For base bias resistors, you make then low enough so that all transistors from the worst to the best will be biased within the design tolerance.If you look at most transistors, their specifications fall away very quickly above a certain collector current, so you really want to pick transistors that work well above your operating current.You need to look at capacitance to check it is low enough for your circuit.If you are saturating the transistor, you need to check that the turn-off time is fast enough for you.RF transistors have a different geometry to reduce the transit time of minority carriers across the junction.Switching supply transistors are designed so that large stored base charges can be removed from the base very quickly. The peak base current in a switching power supply transistors can be many amps so a very low base resistance becomes important in these transistors.In practice, you pick a transistor for a design based on 2 or 3 critical specs, and you make the design so it can handle as much variation as you can in all the other specs.As I mentioned in another post, most of the time you can do a first pass model a transistor that is not saturated or off using these rules alone:Base voltage is always about 0.6V no matter what happensBase current is 100 times less (or lower) then the collector current.When you start having to worry about the exact properties of a transistor - say if you are designing a log converter - that is when you have to start using a very good model, and that is when you will have to choose a well specified transistor.Richard.

author: ejeffrey
author_rank: Super Contributor
timestamp: November 22, 2011, 09:03:53 am
content: Quote from: IanB on November 22, 2011, 02:19:44 amA much more accurate model for transistors operating in the linear region is the Ebers-Moll transconductance model: Ie = Is * (e^(Vbe / Vt) - 1). This is basically the diode equation for the base-emitter diode. The difference between a transistor and a diode is that all but 1/beta of the emitter current is instead diverted to the collector. Still, you need to know beta to figure out out much base current you will have.

author: amspire
author_rank: Super Contributor
timestamp: November 22, 2011, 11:03:21 am
content: Quote from: ejeffrey on November 22, 2011, 09:03:53 amThe thing is it is extremely rare you need to use a model that accurate when designing a circuit. When you are polishing a design for production, then you really do go into details. At the final stages of design, you do every calculation that may be useful to make sure that even with all the component specification drift, every built device will operate to the design goals.But basically, if you look at the Ebers-Moll model, you see a transistor functioning in an exponential way. In practice we usually want the transistor working in a linear way or as a switch. If you are trying to design a low distortion preamp, and you are using an exponential model of the transistor, you are making things extremely hard for yourself.Richard