This is an old revision of the document!
This lesson will show you how to connect the 3.3v Active Buzzer to your Oak and make it beep morse code.
| Part | Quantity | Identification |
|---|---|---|
| Oak with soldered headers | 1 | |
| Breadboard | 1 | |
| 3.3v Active Buzzer | 1 | |
| M to M 30cm Jumper Wire | 2 | Red, Black |
Piezo Buzzers: In this lesson we will be using a Piezo buzzer to make sound. We will be achieving this by turning it on and off, much like an LED.
A piezo buzzer is a sandwich of two different conductive metals. When voltage is applied to the two different metals it bends, creating waves in air - which we call sound. They are usually small and circular and can be found in anything that provides an annoying beep.
We can make a piezo buzzer beep like this in code:
// turn pin 9 "on" by making the voltage HIGH) digitalWrite(1, HIGH);
Where digitalWrite(1, HIGH); means turn Pin1 fully on. Don't forget to turn it off again!
Remember that when connecting a buzzer, you must pay attention to the (+) sign on the top of the buzzer casing. The (+) sign represents the positive connector and is where the red wire from pin 1 must go. If you get this backwards your buzzer may stop working.
Explanation of code
Where to go from here, potential uses, etc.