Skip to content

4. Buzzer

4-1. Desk Survey on Buzzers and Speakers

In order to understand the mechanism to enhance the loudness of the alarm, I did a little desk survey about buzzers and speakers. Here is my findings.

Sound is created as vibration of air. The pressure of air when sound is transmitted as a vibration is called sound pressure. The number of times per second that the air pressure becomes dense or sparse, and the number of times this change occurs is called the frequency.

4-1-1. Sound Volume and Sound Pressure Level (Loudness)

Sound pressure level refers to the loudness of sound. The unit is dB, and a louder sound pressure level means a louder sound. Generally, the smallest sound level that can be recognized by humans is 0dB, and it is said to be about 60dB for an ordinary conversation and about 100dB for the sound of a train passing.

4-1-2. Pitch ofthe Sound

The frequency range of sound that can be heard by the human ear is generally said to be from 20Hz to 20,000Hz (20kHz). Among these, sounds in the range of 2kHz to 4kHz can be heard most efficiently, and this frequency range is often used for sound components.

4-1-3. What is a Buzzer?

A component that generates an alarm or electronic sound is called a buzzer. Among these, piezoelectric buzzers are those that apply piezoelectric ceramics. Buzzers are used for alarms and warning sounds because they generate sounds of a specific frequency. Speakers, on the other hand, generate sounds of a wide range of frequencies and are used for music and music reproduction.

When vibrations of the same frequency as the natural frequency of an individual object are combined, the object begins to vibrate. This phenomenon is called resonance, and the frequency at which this resonance occurs is called the resonant frequency. In acoustic reduction, when sound waves with a frequency close to the natural frequency are input to the sounding element, the amplitude becomes very large, and this frequency is called the resonance frequency.

The piezoelectric buzzer produces a large sound volume by generating sound waves close to the natural frequency of the resonator “case” with a built-in vibrating plate. The advantages of piezoelectric buzzers are that they consume little power, weigh less because they can be composed of fewer parts, and can easily be made thinner.

A piezoelectric sounder incorporates a piezoelectric diaphragm in a plastic case (resonator). An oscillation circuit built into the plastic case of this piezoelectric sounder is a “piezoelectric buzzer,” which produces sound simply by applying a DC voltage with a battery. In a nutshell, the buzzer has a piezoelectric circuit, but the sounder has no circuit. Therefore, when a sounder is used, a device that allows an external signal input to produce a loud sound needs to be added. Piezoelectric buzzers, on the other hand, have an oscillation circuit built into the sounder’s case or are used in combination with an external dedicated oscillation circuit, and the sounding frequency is usually fixed at one unique level.

4-1-4. Role of the Resonator (Case)

The case makes use of the resonance effect to produce a louder sound. For example, if the sound pressure peak of the vibrating plate and the sound pressure peak increased in the case occur at different frequencies, the mechanism is that when the two are combined, the sound pressure is increased by 10 to 20dB due to the resonance effect.

4-1-5. Mechanism of Changing the Sound Scale and Volume

The pitch (frequency) of a piezoelectric buzzer is fixed for each product and cannot be changed. With piezoelectric sounders, it is possible to change the pitch (frequency) by the frequency of the AC voltage. However, the volume varies depending on the frequency.

The volume of a piezoelectric buzzer/sounder can be increased by increasing the input voltage. However, we have to bear in mind that we are not always able to increase the input volutage for the product to the level beyond the capacity of the product.

4-1-6. Basic Schematics of Piezoelectric Sounding Components

The general drive circuit for piezoelectric sounders is a circuit that is directly driven by an IC; the piezoelectric sounder is driven to sound according to the signal input from the IC. Therefore, the frequency and sound pressure level of the sound depends on the frequency and voltage of the signal input from the IC.

If the voltage input to the piezoelectric sounder is increased, the voltage level can also be increased. Therefore, if a separate power supply voltage higher than the voltage that can be input from the IC can be provided, a larger sound pressure level can be obtained by using a transistor together.


4-2. Desk Survey on the Panic Alarms in the Market

