Piezo buzzers are simple devices that can generate basic beeps and tones.  They work by using a piezo crystal, a special material that changes shape when voltage is applied to it.  If the crystal pushes against a diaphragm, like a tiny speaker cone, it can generate a pressure wave which the human ear picks up as sound.  Simple change the frequency of the voltage sent to the piezo and it will start generating sounds by changing shape very quickly!

This guide will explore how to generate tones with a piezo from CircuitPython or Arduino code. 

With CircuitPython, you can use simple Python code to play beeps and music notes with the piezo.  You can even use the CircuitPython REPL to make sound interactively!

In addition this guide will also show basic piezo control with Arduino code too, so you can use it for either!

This guide was first published on Jan 05, 2018. It was last updated on Apr 23, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.