1

Need to use an ESP32 to run a buzzer datasheet The source current maximum per pin of the esp32 is 20mA

However I need to drive an active buzzer with 3V@30mA, so I decided to use an N-MOSFET (2N7002 datasheet) to drive the buzzer on the low side

enter image description here

According to the datasheet at around Vgs = 3V Id will be around 300mA.

Questions,

  1. Is my circuit correct to drive the 3V buzzer?
  2. Do I need to add a current limiting resistor between ESP32 and gate of the 2N7002? Since I'm not sure the required current on the gate of the MOSFET (Someone did told me it is safe to assume it is 0ma).
vu2nan
  • 15,929
  • 1
  • 14
  • 42
Eqkaier
  • 11
  • 2

1 Answers1

2

I need to drive an active buzzer with 5V@30mA

You need to add a resistor in series with the buzzer if your supply is 5 volts. The resistor will drop the voltage on the buzzer to a value that is within the 4.5 volt maximum specification for the device.

However, if your supply is only 3 volts (as per your schematic) then no resistor is required.

Regarding the 30 mA figure you think you want, this cannot be established from the data sheet because the only figure given is the maximum value of 30 mA. In other words, the device may only take 20 mA when driven at 4.5 volts and, there's nothing you can do to alter that other than driving at a higher voltage and risking damaging the buzzer.

Do I need to add a current limiting resistor between ESP32 and gate of the 2N7002?

Not normally although, placing a 1 kΩ resistor might be a good idea. Note also that the 2N7002 will drop about 0.1 volts across drain and source when the gate is activated at a 3 volt level.

According to the datasheet at around Vgs = 3V Id will be around 300mA.

Only if the MOSFET drain load and supply allow that to occur. You don't actually want that to occur because you want the MOSFET acting as a switch in its triode region. If you look at this graph from the 2N7002 data sheet linked in your question, you'll see that with Vgs at 3 volts, Id will be about 150 mA and not 300 mA: -

enter image description here

But, as I said earlier, you won't be operating in this region, you'll be operating roughly where the light-green dot is.

Andy aka
  • 434,556
  • 28
  • 351
  • 777