News

How Magnetic Buzzers Work: Magnet Bias, Coil Inductance and Flyback Protection

The magnetic buzzer is the other workhorse of electronic beepers: a coil, a ring magnet and a thin steel diaphragm that produce a crisp tone from a few volts and a few tens of milliamps. It works on a completely different principle from the piezo buzzer, and electrically it looks like an inductor rather than a capacitor, so the drive circuit has its own rules. This article starts with the magnetic circuit, explains why a permanent-magnet bias is essential and what sets the resonant frequency and output level, then works through the coil impedance and current waveform, shows why the flyback diode is not optional, and closes with a comparison of magnetic and piezo types.

  • 2–4 kHzTypical rated frequency
  • −26 dB2nd harmonic at 5:1 bias
  • 75 μsExample coil L/R time constant

1. Construction: Coil, Magnet and Steel Diaphragm

Figure 1 shows a typical cross-section. A pole piece rises from the centre of a steel base plate (the yoke) and carries the coil. A ring magnet sits on the outer part of the base plate, and a thin diaphragm of magnetic steel rests on top of the magnet. A small iron disc (the armature) is often fixed to the centre of the diaphragm, leaving a narrow air gap above the pole face. Above the diaphragm, the housing forms a front cavity that opens to the outside through the sound port.

N S N S 1 2 3 4 5 6 7 8 9 10 1 Sound port 2 Front cavity 3 Armature disc 4 Steel diaphragm 5 Air gap 6 Pole piece 7 Coil 8 Ring magnet 9 Base yoke 10 Pins Bias flux path
Figure 1 Cross-section of a magnetic buzzer (schematic). The ring magnet drives bias flux through the diaphragm, air gap, pole piece and base; coil current strengthens or weakens the gap flux

The magnet, diaphragm, air gap, pole piece and base plate form a closed magnetic circuit (dashed line). Flux from the magnet crosses the gap and pulls the diaphragm slightly towards the pole, so the diaphragm rests in a pre-loaded equilibrium position. When current flows in the coil, its flux adds to this circuit: in one direction the gap flux rises and the diaphragm is pulled closer; in the other the flux falls and the diaphragm springs back. An alternating current therefore sets the diaphragm vibrating and radiating sound.

This is fundamentally different from a moving-coil loudspeaker. In a loudspeaker the voice coil moves in the gap and is driven by the Lorentz force F = Bil. In a magnetic buzzer the coil is stationary and the ferromagnetic diaphragm moves under magnetic attraction – a moving-iron transducer. Because the diaphragm is itself part of the magnetic circuit, its material, thickness and magnetic properties directly affect sensitivity.

2. Why the Permanent-Magnet Bias Is Essential

Magnetic attraction can only pull, never push, and it scales with the square of the flux density. For a pole face of area A:

F = B2A / (2μ0)

where B is the flux density in the gap (T), A is the pole area (m2), μ0 = 4π × 10−7 H/m is the permeability of free space and F is in newtons. Example: a 3 mm pole (A ≈ 7.07 × 10−6 m2) with a bias flux density of 0.1 T gives a static pull of about 0.028 N.

Let the magnet supply a bias flux density B0 and the coil add an alternating component b·sinωt. Substituting and expanding:

(B0 + b sinωt)2 = B02 + b2/2
 + 2B0b sinωt − (b2/2) cos2ωt

The first line is the static pull. In the second line, 2B0b sinωt is the useful force at the drive frequency and (b2/2) cos2ωt is a second-harmonic distortion term. Their amplitude ratio is b/(4B0).

The bias magnet therefore does two jobs (Figure 2):

  • It keeps force and current at the same frequency. Without bias (B0 = 0) only the b2 term remains: both half-cycles pull, so the force runs at twice the current frequency and never reverses. The diaphragm barely moves.
  • It amplifies and linearizes. The useful term is proportional to B0, so a stronger bias gives more alternating force for the same coil current, while the second harmonic shrinks in relative terms: with B0 = 5b it sits about 26 dB below the fundamental, and with B0 = 10b about 32 dB below.
Coil current i No bias: F ∝ i2 Biased: ΔF (B0 = 5b) 0° 180° 360° 540° 720° −1 −0.5 0 0.5 1 Phase ωt Normalized No bias: two pulls per cycle, frequency doubles Biased: force follows the current
Figure 2 Magnetic force for a sinusoidal coil current, computed from F ∝ B2 and normalized. Without bias the force doubles in frequency and only pulls; with bias the alternating force follows the current

More bias is not always better, though. The pull increases as the gap closes, which acts on the diaphragm as a negative stiffness:

keff = kd − |∂F/∂g|

where kd is the bending stiffness of the diaphragm (N/m), g is the gap length (m) and ∂F/∂g is the rate at which the pull changes with gap. A stronger bias or a smaller gap raises the negative stiffness, lowers the effective stiffness keff and pulls the resonance down. If the negative stiffness approaches the diaphragm stiffness, the diaphragm snaps onto the pole and the buzzer falls silent.

