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.



Parts List
  • Sparkfun RedBoard

  • 1x Piezo Buzzer
Circuit Schematic



  • 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.
  • Play a simple song using the piezo buzzer.