Buzzer

Learn about Sparki's Buzzer

SparkiDuino
Easy

Lessons You Should Know

Sparki has a buzzer that can make sounds.

Top - Buzzer

How It Works

The buzzer on Sparki is a piezo electric buzzer. Piezo electric materials change their shape when electricity is applied to them:

By turning voltage on and off to the piezoelectric material in the buzzer, the plate bends and moves the air back and forth:

This plate moving air back and forth compresses the air to make sound waves that you can hear:

loudspeaker-waveform

Using the Part

With the basic Sparki code in place, you can make Sparki beep using this command:

sparki.beep();

SparkiDrduino already has code examples for you to use:
File > Examples > Beep

/*******************************************
 Basic Buzzer test

 Sparki has a buzzer on its back. Try
 making it beep!
********************************************/
#include <Sparki.h>  // include the robot library

void setup()
{
}

void loop()
{
    sparki.beep(); // Sparki beeps!
    delay(1000); // wait a second (1000 milliseconds)
}