Magnet strength, gap and diaphragm stiffness must therefore be designed together: too weak a magnet gives low output, while too strong a magnet or too small a gap lowers the frequency, narrows the dynamic range or causes snap-in. The same mechanism explains why demagnetization, a deformed diaphragm or a gap disturbed by assembly stress shows up as lost output or a shifted frequency.

3. Resonant Frequency and What Sets the Output Level

The diaphragm and its armature behave approximately as a mass–spring system with resonance:

f0 = (1/2π)·√(keff / m)

where m is the effective moving mass of diaphragm, armature and co-moving air (kg). Example: an effective mass of 0.05 g and a target f0 of 2.7 kHz require keff ≈ 1.44 × 104 N/m.

Diaphragm excursion peaks near f0. The front cavity and sound port also form a Helmholtz resonator, and designers place the two resonances close together so that they reinforce each other at the rated frequency – exactly as in a piezo buzzer, whose article covers the cavity calculation. Finished magnetic buzzers are usually rated somewhere between 2 and 4 kHz, and output drops noticeably away from the rated frequency.

FactorEffectReason
Magnet strengthToo strong: lower frequency, risk of snap-in; too weak: low outputBias B0 sets both the useful force and the negative stiffness
Air gapSmaller gap: more output, lower frequencyLower reluctance raises the pull and its gradient
Diaphragm thickness and materialThicker diaphragm: higher frequencyBending stiffness scales roughly with thickness cubed
Armature massHeavier armature: lower frequencyf0 ∝ 1/√m
Cavity and sound portChanged volume or port: resonance shiftsHelmholtz frequency varies with S/(VL′)
Drive frequency and voltageOff-frequency or low-voltage drive: less outputUseful force ∝ coil current; response peaks at resonance

4. The Coil Is an Inductor: Impedance and Current

Seen from the circuit, a magnetic buzzer is mainly an iron-cored coil: a DC resistance R in series with an inductance L. (Diaphragm motion also generates a back-EMF that alters the impedance slightly near resonance; we ignore it here.)

|Z| = √(R2 + (2πfL)2)
τ = L / R

where R is the coil DC resistance (Ω), L is the coil inductance (H) and τ is the time constant of current rise and fall (s).

Take an example coil with R = 40 Ω and L = 3 mH. At 2.7 kHz the reactance is about 50.9 Ω, |Z| ≈ 64.7 Ω and the voltage leads the current by about 52°. The time constant is 75 μs. Half a period of a 2.7 kHz square wave lasts about 185 μs, roughly 2.5τ, so in each on-interval the current reaches only about 91% of its final value V/R. The higher the frequency, the higher the reactance and the lower the current for a given voltage – one reason magnetic buzzers are not suited to high-frequency drive.

Caution: the inductance varies with gap, diaphragm position and core magnetization, and the core has eddy-current and hysteresis losses. The R and L used here are illustrative values only; rely on the rated current in the datasheet and on measurement.

5. Driving a Passive Magnetic Buzzer

A passive (externally driven) magnetic buzzer needs an alternating signal at its rated frequency. A microcontroller pin generally cannot sink tens of milliamps into an inductive load, so the usual solution is an NPN transistor (or N-channel MOSFET) as a low-side switch, with a flyback diode connected in reverse across the buzzer (Figure 3).

+5 V Rb ≈ 470 Ω NPN C E B MCU push-pull pin 2.7 kHz square, 3.3 V Coil R, L Flyback diode On: 5 V → coil → C → E → GND Off: current circulates through the diode; collector clamped near VCC + VF Cathode (bar) to the supply
Figure 3 Typical drive circuit for a passive magnetic buzzer: an NPN low-side switch with a flyback diode connected in reverse across the buzzer (example values)

Why the flyback diode is not optional

Current in an inductor cannot change instantly. When the transistor turns off, the coil generates v = L·di/dt, with a polarity that drives the collector upward. In our example, interrupting 110 mA within 1 μs would in theory produce a spike of about 330 V. In practice the transistor breaks down or parasitic capacitance limits it, but that is enough to destroy the transistor and radiate plenty of interference. With the diode in place (cathode to the supply), the current keeps circulating through the coil and diode at turn-off, the collector is clamped near VCC + VF, and the stored energy is dissipated in the coil resistance and the diode. A small-signal switching diode such as the 1N4148 is adequate for the example current.

Current waveform and average current

Figure 4 shows the steady-state current in the example coil driven by a 5 V, 2.7 kHz, 50% duty square wave, with 0.2 V transistor saturation and 0.7 V diode drop, computed numerically from L·di/dt = v − Ri. During the on-interval the current rises exponentially to about 110 mA. After turn-off it decays through the diode, reaches zero after about 149 μs, and stays at zero until the next on-interval. The average over one period is about 53 mA.

Coil current i Average 53 mA 0 185 370 556 741 0 20 40 60 80 100 120 140 Time t / μs i / mA Peak ≈ 110 mA Flyback current ends ON OFF (diode freewheels) ON OFF
Figure 4 Steady-state current in the example coil (R = 40 Ω, L = 3 mH) under a 5 V, 2.7 kHz, 50% duty square wave (numerical simulation, illustrative). Shaded intervals: transistor on

