Skip to content

Buzzer Control Circuit

Purpose

This circuit provides high-side switching control for 5V loads such as buzzers, relays, LED lights, and solenoids. The design uses a P-channel MOSFET with NPN transistor gate drive to enable microcontroller control of inductive and resistive loads with flyback protection.

Control Signal

  • Origin: ESP32 GPIO (or any 3.3V microcontroller)
  • Voltage: 3.3V logic level
  • Logic: Active HIGH (GPIO HIGH = Load ON, GPIO LOW = Load OFF)

Main Components

Component Part Number Function
Q6 FDN340P P-channel MOSFET high-side switch
Q5 BC847 NPN transistor gate driver
R38 1kΩ 1% Base current limiting resistor
R65 6.8kΩ Gate pullup resistor
D1 SMAJ6.0A Flyback protection diode

Circuit Connections

Power Connections

  • Pin 1 (Source): Connected to 5V supply rail
  • Pin 3 (Drain): Connected to load positive terminal
  • Load negative terminal: Connected to GND

Control Connections

  • BuzzerControl: Connected to ESP32 GPIO output
  • Q5 Base: Connected to BuzzerControl through R38 (1kΩ)
  • Q5 Emitter: Connected to GND
  • Q5 Collector: Connected to Q6 Gate
  • Q6 Gate: Pulled to 5V through R65 (6.8kΩ)

Protection

  • SMAJ6.0A diode: Cathode to load positive (Pin 3), Anode to GND
  • Function: Clamps inductive flyback voltage during load turn-off

Operating Voltages

  • Supply Voltage: 5V from switching power supply
  • Control Logic: 3.3V (GPIO high), 0V (GPIO low)
  • Load Voltage: 5V (when switch ON)

Circuit Operation

Normal Conditions - Load OFF (GPIO = LOW)

  1. Q5 (BC847 NPN) base is LOW → Q5 is OFF
  2. Q5 collector is pulled HIGH through R65 (6.8kΩ)
  3. Q6 (FDN340P P-MOSFET) gate is at ~5V, same as source
  4. Q6 gate-source voltage = 0V → Q6 turns OFF
  5. No current flows through load → Load is OFF

Load Activation (GPIO = HIGH)

  1. Q5 base gets current through R38: (3.3V - 0.7V) / 1kΩ = 2.6mA
  2. Q5 (BC847 NPN) turns ON
  3. Q5 collector pulled LOW (to GND)
  4. Q6 gate is now LOW (0V), source is still at 5V → VGS = -5V
  5. Q6 turns ON → P-MOSFET conducts
  6. Current flows: 5V → Q6 → Load → Load turns ON

Current Capability Analysis

FDN340P Specifications

  • Maximum continuous current: 2A (datasheet limit)
  • Maximum pulsed current: 10A
  • RDS(on): ~65mΩ at VGS = -2.5V
  • Maximum power dissipation: 0.5W

Thermal and Power Analysis

Load Current MOSFET Power Loss Voltage Drop Load Power Efficiency
50 mA <1 mW 3 mV 0.25 W 99.9%
100 mA 1 mW 7 mV 0.50 W 99.9%
200 mA 3 mW 13 mV 1.00 W 99.7%
500 mA 16 mW 33 mV 2.48 W 99.4%
1 A 65 mW 65 mV 4.93 W 98.7%

Practical Current Limits

  • MOSFET capability: 2A continuous
  • 5V supply sharing: ~500mA practical maximum (50% of 1A 5V rail)
  • Recommended maximum: 500mA for system reliability

Load Compatibility

Supported Load Types

Load Type Typical Current Compatibility
Piezo buzzer 5-15 mA ✅ Excellent
Magnetic buzzer 20-80 mA ✅ Excellent
Small relay (5V) 50-100 mA ✅ Good
Automotive relay 100-200 mA ✅ Good
LED strips 100-300 mA ✅ Good (within limits)
Small solenoids 200-500 mA ✅ At practical limit
Large solenoids/relays >500 mA ⚠️ Exceeds recommended limit

Idle Power Consumption

Circuit Idle Current (Load OFF)

  • GPIO LOW (load OFF): Only R65 conducts: 5V / 6.8kΩ = 0.74mA
  • 5V rail idle current: 0.74mA
  • 12V input equivalent: 0.74mA × (5V/12V) / 0.874 = 0.35mA
  • Note: Assumes 87.4% overall power supply efficiency (12V→5V→load)
  • Quiescent power: 4.2mW at 12V input

Active Power (Load ON)

  • GPIO HIGH: Base current (2.6mA) + Load current + R65 current (0.74mA)
  • Total 5V current: Load current + ~3.4mA overhead
  • Minimal control overhead compared to load power consumption

Bill of Materials (BOM)

Reference Part Number Description Package Quantity
Q6 FDN340P P-Channel MOSFET, -20V, -2A SOT-23 1
Q5 BC847 NPN Transistor, 45V, 100mA SOT-23 1
R38 ERJ-3EKF1001V Resistor, 1kΩ, 1%, 0603 0603 1
R65 ERJ-3EKF6801V Resistor, 6.8kΩ, 1%, 0603 0603 1
D1 SMAJ6.0A TVS Diode, 6V, 400W SMA 1

Design Considerations

Flyback Protection

  • SMAJ6.0A clamps inductive kickback to 6V above ground
  • Essential for relay and solenoid loads
  • Protects both MOSFET and supply circuit

Switching Speed

  • Turn-on time: Limited by BC847 and gate drive
  • Turn-off time: Limited by R65 pullup
  • Suitable for DC switching, not high-frequency PWM

PCB Layout

  • Keep gate drive traces short to minimize noise pickup
  • Place flyback diode close to load connection
  • Use adequate copper area for current-carrying traces

Performance Goals

  • High efficiency: >99% at typical buzzer loads
  • Reliable operation: Wide safety margins on current handling
  • Low idle power: Minimal impact when load is OFF
  • Inductive load safe: Flyback protection for all load types

Notes

  • Logic is active HIGH: GPIO HIGH turns load ON
  • Can handle PWM control if switching frequency is kept low (<1kHz) (? not tested)