In order to understand the mechanism of the buzzer, I first worked on reverse-engineering a security alarm available in the market. Security alarms are being sold at many dollar shops in Japan, which means that the whole package is being sold at JPY100. Security alarems are worn by schoolchildren to protect themselves. Once they are feeling danger and scared, they pull the string attached to the switch and then the loud alarm sound will go off. This sound attracts attentions of the people around and scares the villains who are trying to do something to do harm to the kids.

alt text

alt text
Photo from ALSOK

Alarm sound is almost similar among the different security alarms.

I bought one at the nearest dollor shop and took it apart. It turned out that it was composed of the following three major components.

alt text

SN Key Item Qty Remarks Photo
1 Coin Battery LR44 1.5V 2 Total Voltage: 3V alt text
2 Piezzo Speaker 1 alt text
3 Board 1 Pull Switch x1, Alarm Boost Inductor x1, Alarm IC x1, Hall IC? x1, Capacitor? x1

On the board, I saw a pull switch, an alarm boost inductor, an alarm IC, and most probably a hall IC (or a Hall Effect sensor) and a capacitor. The reason I put a question mark on the hall IC and the capacitor is I am not sure if they are the ones.

alt text

alt text

Alarm Booster Inductor is probably a DC-to-DC converter that increases voltage, while decreasing current, from its input (Supply Voltage 3V) to its output (load). Alarm IC is a sound-generation IC that could make several siren sounds. Hall IC is an integrated circuit that converts the strength of a magnetic field into an electrical signal. It can be used to create non-contact switches that operate based on the strength of the magnetic field. And capacitor is an electronic component that stores electric charge, blocks direct current signals, and allows alternating current signals to pass through.

I searched for the schematic of the panic alarm on the Internet. I couldn’t find exact the same one for the alarm I had with me. I tried to sketch the schematic by myself.

alt text

But I found a few schematics for the similar alarms. These are probably the best ones I could find. While the first one seems to be having the booster inductor, the second one does without it.

alt text
[Source] http://ku3gururi.starfree.jp/toy/tool/checkero.htm

alt text
[Source] https://mnishikawa.hatenablog.com/entry/2020/04/30/221136

How big can we make the buzzer sound with the two CR2032 coin batteries in serial connection (6V)? Here is the test result.


4-3. Making the Siren Sound for the Device

In parallel to the work on the circuit design, I worked on the program for the siren sound for the device. Based on the above understanding about the mechanism how buzzers beep, I have thought of the two approaches: use of a passive buzzer or an active buzzer. For now, using Arduino UNO, I have designed the Option 1 with a passive buzzer.

Option 1: Passive Buzzer

//by Sintron
//2017.03.20

#include "pitches.h"

// notes in the melody:
int melody[] = {
  NOTE_A5, NOTE_A4};
int duration = 1000;  // 100 miliseconds
 int buzzer = 12 ;// setting controls the digital IO foot buzzer

void setup() {
   pinMode (buzzer, OUTPUT) ;// set the digital IO pin mode, OUTPUT out of Wen
}

void loop() {
  for (int thisNote = 0; thisNote < 2; thisNote++) {
    // pin8 output the voice, every scale is 0.5 sencond
    tone(8, melody[thisNote], duration);
    // Output the voice after several minutes
    delay(1000);
  }

  // restart after one seconds
  delay(100);
}

Option 2: Piezoelectric Speaker

I have tentatively decided to use the Raspberry Pi Pico W board for my final project after the test about Option 1. Therefore, for the second test, I tried to try piezoelectric speaker with RPI Pico W. First I reviewed the global session in Week 9 (Output Devices) and found one code which I thought would serve for my purpose.

I was not so satisfied with the monotone buzzer sound that the active buzzer sends out. As a result of my desk research, I came to know how I could control the voltage and change the tone, using the PWM (pulse width modulation).

alt text

