This is an old revision of the document!


08 | Piezo Buzzer

Piezo buzzers create sounds by vibrating in response to voltage changes and are use as audio indicators in watches, computers and many other common devices. In this tutorial we'll learn how to play tones on a piezo buzzer by generating a square wave, and then modify the code to play a musical scale by adjusting the square wave frequency.

Prerequisites

Hardware


Parts List
  • Sparkfun RedBoard

  • 1x Piezo Buzzer
Circuit Schematic

Software

Procedure




  • Open the LINX - Square Wave example from the LabVIEW Example Finder.

  • Select the DO channel connected to the piezo buzzer.

  • Run the VI, and change the value of the Frequency control.

  • Modify the VI to play a musical scale.