+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 33
  1. #1
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Driving a buzzer using a transistor

    Hi,

    I am making a project with involves driving a passive buzzer. I need to simply produce a beep sound at regular intervals. Since this is the first time I am using a buzzer in a project, I am posting its schematic for anyone to pls. check if it will work.

    Click image for larger version. 

Name:	driving_a_buzzer.jpg 
Views:	8 
Size:	83.9 KB 
ID:	153140

    First of all since I need to generate / not generate a beep sound depending on DC voltage at the base of the transistor, I will be needing a passive buzzer only (and not an active buzzer). I hope I am correct?

    I am using BCP56 transistor to drive the buzzer as a collector-terminal load. The current through the buzzer is to be 25 mA (max. value can be 50 mA) and its coil resistance is 16 ohms. I will be using a 5v. collector power supply. The base is to be driven by LVCMOS output (logic high = 3.3v and logic low = 0.2v max.).


    I just needed to ensure that the buzzer will beep when it is logic high at the base terminal and no beep sound when it is logic low at the base terminal of the transistor. Is this buzzer driving technique OK or do I need to change it for the required functioning?


    Looking forward to your comments
    .
    Thanks,
    Hobbyiclearner

  2. #2
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    Hi,

    For a passive buzzer, you need an AC or pulsating DC signal to make it buzz. Driving the base of the transistor with straight DC will not work. However, if your drive it with pulses of appropriate frequency and reasonable duty cycle, then it will work.
    -------------
    --Akanimo.


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 9,710, Level: 23
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,717
    Helped
    401 / 401
    Points
    9,710
    Level
    23

    Re: Driving a buzzer using a transistor

    Hi,

    I think that circuit is missing a resistor (100k or higher) from the junction of the 15k8 and BJT base to ground, and perhaps it wouldn't be a bad idea to add a series current-limiting resistor from VCC to buzzer pin 1, or between buzzer pin 2 and the BJT collector.



  4. #4
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    The resistor from the junction to ground may not be necessary for BJT as compared to MOSFET.

    The current-limiting resistor in series with the buzzer is absolutely necessary. If you desire 25mA of current through the buzzer, then you'll need to solve the following equation to determine the value of the current-limiting resistance, Rlim:

    25mA = (5-Vcesat)/(16+Rlim).
    -------------
    --Akanimo.



    •   AltAdvertisement

        
       

  5. #5
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Re: Driving a buzzer using a transistor

    OK. Thanks for your informative post. I just need a buzzer/beeper which will produce a sound when there is DC input and no sound when there is no DC input. I dont want to add the complication of pulsating DC / AC etc. Can you pls. suggest any such device pls.? It just needs to be small and PCB mountable.

    Regards,
    Hobbyiclearner



  6. #6
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    Quote Originally Posted by hobbyiclearner View Post
    OK. Thanks for your informative post. I just need a buzzer/beeper which will produce a sound when there is DC input and no sound when there is no DC input. I dont want to add the complication of pulsating DC / AC etc. Can you pls. suggest any such device pls.? It just needs to be small and PCB mountable.
    ...
    Go for an active buzzer then.
    -------------
    --Akanimo.


    1 members found this post helpful.

  7. #7
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Re: Driving a buzzer using a transistor

    Quote Originally Posted by Akanimo View Post
    The resistor from the junction to ground may not be necessary for BJT as compared to MOSFET.

    The current-limiting resistor in series with the buzzer is absolutely necessary. If you desire 25mA of current through the buzzer, then you'll need to solve the following equation to determine the value of the current-limiting resistance, Rlim:

    25mA = (5-Vcesat)/(16+Rlim).
    Using this expression I am getting the Rlim as a negative value and equal to -15.99 ohms (Vcesat=0.5v). I suppose even the magnitude of the resistor value is quite small. Do you suppose such a small resistor value is not negligible?

    Thanks,
    Hobbyiclearner

    - - - Updated - - -

    Quote Originally Posted by Akanimo View Post
    Go for an active buzzer then.
    Thanks. Can you pls. point to the datasheet of an active buzzer as a reference. I dont know which ones will be good for the calculations.

    Regards,
    Hobbyiclearner



  8. #8
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    You need the current-limiting resistor. Without it the current that would be flowing through the buzzer would be about 300mA (ie Vcc/Rbuzzer = 5V/16ohm).
    -------------
    --Akanimo.



  9. #9
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Re: Driving a buzzer using a transistor

    Quote Originally Posted by d123 View Post
    Hi,

    I think that circuit is missing a resistor (100k or higher) from the junction of the 15k8 and BJT base to ground.
    Just for information purpose, why is this resistor required (whether in BJT or MOSFET).

    Thanks,
    Hobbyiclearner



    •   AltAdvertisement

        
       

  10. #10
    Super Moderator
    Points: 74,965, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,196
    Helped
    3464 / 3464
    Points
    74,965
    Level
    66

    Re: Driving a buzzer using a transistor

    Hi,

    An internet search gives a lot of results.
    I recommend to do a search at your favourite distributor.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  11. #11
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    With Vcesat=0.5V I got Rlim=164ohm. You can use 150ohm.

    You got a negative number for Rlim because you use 25A instead of 0.025A = 25mA.
    -------------
    --Akanimo.



  12. #12
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Re: Driving a buzzer using a transistor

    OK. I suppose the equation would be :

    5-Vcesat = 25mA*(16+Rlim)

    This gives Rlim to be 164 ohms. I am choosing 200 ohms. Hope its OK? Also, is the value of other resistor Rb (15.8 Kohms) OK in this case? BTW what are the typical coil resistance of active buzzers?

    Thanks,
    Hobbyiclearn



  13. #13
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    It's required with MOSFETs to help drain the gate charges when the MOSFET supposed to be left open.

    You know, when you turn off the MOSFET, it would have charges at the gate so you want to drain the charges to have it open.

    - - - Updated - - -

    Quote Originally Posted by hobbyiclearner View Post
    OK. I suppose the equation would be :

    5-Vcesat = 25mA*(16+Rlim)

    This gives Rlim to be 164 ohms. I am choosing 200 ohms. Hope its OK? Also, is the value of other resistor Rb (15.8 Kohms) OK in this case? BTW what are the typical coil resistance of active buzzers?

    Thanks,
    Hobbyiclearn
    To determine the required base resistor value Rb, you need to provide the hFE of the transistor.
    -------------
    --Akanimo.



  14. #14
    Full Member level 2
    Points: 1,427, Level: 8

    Join Date
    Oct 2014
    Posts
    128
    Helped
    2 / 2
    Points
    1,427
    Level
    8

    Re: Driving a buzzer using a transistor

    OK. Do you think that this is a good buzzer for the purpose?

    Thanks,
    Hobbyiclearner

    - - - Updated - - -

    Quote Originally Posted by Akanimo View Post
    ][/COLOR]

    To determine the required base resistor value Rb, you need to provide the hFE of the transistor.
    The hfe value of BCP56 at 25 degree celcius at 25 mA collector current is approximately 150. And Vbe for same conditions is 0.75v

    Thanks,

    Hobbyiclearner



  15. #15
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    Quote Originally Posted by hobbyiclearner View Post
    ...
    BTW what are the typical coil resistance of active buzzers?
    ...
    To be sincere with you, you do not have to hurriedly choose an active buzzer in place of a passive one since they are usually more expensive. There are still options to explore.

    If you are driving the transistor with an MCU, then you can derive a clock signal and drive the transistor with that clock signal anytime the DC signal that was supposed to drive it is HIGH.

    - - - Updated - - -

    Ic=hFE*Ib; Ib=Ic/hFE
    Ib=25mA/150 = 167uA
    Vb-0.7=Ib*Rb
    Rb=(Vb-0.7)/Ib = (3.3-0.7)/167u = 15,568ohm (use 15kohm or lower value for Rb)

    200ohm is okay for Rlim. I'd prefer 150ohm though.
    Last edited by Akanimo; 16th May 2019 at 22:10.
    -------------
    --Akanimo.



  16. #16
    Advanced Member level 5
    Points: 9,710, Level: 23
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,717
    Helped
    401 / 401
    Points
    9,710
    Level
    23

    Re: Driving a buzzer using a transistor

    Hi,

    Quote Originally Posted by hobbyiclearner View Post
    Just for information purpose, why is this resistor required (whether in BJT or MOSFET).
    So the base/gate is at a defined level when "off"/so it's not floating, to avoid unwanted spurious turn-on.

    Experiment with two MOSFETs and two LEDs (real world, preferably): One NMOS with a resistor to ground on the gate, the other without - the LED on the one without the resistor will most likely be on whether the gate signal is high or low.



  17. #17
    Super Moderator
    Points: 74,965, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,196
    Helped
    3464 / 3464
    Points
    74,965
    Level
    66

    Re: Driving a buzzer using a transistor

    Hi,

    There is no need for a gate-source or base-emitter resistor.
    Usual logic outputs are push-pull and (especially nowadays CMOS outputs) have good V_OL levels.

    Thus you need to answer yourself three questions:
    * do you use a Mosfet or IGBT?
    * is there a time when your logic output is floating (often with microcontroller for a short time at power up until port setup is done)?
    * do you see a problem when during this (short) time the buzzer is (partly) energized?

    If your answer is 3 x "yes" --> then use the resistor at the gate.
    Otherwise you may omit it.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

  18. #18
    Advanced Member level 5
    Points: 9,710, Level: 23
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,717
    Helped
    401 / 401
    Points
    9,710
    Level
    23

    Re: Driving a buzzer using a transistor

    Hi,

    Quote Originally Posted by KlausST View Post
    There is no need for a gate-source or base-emitter resistor.
    Usual logic outputs are push-pull and (especially nowadays CMOS outputs) have good V_OL levels.

    Thus you need to answer yourself three questions:
    * do you use a Mosfet or IGBT?
    * is there a time when your logic output is floating (often with microcontroller for a short time at power up until port setup is done)?
    * do you see a problem when during this (short) time the buzzer is (partly) energized?

    If your answer is 3 x "yes" --> then use the resistor at the gate.
    Otherwise you may omit it.
    Thanks, I didn't know that, that can save a resistor or three sometimes. Power-up spikes are annoying, brief as they may be. 2) and 3) are unavoidable undesirables for me, mcu or not - learnt to accept it paying attention to design note osc captures. Thanks for clarifying.



  19. #19
    Advanced Member level 4
    Points: 5,661, Level: 17
    kripacharya's Avatar
    Join Date
    Dec 2012
    Location
    New Delhi
    Posts
    1,033
    Helped
    173 / 173
    Points
    5,661
    Level
    17

    Re: Driving a buzzer using a transistor

    The base resistor must be less than 4.7Kohm to ensure your BCP56 goes into saturation. I would suggest to use 2.2K
    A resistor from base to GND does no harm, but does ensure that your BJT does turn off when signal goes low. 10K ohm should be ok.

    A current limiting resistor is a MUST to safeguard the buzzer. With 5v supply you should use between 180ohm - 220ohm. (Check the calculations)
    One question - why do you have two separate voltages - 3.3v and 5v. Why not drive everything with 3.3v ? If you do, then the limiting resistor should be reduced to 100 ohm

    Do check the output drive capability of LCVMOS technology -- it needs to be able to source at least around 3-400uA for this circuit to work failsafe. This is because you have to use a worst case (lowest) hFE or Beta to ensure your circuit always works.

    Lastly - I assume your buzzer buzzez simply when you pass current through it. Seeing you have written here detailed impedance/ current parameters, then do also publish the actual buzzer product page for our general knowledge.
    Last edited by kripacharya; 17th May 2019 at 16:28. Reason: additional clarification


    1 members found this post helpful.

  20. #20
    Advanced Member level 1
    Points: 2,463, Level: 11

    Join Date
    Aug 2016
    Posts
    425
    Helped
    69 / 69
    Points
    2,463
    Level
    11

    Re: Driving a buzzer using a transistor

    Hi,

    The OP mentioned that the current through the buzzer should be 25mA (50mA being the maximum value). I selected 150 ohm in place of 164 ohm. This would get the current to be a little greater than 25mA but still lie within 25mA and 50mA.
    -------------
    --Akanimo.



    •   AltAdvertisement

        
       

--[[ ]]--