Programmer's Calculator (Buzzer)

A new peripheral for the calculator - a passive buzzer.

Calculation

Buzzer connection diagram
Buzzer connection diagram

A passive buzzer with a coil resistance of 16 \Omega from an Arduino kit is used. Here’s how it looks with a soldered diode. The diode is necessary because this is an electromagnetic buzzer, not a piezo one - though even piezo buzzers might need one since they generate electricity when deformed (think of piezo lighters).

Close-up of the buzzer with a soldered diode
Close-up of the buzzer with a soldered diode

Let’s take a look at the buzzer’s specifications from TZT:

First part of the buzzer description
First part of the buzzer description
Buzzer parameter table
Buzzer parameter table

Determining the value of R17 . The allowable current is \le 30mA , Assuming the average voltage across the buzzer coil is zero, we get

R_{17} = \frac{V_{cc} - V_{CE(sat)}}{I_c}

Let’s check the parameters of the 2N3904 transistor:

2N3904 transistor parameters
2N3904 transistor parameters

Assuming V_{CE(sat)} = 0.25V , we calculate:

R_{17} = \frac{3.3V - 0.25V}{30mA}\approx 102\Omega

Since the collector current is already limited, it’s fine even if we take the minimum h_{FE} = 50 . Thus, the base current I_b = \frac{I_c}{h_{FE}}=\frac{30mA}{50}=0.6mA .

From this, we derive:

\begin{array}{rl} R_{15}\cdot I_b + V_{BE(sat)} &= 3.3V \\ R_{15} &= \frac{3.3V - V_{BE(sat)}}{I_b}\\ R_{15} &= \frac{3.3V - 0.95V}{0.6mA}\approx 3.9k\Omega \end{array}

As for R_{16} , it's pull-down resistor with a sufficiently high value. Alternatively, such a resistor could simply be enabled on the CH32V003 pin.