Author Topic: How to choose a transistor?  (Read 3020 times)

0 Members and 1 Guest are viewing this topic.

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
How to choose a transistor?
« on: September 07, 2020, 07:19:11 am »
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 a BC547B ? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #1 on: September 07, 2020, 07:35:26 am »
Usually for BJT switching applications you check max. VCEO and 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.
 
The following users thanked this post: redgear, Simon_RL

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3365
  • Country: nl
Re: How to choose a transistor?
« Reply #2 on: September 07, 2020, 07:37:36 am »
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+box

I 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.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #3 on: September 07, 2020, 08:03:17 am »
Usually for BJT switching applications you check max. VCEO and 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.

Thank You.

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+box

I 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.
Thank 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, ATTiny404 mcu, CAP1203 and a 7 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?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #4 on: September 07, 2020, 08:23:29 am »
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's Design 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. 
« Last Edit: September 07, 2020, 08:25:35 am by Ian.M »
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #5 on: September 07, 2020, 08:50:47 am »
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's Design 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.

Thank you for the link, I am designing a linear PSU and wanted to know how to calculate the secondary current rating of the transformer.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #6 on: September 07, 2020, 09:07:40 am »
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!
 
The following users thanked this post: redgear

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19516
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: How to choose a transistor?
« Reply #7 on: September 07, 2020, 09:11:54 am »
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 a BC547B ? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?

Don't forget the catch diode around the relay coil, optionally with a series resistor. A resistor implies increasing the transistors' minimum Vceo spec.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Ian.M, redgear

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: How to choose a transistor?
« Reply #8 on: September 07, 2020, 10:08:18 am »
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 a BC547B ? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?
The BC547 is fine.

According to the data sheet, the transistor will be in the saturation region when IB > 120IC, 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 = 5V
VBE = 0.8V
IB = 3.75×10-3
RB = (V - VBE)÷IB = (5 - 0.8)÷3.75×10-3 = 4.2÷3.75×10-3 = 1120 Ohm

The nearest standard resistor value is 1k1, but 1k is much more widely available and will do.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #9 on: September 07, 2020, 10:52:01 am »
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!

Is there a tutorial online?

Don't forget the catch diode around the relay coil, optionally with a series resistor. A resistor implies increasing the transistors' minimum Vceo spec.

Is the attached circuit good?

The BC547 is fine.

According to the data sheet, the transistor will be in the saturation region when IB > 120IC, 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 = 5V
VBE = 0.8V
IB = 3.75×10-3
RB = (V - VBE)÷IB = (5 - 0.8)÷3.75×10-3 = 4.2÷3.75×10-3 = 1120 Ohm

The nearest standard resistor value is 1k1, but 1k is much more widely available and will do.

Thank you. I put up a simple circuit. Please review.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: How to choose a transistor?
« Reply #10 on: September 07, 2020, 11:01:29 am »
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!

Is there a tutorial online?

Don't forget the catch diode around the relay coil, optionally with a series resistor. A resistor implies increasing the transistors' minimum Vceo spec.

Is the attached circuit good?

The BC547 is fine.

According to the data sheet, the transistor will be in the saturation region when IB > 120IC, 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 = 5V
VBE = 0.8V
IB = 3.75×10-3
RB = (V - VBE)÷IB = (5 - 0.8)÷3.75×10-3 = 4.2÷3.75×10-3 = 1120 Ohm

The nearest standard resistor value is 1k1, but 1k is much more widely available and will do.

Thank you. I put up a simple circuit. Please review.
Yes, 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.
 

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #11 on: September 07, 2020, 11:13:32 am »
Yes, 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.

I read a Application Note from TE, they recommend both Zener and a diode. What should be the Zener's voltage rating?

Quote
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.

The 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
« Last Edit: September 07, 2020, 11:18:20 am by redgear »
 
The following users thanked this post: Electro Fan

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19516
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: How to choose a transistor?
« Reply #12 on: September 07, 2020, 11:52:29 am »
Don't forget the catch diode around the relay coil, optionally with a series resistor. A resistor implies increasing the transistors' minimum Vceo spec.

Is the attached circuit good?

Sorry, 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.
« Last Edit: September 07, 2020, 11:56:34 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #13 on: September 07, 2020, 12:34:43 pm »
Sorry, 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.

Neater version(?) attached.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: How to choose a transistor?
« Reply #14 on: September 07, 2020, 12:52:20 pm »
Yes, 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.

I read a Application Note from TE, they recommend both Zener and a diode. What should be the Zener's voltage rating?
The 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.

Quote
Quote
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.

The 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
You already have a back-EMF diode for the relay, so I don't see why you need another one.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #15 on: September 07, 2020, 01:03:38 pm »
The 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.

Thanks. I will remove the 1N4148.

Quote
You already have a back-EMF diode for the relay, so I don't see why you need another one.
Sorry 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.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #16 on: September 07, 2020, 01:17:35 pm »
You'd need to have been following Redgear's other thread to 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.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #17 on: September 07, 2020, 01:26:16 pm »
You'd need to have been following Redgear's other thread to 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.

So 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?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #18 on: September 07, 2020, 01:41:59 pm »
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.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #19 on: September 07, 2020, 01:45:10 pm »
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.

Thank you. Never used them before. I will look for sample circuits.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12863
Re: How to choose a transistor?
« Reply #20 on: September 07, 2020, 02:01:08 pm »
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.
 
The following users thanked this post: redgear

Offline redgearTopic starter

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to choose a transistor?
« Reply #21 on: September 07, 2020, 02:10:01 pm »
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.

That's cool... Thank you.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: How to choose a transistor?
« Reply #22 on: September 07, 2020, 09:03:44 pm »
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 a BC547B ? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?

Maximum 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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19527
  • Country: gb
  • 0999
Re: How to choose a transistor?
« Reply #23 on: September 07, 2020, 09:25:29 pm »
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 a BC547B ? What are the things I should look at when choosing a transistor for driving a relay? Is it only the Ice?

Maximum 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.
Whilst 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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: How to choose a transistor?
« Reply #24 on: September 07, 2020, 10:11:06 pm »
Whilst 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.

25% 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.
 
The following users thanked this post: redgear


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf