Connect with us

Selecting a Transistor

Discussion in 'Electronic Basics' started by Ed, Jul 28, 2004.

Scroll to continue with content
  1. Ed

    Ed Guest

    I have a microcontroller which runs of 5V. I want to connect an ultrasonic
    transmitter to one of its outputs. I would also like the transmitter to run
    of 9V (rather than 5V). I guess I need a transistor to do this (I have a 9V
    regulator with the microcontroller). I was thinking I could connect the
    microcontrollers output to the base of the transistor and then connect the
    transmitter to the collector (the other terminal of the transmitter is
    connected to the 9V supply). The emitter would then be connected to ground.
    How can I select the correct transistor to do the job (e.g. what properties
    must the transistor have)? Also, I understand a resistor needs to be
    connected to the base (for protection), but does a resistor need to be
    connected to the collector (before or after the transmitter)?

    Any advice or pointers (links to websites etc) will be gratefully recieved.
    Thanks.
     
  2. Byron A Jeff

    Byron A Jeff Guest

    You're definitely in the right newsgroup...

    -I have a microcontroller which runs of 5V. I want to connect an ultrasonic
    -transmitter to one of its outputs. I would also like the transmitter to run
    -of 9V (rather than 5V). I guess I need a transistor to do this (I have a 9V
    -regulator with the microcontroller).

    That's a good assessment. For this purpose you can think of the transistor as
    a switch between the collector and the emitter that's controlled by the base.

    But the funky thing that novices have to figure out is that bipolar transistors
    are controlled by current, which is then a byproduct of the voltage applied.
    In short the current that flows between the base and the emitter is amplified
    in the collector/emitter junction. That's how a 5V input at the base of a NPN
    transistor can switch 9V between the collector and the emitter.

    - I was thinking I could connect the
    -microcontrollers output to the base of the transistor and then connect the
    -transmitter to the collector (the other terminal of the transmitter is
    -connected to the 9V supply).

    Just like a switc.

    - The emitter would then be connected to ground.

    Right.

    -How can I select the correct transistor to do the job (e.g. what properties
    -must the transistor have)?

    1) Must be able to support te voltage across the collector/emitter junction.
    2) Must be able to support the current through the collector/emitter junction.
    3) Must have sufficient amplification factor (called the beta or hfe) to
    provide enough current to the load with the maximum base current that can
    be applied. For example say you needed to deliver 400 mA of current to the
    load. The microcontroller pin can deliver a maximum of 20 mA to the base.
    Then at the absolute positive very minimum the beta would have to be
    400 mA/20 mA -> 20. However conventional wisdom states that to ensure
    solid turn on of the transistor, that the beta should multiplied by a factor
    of 10 to ensure that the transistor saturates. So you'd be looking for a
    transistor with a beta of 200. That's not as hard as it looks. A jellybean
    2N2222A has a beta between 100 and 300 when 150ma is flowing through the
    collector/emitter junction.
    4) Last is power dissapation. Every transistor will burn some of the current
    flowing through it as heat. So they get hot, and the more current flowing
    the hotter they get. You have to make sure that the part can dissapate the
    heat generated.

    - Also, I understand a resistor needs to be
    -connected to the base (for protection),

    Not only for protection. Remember that a transistor is a current amplifier and
    it'll happily take as much base current as you can supply. So the resistor
    serves as a current limiter both the microcontroller output and for the
    maximum current flowing through the collector/emitter junction. In short
    if you push too much current you can burn up both the transistor and the
    output that's supplying the base current to it.

    - but does a resistor need to be
    -connected to the collector (before or after the transmitter)?

    Nope. Presuming that the transmitter will not exceed the current carrying
    capacity of the transistor, no resistor is required.

    -
    -Any advice or pointers (links to websites etc) will be gratefully recieved.
    -Thanks.

    I hope that helps. It would have really helped to know the current requirements
    of the transmitter.

    BAJ
     
  3. Rich Grise

    Rich Grise Guest

    I'd connect a resistor (1K ~ 10K) from the base to emitter of the
    transistor, to make sure it's fully off when the PIC output is low.

    This is in addition to the series resistor, of course. I don't know
    if the PIC output needs a pullup to provide Ioh to the xsistor - I'd
    have to check the data sheet.

    Cheers!
    Rich
     
  4. Ed

    Ed Guest

    Thanks for the replies. That makes it a bit clearer.

    The ultrasonic transmitter has no current requirements in the datasheet
    (http://www.farnell.com/datasheets/53074.pdf). So how do I know how much
    current it requires?

    Thanks again.
     

  5. Ultrasonic transducers don't work that way. That is... You don't just
    apply continuous power like you would a lightbulb and they suddenly start
    broadcasting away at the desired 40kHz or whatever the design frequency is.

    From an electrical standpoint the ultrasonic transducer behaves much like a
    relatively small capacitor. From the datasheet you linked to the actual
    capacitance is around or somewhat larger than 2000pF. If you apply DC (or
    even if you turned that power on and off at 40kHz it would still not work)
    power like you are suggesting you will be disappointed to find that the
    transducer makes no ultrasonic noise at all.

    You need to drive it with a full AC signal at as close to 40kHz as possible
    (assuming a 40kHz transducer). Additionally transducers usually do not like
    having DC voltages across them (in addition to the rated peak to peak AC
    voltage).

    Since you are using a microcontroller it should be no problem to configure
    it to output a 50% duty cycle 40kHz square wave on one of your I/O pins. Do
    this.

    Once you have that go and buy some device such as the TC1428 MOSFET gate
    driver IC. You aren't driving MOSFETs here, but these ICs are fairly
    versatile and will provide the desired functionality very well. Datasheet
    here:

    http://ww1.microchip.com/downloads/en/DeviceDoc/21393b.pdf

    This device is made by Microchip and should be available from your favorite
    distributors. The TC4428 will also work, and is vaguely superior to the
    TC1428 while usually not costing anymore from your distributor, so perhaps
    it is an even better choice.

    http://ww1.microchip.com/downloads/en/DeviceDoc/21422b.pdf

    Once you have one of these devices tie pins 2 and 4 together (the two
    inputs) and hook this to your ~50% duty cycle 40kHz squarewave from your
    microcontroller. Pin 6 (Vdd) goes to your +9V supply, and of course gnd
    (pin 3) goes to ground. Pins 7 and 5 are your outputs of what amounts to a
    miniature integrated H-bridge. These pins go to your ultrasonic transducer.
    One goes to one side, the other to the other side. Polarity is not
    important.

    The novelty of the TC4428 device is that it performs the level shifting
    function (from a 0-5V logic signal) to the 0-9V (or whatever Vdd is up to
    18V) as well as providing two complementary outputs that work very nicely to
    produce a full AC signal which can be applied directly to the ultrasonic
    transducer just as an H-bridge constructed of discrete components would.

    The average DC current the transducer itself will likely take is around
    1-2mA or thereabouts. This assumes one of the ~2000pF flavor 40kHz
    transducers driven with 9V peak-peak. This is calculated from C=Q/V and the
    definition of current being I=Q/t. Thus the power consumed by the
    transducer itself will likely be much smaller than that consumed by other
    parts of the circuit (such as the TC4428 or TC1428 device).

    Once you get this all working you will probably want to increase the
    broadcast range of the system. 9V peak to peak is rather wimpy for an
    ultrasonic transducer rated for say 20V peak-peak. You will probably want
    to run it close to it's maximum rated voltage (with some derating), so
    perhaps something around 16V peak-peak is desirable. If you use the above
    mentioned MOSFET gate driver IC all you have to do is increase Vdd to 16V.
    However, the real improvements possible in terms of signal range lie not in
    the transmitter design but in the receiver amplifier. Design your receiver
    amplifier very well. I'll leave that as an exercise for the student, but
    you will need a gain of at least 1000 at 40kHz (assuming 40kHz transducers)
    to get any kind of range at all. Filter out or otherwise keep noise out of
    your amplifier at all costs.
     


  6. Hmmm... It just occurred to me that if your "H-bridge" is supplied from a
    9V DC rail, then the peak to peak voltage seen by the load would be double
    this or 18Vp-p. The 1mA-2mA calculation should still be valid, but this
    means that with a 9V DC supply voltage you will already be running a 20Vp-p
    maximum rated ultrasonic transducer near it's maximum.
     
  7. Ed

    Ed Guest

    Wow, thanks for the detailed reply. That's very helpful. I've now ordered
    a TC4428.

    Thanks again.
     
  8. Activ8

    Activ8 Guest

    Why did I come here? Novices need to learn that bipolars are *not*
    current controlled devices but you can treat them as such sometimes.
    I'd suggest requesting a tuition refund from any prof who calls 'em
    "current controlled", but it does no good to piss off the prof.

    Id = Is[e^(Vbe/Vt) - 1]

    Id is the be diode current and since

    Ie = Ic + Ib and since Ib is usually very small compared to Ie, we
    can write

    Ic = Is[e^(Vbe/Vt) - 1]

    and therefor it is a voltage controlled device.

    <snip>

    I presume the rest of what you wrote was accurate since I'm sure you
    can select/connect a tranny for/to a PIC :)
     
  9. Rich Grise

    Rich Grise Guest

    Except that it's an order of magnitude harder to control Vbe
    than Ib.

    Cheers!
    Rich
     
  10. Activ8

    Activ8 Guest

    And cheers to you as I tip my brew.

    You're right, only that wasn't really the point. You can also argue
    that the charge density in the base region is what causes the
    carrier to migrate through the base and into the collector, thus
    it's current controlled.

    It's just that hfe is so loose. It's not practical to use a small
    signal current as an input to a mathematical analysis using hfe.

    That's just my opinion. First time I worked with an experianced
    engineer he pointed out that hfe is crap. He did concur that I could
    get away with it as an estimate for the bias net, but I wouldn't
    bank on it for yield at least not as far as gain is concerned.
     
  11. Activ8 said
    This reminds me of one of my first interviews. The interviewer asked me
    to analyze a BJT amplier of some sort... and in the conversation I stated
    "since a BJT is a current controlled device". He immediately countered
    this statement and slapped the above Ic equation on the table.

    Naturally, I agreed has was correct and I was incorrect. After all, he was
    the interviewer and I was the interviewee.

    Got an offer by the way. ;-)
     
  12. Byron A Jeff

    Byron A Jeff Guest

    -
    ->
    -> You're definitely in the right newsgroup...
    ->
    -> -I have a microcontroller which runs of 5V. I want to connect an ultrasonic
    -> -transmitter to one of its outputs. I would also like the transmitter to run
    -> -of 9V (rather than 5V). I guess I need a transistor to do this (I have a 9V
    -> -regulator with the microcontroller).
    ->
    -> That's a good assessment. For this purpose you can think of the transistor as
    -> a switch between the collector and the emitter that's controlled by the base.
    ->
    -> But the funky thing that novices have to figure out is that bipolar transistors
    -> are controlled by current,
    -
    -Why did I come here? Novices need to learn that bipolars are *not*
    -current controlled devices but you can treat them as such sometimes.

    Novices such as myself are often taught simplified models. Everything I read
    about bipolars always talked about current amplification.

    So I have a question: if bipolars are in fact voltage controlled devices, then
    why is the base resistor required? It seems that as a voltage controlled device
    I would get the same amount of current through the CE junction at a particular
    voltage no matter the amount of current provided through the base. That's my
    simplified model of how FET transistors work, which BTW don't require a gate
    resistor. So why can't bipolars CE behavior be precisely controlled by the
    base-emitter voltage?

    W.J. Beaty wrote an article on the voltage controlled subject here:

    http://www.amasci.com/amateur/trshort.html

    I'm in the process of reading the longer piece to get a clearer understanding.

    BAJ
    -I'd suggest requesting a tuition refund from any prof who calls 'em
    -"current controlled", but it does no good to piss off the prof.
    -
    -Id = Is[e^(Vbe/Vt) - 1]
    -
    -Id is the be diode current and since
    -
    -Ie = Ic + Ib and since Ib is usually very small compared to Ie, we
    -can write
    -
    -Ic = Is[e^(Vbe/Vt) - 1]
    -
    -and therefor it is a voltage controlled device.

    So I should get a fixed collector current based on Vbe then?

    BAJ
     
  13. Activ8

    Activ8 Guest

    Good deal. That was smart.
     
  14. Because, though, physically, it is the voltage that causes everything
    inside the device to happen, there is a (possibly large but useless
    and not proportional to voltage) current that passes through the base
    to emitter junction while this voltage is turning the collector
    current on. 'Voltage controlled' does not necessarily imply high
    impedance or any linear voltage effect.
    Sorry. The diode effects in parallel with the operation make this
    impossible.
    If Vbe is controlled to be the solution of Ic = Is[e^(Vbe/Vt) - 1] (a
    function of temperature), and can supply the required base current
    (which is a function of temperature, collector voltage and collector
    current, i.o.w. beta), and as long as you are willing to neglect base
    spreading resistance and emitter resistance, and the collector to
    emitter voltage is well above Vbe, then yes. :)
     
  15. Activ8

    Activ8 Guest

    Hey, that's what I read when I was 12 and the h-parameter pi-equiv
    circuit of a bipolar found in all the texts I've read also preach a
    current controlled device.

    John Popelish's info is good. I'll just add a bit.
    That equation I gave comes from the diode eq. so think of it like a
    LED for a second. The forward voltage If (or Vbe of the bipolar)
    only needs to increase a very little compared to the large current
    increase ii causees - plug some numbers in - use say 4 E -15 for Is
    and you can drop the -1 term since if you figure a typical bipolar
    Vbe of 0.6 V and Vt of .025 mA (trust me), the -1 doesn't matter
    much.

    So if the Vbe drop is only 0.6 V (or 1.2 V for an LED) and you're
    supplying 5 V to it, that extra 4.4 V (3.8 V) has to be dropped by
    something or you'll let the smoke out.

    True, If you measure the hfe of the bopolar, and figure out the
    current needed into the base, you can find the base resistor that
    will drop the extra voltage at that base current ( V/I )

    It gets more interesting when the transistor is used as an
    amplifier, as opposed to a simple switch driven by a PIC (and BTW,
    I'll be ordering some more stuff from you in the future. I like your
    service.)
    ce junction? You mean Vce.
    Which BTW the gate of a MOSFET if that's what you mean, forms a
    capacitor with the channel, so current only flows for that brief
    instant that the cap is charging. With a regular FET, say N channel
    depletion mode, the negative gate voltage reverse biases the
    junction and creates a depletion region in the channel where current
    can't flow well. Mind you, I'm not fond of JFETs and am a bit weak
    in that area.
    As someone else said, it's the order of magnitude difference between
    the current and voltage increments that screws things up. Again,
    plug some numbers into the diode eq.

    There *is* however one case that comes to mind where you can control
    the current with Vbe easily and that's in constant current sources
    and current mirrors. You connect the c to b and program Ic with a
    resistor. e is common. The current flowing through the resistor must
    go into the collector (minus a little for the base) and it sets the
    Vbe for that operating point which can control Vbe in another tranny
    if you connect the 2 bases together and viola`, out pops a current
    which mirrors that of the controlling tranny.

    If yuo don't own a copy of AoE (art of electronis), you're wrong ;)
    Win and wassisname, cover current sources, etc., in that book. But
    wait for the 3rd Ed which is in the works.
    I'll chech it out. here's one for you:

    http://www.anasoft.co.uk/EE/bipolardesign1/bipolardesign1.html

    That's the link to his first bipolar design paper found at

    http://www.anasoft.co.uk/EE/index.html

    where you find other papers.

    Damn. Kevin made it hard enough to find that link.

    You might check out his Super Spice, also.

    As I said, it gets weird trying to design with bipolars as V
    controlled devices, but Kevin's papers pretty much spell it out so
    it isn't weird at all.
    see above.
     
  16. I have to admit that I was glad to read that Paul and Win are still both talking
    to each other after these projects together -- it can be a real strain. But I
    think it's wise to go grab the 2nd edition. It could be still quite a while
    before the 3rd edition comes out.

    Jon
     
  17. Activ8

    Activ8 Guest

    I didn't know thw relationship was strained. I haven't spoken with
    Mr Horowitz, but Win seems to be an OK guy.

    I personally didn't get *that* much out of AoE, but some of the
    tables are handy and I'd definitely recommend it to novices. I bet
    it can be had used for a good price, not that I felt it coming off
    the shelf brand new (spotted it at Barnes and Nobel while replacing
    a book I lost. I'm a tool, parts, and book junkie :)
     
  18. Oh, no. Don't get me wrong, here. I didn't say they *were* having troubles.
    Only that I can easily imagine how writing the same book and worrying over it
    for many decades could easily lead lesser people to strife. But I have no
    knowledge one way or the other on this score. I was just very glad to see that
    they are talking -- I read a post where Win talked about something he'd
    discussed with Paul, confirming that things are proceeding along.
    I did get quite a number of bits out of it that helped me over the years. It
    filled in where other books I had were lacking. (It sells at some international
    booksellers from India for under US$10, shipped to you anywhere. I wonder if
    Win's and Paul's publisher will be allowing Indian presses to print the 3rd
    edition, too. I kind of doubt it, but I'd be curious.)

    Jon
     
  19. Activ8

    Activ8 Guest

    Oh yeah. Like some marriages.
    I bought it later after hitting many books and articles.
     
  20. Byron A Jeff

    Byron A Jeff Guest

    -
    -> In article <12qlr9s1gkuds$>,
    -> -On 28 Jul 2004 16:52:28 -0400, Byron A Jeff wrote:
    -> -
    -<snip>

    [and snip some more]

    -> So I have a question: if bipolars are in fact voltage controlled devices,
    -> then
    -> why is the base resistor required?
    -
    -That equation I gave comes from the diode eq. so think of it like a
    -LED for a second. The forward voltage If (or Vbe of the bipolar)
    -only needs to increase a very little compared to the large current
    -increase ii causees - plug some numbers in - use say 4 E -15 for Is
    -and you can drop the -1 term since if you figure a typical bipolar
    -Vbe of 0.6 V and Vt of .025 mA (trust me), the -1 doesn't matter
    -much.
    -
    -So if the Vbe drop is only 0.6 V (or 1.2 V for an LED) and you're
    -supplying 5 V to it, that extra 4.4 V (3.8 V) has to be dropped by
    -something or you'll let the smoke out.
    -
    -True, If you measure the hfe of the bopolar, and figure out the
    -current needed into the base, you can find the base resistor that
    -will drop the extra voltage at that base current ( V/I )

    OK. That's a bit clearer. Kevin's page points out that small changes in the
    base voltage results in huge changes in the current draw due to the diode
    effect. That makes sense. So a 60mV change in the base voltage may change
    the Ice by several hundred milliamps.

    So then the base resistor facilitates using base input voltages well above
    the required Vbe to get the transistor to turn on.

    Got it.

    -
    -It gets more interesting when the transistor is used as an
    -amplifier, as opposed to a simple switch driven by a PIC (and BTW,
    -I'll be ordering some more stuff from you in the future. I like your
    -service.)

    Service? I have a service?

    [More snipping]

    BAJ
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-