This lab goes over how to add a piezo speaker to your arduino.
One important thing to note about piezo speakers is that they only work within a certain voltage range. If you go outside of the range, you risk breaking them or having them not work. One good thing about piezo speakers is that they only allow a certain amount of current to go through them, so you don't need to add a resistor. Nifty, huh?
So, how do we connect the piezo to the arduino? Depending on the type of piezo, one of the pins will have a + on it or will have a red wire sticking out of it. The side with the + or the red wire goes to arduino pin 2, and the other pin is connected to ground. Why pin 2? Why not pin 2? You can use any of the arduino's output pins. You just need to let the arduino know which one you use.
After you have the piezo hooked up to the arduino, it's time to program the arduino so that we can tell it what we want it to do with the piezo speaker. To the sketch!