+ pin 0
- pin 1
//
// hello.TB67H451.RP2040.audio.ino
//    XIAO RP2040 TB67H451 H-bridge audio hello-world
//
// Neil Gershenfeld 11/7/23
//
// This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose, but must
// acknowledge this project. Copyright is retained and
// must be preserved. The work is provided as is; no
// warranty is provided, and users accept all liability.
//

uint32_t duty_min = int(0.1*65535);
uint32_t duty_max = int(0.4*65535);
uint32_t duration_us = 10000;

void setup() {
  analogWriteFreq(50000);
  analogWriteRange(65535);
  }

void loop() {
  //
  // square wave soft ramp
  //
  for (uint32_t delay_us = 5000; delay_us > 500; delay_us -= 50) {
    uint32_t cycles = duration_us/delay_us;
    for (uint32_t i = 0; i < cycles; ++i) {
      analogWrite(0,0);
      analogWrite(1,duty_min);
      delayMicroseconds(delay_us);
      //
      analogWrite(0,duty_min);
      analogWrite(1,0);
      delayMicroseconds(delay_us);
      }
    }
  //
  // square wave loud ramp
  //
  for (uint32_t delay_us = 5000; delay_us > 500; delay_us -= 50) {
    uint32_t cycles = duration_us/delay_us;
    for (uint32_t i = 0; i < cycles; ++i) {
      analogWrite(0,0);
      analogWrite(1,duty_max);
      delayMicroseconds(delay_us);
      //
      analogWrite(0,duty_max);
      analogWrite(1,0);
      delayMicroseconds(delay_us);
      }
    }
  }

With this test, I could make sure that the code indicated in the global session could be used in my final project. However, althought this alarm sound was fine, the sound volume is still too small.

Also, while I was trying to prepare the circuit on the breadboard, I wondered why this code needed two pins (0 and 1). After consulting with my instructor, I learned that this code incorporetes H-bridge circuit, which switches the polarity of a voltage applied to a load. These circuits are often used in robotics and other applications to allow DC motors to run forwards or backwards (Wikipedia).

Since I wanted to keep it so simple as to appeal to the audience who have grown up with limited exposure to the electronics, I decided not to take this option.


4-4. Conclusion for Final Project

In the second week of May 2024, I did a circuit simulation using the Tinkercad Circuit. Unfortunately Tinkercad Circuit doesn’t have Xiao ESP32C3 and RPI Pico W icons in the portfolio. Therefore, I had to do the simulation using the Arduino UNO block.

alt text

alt text

With this simulator, I changed inductance and resistance and found that with inductance as 47mH and resistance as 1K ohm, I could get the best volume. I also tested with the following two codes: Option 1 (PWM) and Option 2 (tone() function). I came to a tentative conclusion that the Option 1, use of simple Pulse Width Module, could be better.

//Option 1

void setup(){                                                  
  pinMode(5, OUTPUT);                                    
}

void loop(){
  for (int i = 0; i <= 255; i++){
    analogWrite(5, i);
    delay(10);
  }
}

//Option 2

void setup() {                                                
} 
void loop() { 
  tone(5,880); 
  delay(1000); 
  noTone(5);   
}

Following the above simulation, I proceeded to the board testing using the RPI Pico W board. The snapshot below shows the wiring of the device on the breadboard, followed by the code I uploaded with Arduino IDE. I used 0 GPIO pin.

alt text

void setup(){
  pinMode(0, OUTPUT);
}

void loop(){
  for (int i = 0; i <= 255; i++){
    analogWrite(0, i);
    delay(10);
  }
}
This is the video of the sound created with this circuit and code.

I also tested with differnt buzzers and speakers available at hand now. I found that the two circled buzzer and dynamic speaker are the loudest at this point of time.

alt text

With this tentative conclusion, I consulted with the local instructor on May 19 in the 16th week for the Fab Academy. He showed me that if I could add a paper cup on the dynamic speaker, the cup would work as a resonator and I could make the sound louder. But my challenge is to what extent I could make the device thinner. I thought there would be no room for an additional resonator and so decided to go for a piezo electric buzzer.


Last update: May 29, 2024