How to choose a transistor? - Page 1
Forum section: electronics / beginners

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 07:19:11 am
content: I need to pick a transistor to drive a 12v relay with a coil resistance of 160 and the current will be 75mA. Can I use aBC547B? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 07:35:26 am
content: Usually for BJT switching applications you check max. VCEOand IC; and min. hFE, the latter to check you can provide enough base drive to get it into hard saturation if you cant meet the common 'forced beta' of ten (i.e. IB=10% of max. ILoad) rule of thumb.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 07, 2020, 07:37:36 am
content: For such a simple application almost any BJT will do.maximum collector current is a limit, but most will do 100mA or more.The transistor has to withstand the relay voltage when it's off, but this is also not problematic with 12V.Some of the new MOSfet's are specifically made for only upto 6V, but I have not seen such low voltages for BJT's (But I have not looked either).Then there is Hfe, the current amplification factor. There is a huge variety in this, and you have to ensure that your transistor gets enough base current.But don't just ask. Get your breadboard and do some simple experiments.For around EUR10 you can get an assortment box with several hundred transistors from Ali / Ebay / China and with around 20 different kinds of transistors. Such a box is perfect for all kind of experiments and you don't have to worry about damaging a few during your experiments.https://html.duckduckgo.com/html?q=aliexpress+transistor+assortment+boxI even encourage you to damage a handful of transistors during such experiments. Try to (ab) use the transistors in several different ways, observe what happens. Such experiments are very quick and easy to do on a breadboard.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 08:03:17 am
content: Quote from: Ian.M on September 07, 2020, 07:35:26 amThank You.Quote from: Doctorandus_P on September 07, 2020, 07:37:36 amThank you will try experimenting.I have another question, while this can be a separate thread, I will see if I can get answers here.How do I estimate the output current I need from a transformer? The transformer will power the said relay,ATTiny404mcu,CAP1203and a7 Segment Display. The 7 seg takes about 10mA per segment, does that meant the total current required will be 280mA(7*4*10) when all segments are on? Idk if my mcu can provide so much current, so I need a transistor there too. The mcu and touch IC won't consume much current. So my total current required will be 280mA+75mA+30mA, 380mA? Which means my transformer should be capable of supplying 550mA(380/0.7). Are the calculations correct?

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 08:23:29 am
content: That gives you the min. acceptable DC supply current *IF* the 10mA per segment is the time averaged current when on, which may not be the case for a multiplexed display.If you are colloquially (and incorrectly) referring to a complete SMPSU as a 'transformer', then yes, that DC supply current + an appropriate safety margin to improve reliability is what you need to know to specify the PSU.If you are designing a linear PSU and want to know the min. required secondary current rating, it gets a lot more complex because the conversion ratio between mean DC output current and RMS secondary current depends on the rectifier topology and to a lesser extent the size of the reservoir capacitor(s). For the commonest case of a bridge rectifier feeding a capacitor input load, the RMS secondary current is much higher than the DC load current. Hammond Mfg (transformer division) recommends*the DC load current does not exceed 62% of the secondary's RMS current capability.* See Hammond'sDesign Guide for Rectifier Use. They aren't pulling the numbers out of their corporate arse to up-sell you, as the various factors can be confirmed by SPICE simulation. I highly recommend anyone interested in linear PSUs and other line frequency power transformer applications save a copy.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 08:50:47 am
content: Quote from: Ian.M on September 07, 2020, 08:23:29 amThank you for the link, I am designing a linear PSU and wanted to know how to calculate the secondary current rating of the transformer.

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 09:07:40 am
content: Ooofff!!! Calculating it properly without resorting to SPICE simulation, rules of thumb, or pre-calculated factors is *NASTY* and *DIFFICULT*. If you want to jump down that rabbit hole, ask!

author: tggzzz
author_rank: Super Contributor
timestamp: September 07, 2020, 09:11:54 am
content: Quote from: redgear on September 07, 2020, 07:19:11 amDon't forget the catch diode around the relay coil, optionally with a series resistor. A resistor implies increasing the transistors' minimum Vceo spec.

author: Zero999
author_rank: Super Contributor
timestamp: September 07, 2020, 10:08:18 am
content: Quote from: redgear on September 07, 2020, 07:19:11 amThe BC547 is fine.According to the data sheet, the transistor will be in the saturation region when IB>1⁄20IC, so when IC= 75mA, you need 3.75mA of base drive. Assuming you're driving it from a 5V MCU output and according to the data sheet, the transistor's maximum base emitter voltage is 0.8V:V = 5VVBE= 0.8VIB= 3.75×10-3RB= (V - VBE)÷IB= (5 - 0.8)÷3.75×10-3= 4.2÷3.75×10-3= 1120 OhmThe nearest standard resistor value is 1k1, but 1k is much more widely available and will do.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 10:52:01 am
content: Quote from: Ian.M on September 07, 2020, 09:07:40 amIs there a tutorial online?Quote from: tggzzz on September 07, 2020, 09:11:54 amIs the attached circuit good?Quote from: Zero999 on September 07, 2020, 10:08:18 amThank you. I put up a simple circuit. Please review.

