Labs / Electronic modules

GraftSense - Passive Buzzer Module (Open Version)

Author: Li Zisheng · Source: FreakStudio open documentation, v1.4 · License: CC BY 4.0 · Driver code (misc/passive_buzzer_driver): MIT License

Contents
GraftSense - Passive Buzzer Module (Open Version)
GraftSense - Passive Buzzer Module (Open Version)

I. Module Introduction

Passive Buzzer Module which integrates a passive buzzer, a triode driving circuit, an indicator light, a filter circuit and a sensor interface, and is driven by PWM signals. It can realize the function of adjustable audio prompt, and is designed with power filtering and status indication functions. It is suitable for sound alarm or prompt scenarios of various electronic systems, and provides a flexible audio feedback solution for equipment.

2. Introduction to Main Chips

A buzzer (Buzzer) is an electronic component used to generate sound, which is widely applied in various devices to produce warning tones, prompt tones or other sound effects. According to different working principles, buzzers mainly fall into the following types:

GraftSense - Passive Buzzer Module (Open Version)
GraftSense - Passive Buzzer Module (Open Version)
GraftSense - Passive Buzzer Module (Open Version)

In practical applications, the two have their respective focuses:

For the driving circuit of the passive buzzer module, its core component is the triode, which functions to amplify the weak control signal output by the microcontroller unit (MCU) and provide sufficient power for the passive buzzer to make it emit a clear sound.

2.1 Chip Overview

This chip is an electromagnetic passive buzzer of Huaneng brand QMB-09B-03 model, which is suitable for audio prompt or alarm scenarios of various electronic systems, and needs to cooperate with an external drive circuit to realize the sound feedback function.

2.2 Pin Definition

GraftSense - Passive Buzzer Module (Open Version)

This passive buzzer has two pins, namely the positive pole (+) and the negative pole (-). The pin marked "(+)" is the positive power input terminal, which needs to be connected to the positive voltage output terminal of the drive circuit; the pin marked "(-)" is the negative power input terminal, which needs to be connected to the ground or the negative output terminal of the drive circuit.

2.3 Functional Block Diagram

None.

2.4 Performance Parameters

GraftSense - Passive Buzzer Module (Open Version)
GraftSense - Passive Buzzer Module (Open Version)

This frequency response curve clearly demonstrates the acoustic characteristics of the passive buzzer: within the test frequency range of 200 Hz to 10 kHz, its sound pressure level fluctuates significantly with frequency changes. The resonance frequency band around 3 kHz yields the highest sound pressure (close to 90 dB), making it the frequency band with optimal sound generation efficiency. In contrast, the sound pressure in the low-frequency band (200 Hz-1 kHz) and high-frequency band (above 4 kHz) is relatively stable, maintaining at approximately 70-85 dB and 80 dB respectively, which provides an intuitive basis for frequency selection in different scenarios.

2.5 Reference Circuit

GraftSense - Passive Buzzer Module (Open Version)

2.6 Chip Configuration

None.

None.

2.8 PCB Routing Precautions

No special requirements.

III. Circuit Engineering

3.1 Circuit Source Engineering

To obtain the circuit source project, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

The schematic diagram of this module is shown below:

SCH_Passive Buzzer Module_v1.1_2025-11-03.pdf 1.8 MB

GraftSense - Passive Buzzer Module (Open Version)

This module provides the DOUT interface: the main control unit outputs PWM waves through the DOUT pins to control the buzzer to generate sound.

It is recommended that the output PWM waveform has a frequency of around 3000 Hz.

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and the passive buzzer module uses the DIO interface to communicate with the main controller.

Here, we first use the HY2.0-4P cable to connect the module to the GraftPort-RP2040 development board's DIO0 interface:

GraftSense - Passive Buzzer Module (Open Version)

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 6

DOUT

MCU's PWM output pin / high-low level output pin

Pin 7

NC

-

Here, we need to search for the relevant driver packages on uPyPI: https://upypi.net/zh/

GraftSense - Passive Buzzer Module (Open Version)

Enter passive_buzzer_driver to search, and the following will be displayed:

GraftSense - Passive Buzzer Module (Open Version)

Click to copy the local installation command:

GraftSense - Passive Buzzer Module (Open Version)

Here, we can import the module driver library code via the mip tool. Below are the usage commands for the mpremote tool:

mpremote mip install github:FreakStudioCN/GraftSense-Drivers-MicroPython/misc/passive_buzzer_driver

After importing the buzzer driver - MicroPython driver code, copy the following main.py code into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-        
# @Time    : 2024/9/19 9:09 PM
# @Author  : Li Qingshui
# @File    : main.py       
# @Description : PWM class usage, drive a buzzer to play MIDI music

# ======================================== Import Modules =========================================

# Import time-related modules
import time
# Import the buzzer driver class
from buzzer import Buzzer

# ======================================== Global Variables ============================================

# Melody and rhythm of Twinkle Twinkle Little Star: each note and its duration
MELODY = [
    ('C4', 400), ('C4', 400), ('G4', 400), ('G4', 400), ('A4', 400), ('A4', 400), ('G4', 800),
    ('F4', 400), ('F4', 400), ('E4', 400), ('E4', 400), ('D4', 400), ('D4', 400), ('C4', 800),
    ('G4', 400), ('G4', 400), ('F4', 400), ('F4', 400), ('E4', 400), ('E4', 400), ('D4', 800),
    ('G4', 400), ('G4', 400), ('F4', 400), ('F4', 400), ('E4', 400), ('E4', 400), ('D4', 800),
    ('C4', 400), ('C4', 400), ('G4', 400), ('G4', 400), ('A4', 400), ('A4', 400), ('G4', 800),
    ('F4', 400), ('F4', 400), ('E4', 400), ('E4', 400), ('D4', 400), ('D4', 400), ('C4', 800)
]

# ======================================== Functions ============================================

# ======================================== Custom Classes ============================================

# ======================================== Initialization ==========================================

# Power-on delay of 3 s
time.sleep(3)
# Print debug information
print("FreakStudio : Use PWM to drive a buzzer to play MIDI music")
# Initialize the buzzer object
buzzer = Buzzer(pin=6)

# ========================================  Main Program  ===========================================

# Play the music in a loop
while True:
    # Play the melody "Twinkle, Twinkle, Little Star"
    buzzer.play_melody(MELODY)

Burn the code, open the terminal, and use the mpremote tool to connect to the main controller. The output is as follows:

GraftSense - Passive Buzzer Module (Open Version)

We can see that the buzzer module plays music.

4. Drivers

passive_buzzer_driver.zip 8 KB

None.

VI. Revision History

Document Version

Date of Modification

Modifier

Revised Content

v1.0

2025-09-04

ben0i0d

Initialize Document

v1.1

2025-11-03

Li Zisheng

Added PCB routing precautions for Version 2.8

Revised Section 3, Instructions for Circuit Source Project and Module Usage, and added a secondary heading:

3.1 Circuit Source Engineering, 3.2 Module Usage Instructions, 3.3 Application Experiments

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.2

2025-12-29

Li Zisheng

Added application experiments and production files

v1.3

2025-12-31

Xin Ruili

Create an open version of the document based on the internal document version v1.2.

v1.4

2026-03-29

Xin Ruili

Modified the application experiment section

VII. Relevant Materials

7.1 Chip Datasheet

C96256_Buzzer_QMB-09B-03_Datasheet_WJ284876.PDF 968 KB

7.2 Unique Icons for PCB Silk Screen

GraftSense - Passive Buzzer Module (Open Version)