Reader small image

You're reading from  DIY Microcontroller Projects for Hobbyists

Product typeBook
Published inJul 2021
Reading LevelBeginner
PublisherPackt
ISBN-139781800564138
Edition1st Edition
Languages
Right arrow
Authors (2):
Miguel Angel Garcia-Ruiz
Miguel Angel Garcia-Ruiz
author image
Miguel Angel Garcia-Ruiz

Miguel Angel Garcia-Ruiz is an Associate Professor of Computer Science at the School of Computer Science and Technology, Algoma University, Canada. He has taught microcontroller programming and interfacing, human-computer interaction, and interaction design courses. Miguel has a PhD in Computer Science and Artificial Intelligence from Sussex University, England. He has published articles on tinkering with technology applying microcontroller boards. Miguel has conducted research projects funded by Canada's Northern Ontario Heritage Fund (NOHFC), Algoma University, and the Mexican Ministry of Education.
Read more about Miguel Angel Garcia-Ruiz

Pedro Cesar Santana Mancilla
Pedro Cesar Santana Mancilla
author image
Pedro Cesar Santana Mancilla

Pedro Cesar Santana Mancilla is a research professor at the School of Telematics at the University of Colima in Mexico. His research interests focus on human-computer interaction, ICT for elderly people, Internet of Things, and machine learning. He is currently serving as president of the Mexican Association on Human-Computer Interaction (AMexIHC). He is a Senior Member of the IEEE, and ACM and serves as Chair of the Mexican ACM SIGCHI Chapter (CHI-Mexico). Pedro is a member of the Mexican Academy of Computing (AMexComp) and the Mexican Society of Computer Science (SMCC).
Read more about Pedro Cesar Santana Mancilla

View More author details
Right arrow

Programming a piezoelectric buzzer

In this section, you will learn what a buzzer is, how to interface it with the STM32 Blue Pill, and how to write a program to build an alert sound.

A piezoelectric buzzer is a device that generates tones and beeps. It uses a piezoelectric effect, which consists of piezoelectric materials converting mechanical stress into electricity and electricity into mechanical vibrations. Piezoelectric buzzers contain a crystal with these characteristics, which changes shape when voltage is applied to it.

As has been common in these chapters, you can find a generic breakout module that is pretty straightforward to use, as shown in the following screenshot:

Figure 13.2 – Piezoelectric buzzer breakout board

Figure 13.2 – Piezoelectric buzzer breakout board

This breakout board connects to the STM32 Blue Pill microcontroller board with three pins, outlined as follows:

  • Input/Output (I/O): This pin must be connected to a digital output of the microcontroller.
  • ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
DIY Microcontroller Projects for Hobbyists
Published in: Jul 2021Publisher: PacktISBN-13: 9781800564138

Authors (2)

author image
Miguel Angel Garcia-Ruiz

Miguel Angel Garcia-Ruiz is an Associate Professor of Computer Science at the School of Computer Science and Technology, Algoma University, Canada. He has taught microcontroller programming and interfacing, human-computer interaction, and interaction design courses. Miguel has a PhD in Computer Science and Artificial Intelligence from Sussex University, England. He has published articles on tinkering with technology applying microcontroller boards. Miguel has conducted research projects funded by Canada's Northern Ontario Heritage Fund (NOHFC), Algoma University, and the Mexican Ministry of Education.
Read more about Miguel Angel Garcia-Ruiz

author image
Pedro Cesar Santana Mancilla

Pedro Cesar Santana Mancilla is a research professor at the School of Telematics at the University of Colima in Mexico. His research interests focus on human-computer interaction, ICT for elderly people, Internet of Things, and machine learning. He is currently serving as president of the Mexican Association on Human-Computer Interaction (AMexIHC). He is a Senior Member of the IEEE, and ACM and serves as Chair of the Mexican ACM SIGCHI Chapter (CHI-Mexico). Pedro is a member of the Mexican Academy of Computing (AMexComp) and the Mexican Society of Computer Science (SMCC).
Read more about Pedro Cesar Santana Mancilla