Powering a 9v buzzer from 3.3v pin


I am building a project in which I am using esp32 (please excuse if this forum does not deal with esp). I have the need to power a simple peizzo buzzer from it.

If I power the buzzer with 3.3v it is not very audible. So I need 9v for clarity. Esp digital pin will only output 3.3v.

Can I use a dc to dc step up converter for this ? I understand peizzo buzzers don't really use lot of current. Am I right to use a step up here then?

Please guide.

No. An ESP pin doesn't have enough current to drive a step up convertor. You just use the ESP output to gate a 9V power supply to the buzzer. A FET circuit can do that.

Ok thanks :+1:

Generally, a transistor will do such as the the ubiquitous 2N2222 with a 2k2 base resistor. Of coruse a FET is better but you have to pick a logic-level one - I was about to suggest the 2N7000 for up to 150 mA but it is marginal on 3.3 V.

Yeah, it'll be a borderline solution - may or may not work well enough. However, if 2 of them are cascaded, no problem.

Interesting. How would you propose that?

Using one as the driver for the other, like so:

Well of course, the maximum specified threshold voltage is 3 V, so you are using the marginal conduction of the first to switch against the 10k.

Sort of workable, but marginal. :grin:

Not "sort of" workable. It works.

In simulation...

You show it running on 9V. The 2N7002 has a VGSth of 2.5V max, so the pre-driver just barely makes it. That will rise as the temperature drops, so it would be sensitive to cold environments. Mathematically, it's okay, but you are supposed to leave a noise margin...

True, but the current it has to switch is negligible so technically, it would - just - work. :face_with_raised_eyebrow:

Two FETs to do the job of one BJT.