Melody

Piezoelectric speakers are frequently used as beepers in watches and other electronic devices. In this project, a piezo speaker is used to play melodies. It sends a square wave of the appropriate frequency to the piezo, generating the corresponding tone.

Connect the red wire of a piezo speaker to Arduino's PWM pin 9, and the black wire to ground. Use the Arduino code "Melody" to play different notes.

By omer
Created on April 16, 2009, 11:32

Category: Analog

Difficulty: kids

License:  Creative Commons Attribution-Share Alike 3.0 Unported License

Tags: analog, output, piezo

Images

Files

Fritzing Files

Code Files

Links

Comments

  1. JordanArduino # July 27, 2011, 10:20 p.m.

    i tried it with leds and it works

Login to post a comment...
  • Print this
© 2007 - 2011 University of Applied Sciences Potsdam