NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Piezo Buzzer - help

October 02, 2011
by scottmc94
scottmc94's Avatar

Ok, I am having fits with the Piezo Buzzer included in the kit. What is the absolute simplest circuit that will make the stupid thing make a noise? I have been playing and getting all kinds of little projects work (with and without the MCU) but I have not had any luck with the buzzer. I must be missing something.

Thanks.

October 02, 2011
by mongo
mongo's Avatar

The buzzer requires an AC signal. (or something close like a square wave). Try frequencies between 1000 to 4000 Hz.

October 03, 2011
by scottmc94
scottmc94's Avatar

Thank you Mongo for the reply. It took me a bunch of searching at lunch today, but I think I have a solution. I will post what I find out tonight after testing.

I hate having so many holes in my knowledge. Somethings makes sense and I am able to mess around and change things, then out of the blue... boom.. stopped cold on something, that I feel is simple. argh :)

October 03, 2011
by scottmc94
scottmc94's Avatar

Nailed it! :)

I got it working with a 555 timer, now it is time to figure it out with the MCU.

It was a really high pitched tone, but I didn't really care, I just wanted the dumb thing to make noise.

alt image text

October 03, 2011
by bretm
bretm's Avatar

Something like this in main() would be about 500 Hz:

DDRC |= 1 << PC4;       // Configure pin PC4 for output.

while (1) {             // While the Earth is round,
    PINC |= 1 << PC4;   // toggle pin PC4,
    delay_ms(1);        // and wait 1ms.
}
October 03, 2011
by scottmc94
scottmc94's Avatar

Thanks for the code. I used my tempsensor code and was able to put the config line at the beginning of main and just put the toggle pin line inside the for loop for the temperature samples and it worked! yeah, mission accomplished!

Thanks guys!

Post a Reply

Please log in to post a reply.

Did you know that you can use printf and scanf functions to talk to your computer from your USB NerdKit? Learn more...