Base resistor and supply

To keep the transistor saturated, size the base current at about one twentieth of the peak collector current (a forced β of about 20). For 110 mA that is about 5.5 mA; from a 3.3 V output, Rb ≈ (3.3 − 0.7) V / 5.5 mA ≈ 470 Ω. The buzzer draws sizeable current pulses, so place a decoupling capacitor close to its supply connection to keep them out of analog circuits on the same rail.

Caution: never connect a passive magnetic buzzer straight to DC. DC simply holds the diaphragm to one side – no sustained tone – while the coil current settles at V/R: about 0.12 A and 0.6 W in our example, which will overheat the coil over time. When firmware silences the buzzer, leave the transistor off, not stuck on.

Changing the square-wave frequency plays different notes, but a magnetic buzzer has a narrow response and gets quieter the further you move from its rated frequency. Lowering the duty cycle reduces average current and loudness at the cost of a changed timbre. Because a unidirectional drive current has a DC component that adds to or subtracts from the magnet bias, follow the pin polarity marking whenever the datasheet gives one.

6. Active Buzzers, Temperature and Quick Checks

Active (self-driven) magnetic buzzers contain their own oscillator. Apply the rated DC voltage and they sound at a fixed frequency, so a single transistor or MOSFET switching the supply is all the control needed – no PWM. The frequency is set internally, so they cannot play melodies, and because the internal electronics are polarity-sensitive they must not be connected in reverse.

Temperature: copper resistance rises by about 0.39%/K (IEC 60028 gives 0.003 93/K at 20 ℃). From 25 ℃ to 85 ℃ the coil resistance increases by a factor of about 1.23. Under voltage drive, ignoring changes in inductance, the current falls to about 81% and the sound pressure level by about 1.8 dB. For hot environments or long continuous tones, keep a margin to the datasheet temperature range and rated voltage.

  1. Measure DC resistance

    On a multimeter's ohms range, a passive magnetic buzzer shows its coil resistance – typically a few ohms to a few tens of ohms, per the datasheet. An infinite reading means an open coil; near zero means a short. A piezo buzzer is capacitive and reads open, which is an easy way to tell the two passive types apart.

  2. Low-voltage tap test

    Briefly touch a 1.5 V cell across a passive magnetic buzzer. A healthy part gives a click as the diaphragm is pulled in and released; silence points to a coil or diaphragm fault.

  3. Measure SPL under rated conditions

    Sound pressure level is only meaningful at the voltage, frequency, waveform and distance (often 10 cm) stated in the datasheet. Moving from 10 cm to 30 cm lowers the free-field level by about 9.5 dB, so data taken under different conditions cannot be compared directly.

7. Magnetic or Piezo?

MagneticInductive load

Low voltage, higher current

A few volts give adequate output, which suits 3–5 V rails where boosting is not an option. Current is typically tens of milliamps, so a transistor driver and flyback diode are needed, and the coil warms up during long tones.

PiezoCapacitive load

Low current, louder with voltage

Operating current is typically a few milliamps and there is no coil, so no back-EMF. Output rises with drive voltage, so at low supply voltages a full-bridge or boost driver is often used. A good fit for battery-powered, power-sensitive products.

ItemMagneticPiezo
Electrical natureMagnetic: inductance plus DC resistance (a few to tens of ohms)Piezo: capacitance (typically a few to tens of nF)
Drive voltageMagnetic: works at low voltage, commonly 1.5–12 VPiezo: higher voltage gives higher SPL
Operating currentMagnetic: typically tens of mAPiezo: typically a few mA
Turn-off protectionMagnetic: flyback diode requiredPiezo: provide a discharge path for the capacitance
Ohmmeter readingMagnetic: shows coil resistancePiezo: reads open

Key takeaways

  • Moving iron: the coil is fixed and the steel diaphragm is driven by magnetic attraction, F = B2A/(2μ0), which can only pull.
  • Magnet bias: keeps the useful force at the drive frequency and proportional to 2B0b; second harmonic to fundamental is b/(4B0).
  • Negative stiffness: too much bias or too small a gap lowers the resonance and can snap the diaphragm onto the pole.
  • The coil is an inductor: |Z| = √(R2 + (2πfL)2), and the L/R time constant limits current in each half-cycle.
  • Flyback diode: connected in reverse across the buzzer, it clamps the turn-off spike and protects the transistor.
  • No DC: a passive magnetic buzzer on steady DC only heats up; it does not sound.
References: L. L. Beranek, Acoustics (electro-mechano-acoustical analogies and transducers); L. E. Kinsler et al., Fundamentals of Acoustics (Helmholtz resonator); IEC 60028, International standard of resistance for copper (temperature coefficient of copper). All values of R, L and flux density are illustrative examples.
Note: Suyang Electronics manufactures magnetic and piezo buzzers in active and passive versions. Tell us your supply voltage, drive method and enclosure design and we will help you choose a suitable model and provide frequency and SPL test data. Please contact us.