author: Zero999
author_rank: Super Contributor
timestamp: September 07, 2020, 11:01:29 am
content: Quote from: redgear on September 07, 2020, 10:52:01 amYes, that will work. If you connect the zener diode's anode to 0V, so it's across the transistor, then the 1N4148 is not needed.What does the Schottky diode do? Is it for reverse polarity protection? If so, you need to make sure it will survive the short circuit current for long enough to blow the fuse.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 11:13:32 am
content: Quote from: Zero999 on September 07, 2020, 11:01:29 amI read aApplication Notefrom TE, they recommend both Zener and a diode. What should be the Zener's voltage rating?QuoteThe two connector before the relay connects to a microswitch, opening and closing the supply to the relays. It is to clamp the back emf when the switches open. How do I check it? I'm also not sure about the voltage rating of the diode. Can they be same as the coil voltage?Thanks

author: tggzzz
author_rank: Super Contributor
timestamp: September 07, 2020, 11:52:29 am
content: Quote from: redgear on September 07, 2020, 10:52:01 amSorry, that is too drawn as too much of a tangled mess for me to understand what you are trying to do.There are standard ways of drawing diagrams that emphasise the intended operation of a circuit - just as in software there are standard ways of indenting code to make it readable. The TI App note shows the relevant one in this case.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 12:34:43 pm
content: Quote from: tggzzz on September 07, 2020, 11:52:29 amNeater version(?) attached.

author: Zero999
author_rank: Super Contributor
timestamp: September 07, 2020, 12:52:20 pm
content: Quote from: redgear on September 07, 2020, 11:13:32 amThe diode is only needed if it isn't convenient to put it across the switching transistor i.e. the relay is in a separate enclosure. In your case, the switching transistor is easilly accessible, so only a zener diode is required across the transistor.The higher the zener diode's voltage rating, the faster the coil will turn off. The minimum voltage rating of the zener, should be 10% above the power supply's maximum voltage and the maximum rating, 10% below the transistor's maximum rating.QuoteYou already have a back-EMF diode for the relay, so I don't see why you need another one.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 01:03:38 pm
content: Quote from: Zero999 on September 07, 2020, 12:52:20 pmThanks. I will remove the 1N4148.QuoteSorry if it was stupid. Beginner here.I was suggested that I add it in a different thread when driving the relay from a ULN2003A relay driver. It had inbuilt freewheel diodes as well. I will remove it if it is unnecessary.

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 01:17:35 pm
content: You'd need to have been following Redgear'sother threadto know *WHY* I recommended that diode. TLDR: the connector 'J? Microswitch' goes to a switch. If it opens while the coil is energized, without the diode consider what happens to the poor MCU's pin that 'sees' the back-EMF from the relay coil with only a 10K resistor in series. The relay coil was originally being driven by a ULN2003, so there weren't many options short of an extra diode.However, now if the catch diode is *DIRECTLY* across the relay coil, the extra diode is redundant. If you are using a catch diode + series resistor or zener for faster release when the transistor cuts off, you would need to keep it.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 01:26:16 pm
content: Quote from: Ian.M on September 07, 2020, 01:17:35 pmSo I have two options now, either connect a diode directly across relay coils and remove the schottky diode or use a zener diode and leave the schottky diode undisturbed. Am i correct?

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 01:41:59 pm
content: It might be better to clamp right at the MCU pin with a BAT54S or similar dual series Schottky diode, as then you can get rid of the power Schottky clamping node 'SW' and let your Zener clamp across the relay coil work effectively to speed up turnoff for both the case when the transistor cuts off and the case where the microswitch opens.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 01:45:10 pm
content: Quote from: Ian.M on September 07, 2020, 01:41:59 pmThank you. Never used them before. I will look for sample circuits.

author: Ian.M
author_rank: Super Contributor
timestamp: September 07, 2020, 02:01:08 pm
content: Its quite easy. They are two diodes in series in the same package with the middle connection brought out: Connect cathode to Vcc, Anode to ground and Common to the I/O you want to clamp. The diodes are both reverse biased in normal operation, but one or the other becomes forward biased and clamps the pin voltage if anything tries to drive the pin past either supply rail.

