User Manual

Hexiwear Workstation
Page 27
Piezo Buzzer
The Buzzer reproduces sound when the PWM
signal is provided from Hexiwear. The pitch
of the sound is determined by the frequency,
and the amplitude is determined by the duty
cycle of the applied PWM signal.
OTHER MODULES
Piezoelectricity is the electrical charge which accumulates in certain solid materials,
in response to mechanical pressure. Also, applying an electrical potential to the
piezoelectric material, causes it to physically deform. One of the most widely used
applications of the piezo electricity, is the production of sound generators, called piezo
buzzers. Piezo buzzer is an electric component that comes in diff erent shapes and
sizes, which can be used to produce sound. Hexiwear Workstation comes with a piezo
buzzer which can be connected to G2.5 or G4.0 pins. Connection is established using
SW4.8 or SW5.8 DIP switch (Figure 28). Buzzer is driven by the transistor Q1 (Figure
29). Hexiwear can create sound by generating a PWM (Pulse Width Modulated) signal
– a pulse train, sequence of pulses with the variable width (duty-cycle). Frequency of
the square signal determines the pitch of the generated sound, and duty cycle of the
signal can be used to increase or decrease the volume in the range from 0% to 100%
of the duty cycle. You can generate PWM signal by using the hardware capture and
compare module, which is usually available in most microcontrollers, or by writing a
custom software which emulates the desired signal waveform.
2
2
+
1
PZ1
BUZZER
R15
1k
VCC-5V
Q1
BC846B-7-F
R16
10k
BUZZER
PERSPECTIVE
VIEW
TOP
VIEW
12345678
O
N
SW4
DIP SWITCH 8 pin
G0_LED
G1_LED
G2_LED
G3_LED
G4_LED
BUZZERG2.5
L
R
L_SPK
R_SPK
MP3-RST#
MP3-DREQ
MP3-DCS
MP3-CS#
MP3-SCK
MP3-MISO
MP3-MOSI
12345678
O
N
SW5
DIP SWITCH 8 pin
G2.6
G2.7
G3.0
BUZZER
G2.0
G2.1
G2.2
G1.7
G4.0
DATA BUS
Freq = 3kHz, Duty Cycle = 50%
Freq = 3kHz, Duty Cycle = 80%
Freq = 3kHz, Duty Cycle = 20%
Freq = 3kHz
Volume = 50%
Freq = 3kHz
Volume = 80%
Freq = 3kHz
Volume = 20%
How to
make it sing?
Figure 29: Piezo
buzzer with the
schematic
Figure 28:
DIP switch
settings