Piezo causing OLED display to freeze.

Hello everyone,

I'm working on the 4D Systems OLED display (160-G1 SGC), and I've found a bug that I can trace back to a piezo buzzer that's part of my project:

If the piezo is plugged in and I call it using the playTone function, the display freezes. It doesn't matter what pin the piezo is on or what length/pitch tone I generate; when I unplug the piezo and run the sketch the display behaves normally.

I'm beginning to think that there's a better way of wiring up the piezo to eliminate the interference, so I'm turing to you. The piezo comes with Sparkfun's Inventor's Kit and it's got CET12A3 written on it. The pins are polarized, so I connect the (+) pin to one of the digital outputs, and the (-) to ground, just like the tutorial says.

Any ideas?

Have you tried unplug a piezo and play a tone?

spincrisis: I'm working on the 4D Systems OLED display (160-G1 SGC)

What resources are necessary to make this display work?

Piezos have a high capacitance, so if you drive them direct from an Arduino pin, you get large switching transient currents. Try connecting a resistor in series with the piezo, value in the region 100 ohms to 1K. Also avoid having the display and the piezo sharing a common ground wire as far as possible.