author: redgear
author_rank: Frequent Contributor
timestamp: September 07, 2020, 02:10:01 pm
content: Quote from: Ian.M on September 07, 2020, 02:01:08 pmThat's cool... Thank you.

author: David Hess
author_rank: Super Contributor
timestamp: September 07, 2020, 09:03:44 pm
content: Quote from: redgear on September 07, 2020, 07:19:11 amMaximum specified collector current for the BC547 is 100 milliamps which is marginal for a 75 milliamp load, but it will work. A BC337 with 800 milliamp maximum collector current would be more suitable.

author: Zero999
author_rank: Super Contributor
timestamp: September 07, 2020, 09:25:29 pm
content: Quote from: David Hess on September 07, 2020, 09:03:44 pmWhilst I agree the BC337 is more suitable, I dispute the BC547 being marginal, at just 75mA, which is just 75% of its absolute maximum rating.

author: David Hess
author_rank: Super Contributor
timestamp: September 07, 2020, 10:11:06 pm
content: Quote from: Zero999 on September 07, 2020, 09:25:29 pm25% is the *minimum* derating that I would accept, and a 200 milliamp 2N3904, 600 milliamp 2N4401, or 800 milliamp BC337 are hardly going to cost more.

author: redgear
author_rank: Frequent Contributor
timestamp: September 08, 2020, 01:14:43 pm
content: Quote from: David Hess on September 07, 2020, 10:11:06 pmThanks. They almost cost the same, will go with 2n4401.

author: David Hess
author_rank: Super Contributor
timestamp: September 08, 2020, 11:49:54 pm
content: Quote from: redgear on September 08, 2020, 01:14:43 pmThe NPN 2N4401 and PNP 2N4403 are my go-to transistors for switching but I recommended the BC337 earlier since your original question was about the BC547.Even at lower currents where the 200 milliamp 2N3904 would be suitable, the 2N4401 will usually have higher gain. The BC547 that you asked about is unusual in that it maintains high gain up to its maximum collector current. Usually a higher current transistor than neccessary is used because the gain drops by that point.

author: Zero999
author_rank: Super Contributor
timestamp: September 09, 2020, 08:21:19 am
content: Quote from: David Hess on September 08, 2020, 11:49:54 pmThe good thing about the BC337 is the hFEis specified at 60 when VCE= 1V, up to 300mA, so drive the base with 5mA and with 300mA, you're pretty much guaranteed saturation.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 12, 2020, 06:58:16 pm
content: Tl;DR, but about the ratings for (simple laminated ireon core) transformers.Often they have some current rating, but the VA rating is more important.If you have a 10V transformer, and put the output through a bridge rectifier, the the output will be the peak voltage 10 * sqrt*2) = 14V minus 2 diode drops from the bridge, so it will be around 12.8V.If your transformer was rated for 1A or 10VA, then it would only be able to delver a sustained current of 10VA / 14V = 710mA.The output voltage rating is usually under full load, and at no load the output voltage will be higher. With small transformers it can easily be 30% higher.A very simple, but yet good method is to keep track of the transformer temperature over time. When (not too badly) overloaded, transformers do not self destruct such as most electronics, but they just start loosing efficiency and overheat. So as long as your transformer stays cool or luke warm with your intended load you're on the safe side.

author: redgear
author_rank: Frequent Contributor
timestamp: September 13, 2020, 05:26:49 am
content: Quote from: Doctorandus_P on September 12, 2020, 06:58:16 pmThank You.My current requirements are very less. A micro, a touch IC, 3 leds and a 7 Segment display. The 7 seg display and the LEDs will be always ON. So the transformer will never be under no load condition. 10mA is what I am planning to feed each seg of the 7seg display with, so for digits it consumes at max 280mA. All the segments don't stay ON all the time, so avg current draw can be assumed to be 150mA. Total average current draw will be 200mA. I have a 12v 7VA transformer. So, going by the calculations the transformer will be able to deliver 410mA. For a capacitor load, theHammond Application noterecommends derating to 60%, even in that case it should be fine.Please correct me if I am wrong.

author: mzzj
author_rank: Super Contributor
timestamp: September 13, 2020, 08:34:31 am
content: Quote from: Doctorandus_P on September 12, 2020, 06:58:16 pmQuite a few small transformers run "luke warm" even without load because of core losses so your approach might be even bit too much on safe side. Typical specification for temperature rise under rated load for small transformers might be 30-40 °CSome specifiy <65°C or <70°C like ones herehttps://download.altronics.com.au/files/docs_286.pdf65°C temperature rise in a 40 °C ambient is noticeably more than luke warm... at least your finger doesn't make hissing sounds yet.