Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

very faint piezo buzzer

very faint piezo buzzer

2005-05-25 by arhodes19044

I have a radioshack piezo buzzer that is rated for 3-16 volts and a 3 
or 5 MA.  I tested the current it draws with my dmm and I got the 
rated MA being drawn.

I had used this device on a different project using a BX-24 which has 
an 8515 as its core.

When I use it with my 128, the sound is very faint.  I tried it on 2 
different pins and the sound was the same.

I am pretty new to AVRs.  I am pretty sure that I have the pin set to 
output (DDRx = 1 on the appropriate pin).

Any suggestions?

-Tony

Re: very faint piezo buzzer

2005-05-25 by arhodes19044

--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote:
> I have a radioshack piezo buzzer that is rated for 3-16 volts and 
a 3 
> or 5 MA.  I tested the current it draws with my dmm and I got the 
> rated MA being drawn.
> 
> I had used this device on a different project using a BX-24 which 
has 
> an 8515 as its core.
> 
> When I use it with my 128, the sound is very faint.  I tried it on 
2 
> different pins and the sound was the same.
> 
> I am pretty new to AVRs.  I am pretty sure that I have the pin set 
to 
> output (DDRx = 1 on the appropriate pin).
> 
> Any suggestions?
> 
> -Tony


Replying to myself.  Hey dummy, chech that the initialization 
function is ACTUALLY used!  I wrote the function but never called 
it!  So the pin was at the default "input", so I was only engaging 
the pull-up resistor.  

When I set it to "output" then the buzzer sang out loud and clear.

-Tony

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Ralph Hilton

On Thu, 26 May 2005 00:32:46 -0000 you wrote:

>I have a radioshack piezo buzzer that is rated for 3-16 volts and a 3 
>or 5 MA.  I tested the current it draws with my dmm and I got the 
>rated MA being drawn.
>
>I had used this device on a different project using a BX-24 which has 
>an 8515 as its core.
>
>When I use it with my 128, the sound is very faint.  I tried it on 2 
>different pins and the sound was the same.
>
>I am pretty new to AVRs.  I am pretty sure that I have the pin set to 
>output (DDRx = 1 on the appropriate pin).
>
>Any suggestions?

Connect it between 2 output pins and switch them alternately. That effectively
doubles the voltage.
--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Peter Gargano

Ralph Hilton wrote:
> Connect it between 2 output pins and switch them alternately. That effectively
> doubles the voltage.

How does that work?









.

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Ralph Hilton

On Thu, 26 May 2005 10:50:58 +1000 you wrote:

>Ralph Hilton wrote:
>> Connect it between 2 output pins and switch them alternately. That effectively
>> doubles the voltage.
>
>How does that work?

If the 2 pins are alternately pulled up then the peak to peak voltage is 10.
--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Peter Gargano

Ralph Hilton wrote:
>>>Connect it between 2 output pins and switch them alternately. That effectively
>>>doubles the voltage.
>>
>>How does that work?
> 
> If the 2 pins are alternately pulled up then the peak to peak voltage is 10.

Not unless you "store" the voltage somehow. ie. you may need some 
diodes and capacitors. At any one time the voltage measured across the 
two pins is always no more than Vcc.

Do you do advertisements for amplifiers?















.

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Ralph Hilton

On Thu, 26 May 2005 11:49:45 +1000 you wrote:

>Ralph Hilton wrote:
>>>>Connect it between 2 output pins and switch them alternately. That effectively
>>>>doubles the voltage.
>>>
>>>How does that work?
>> 
>> If the 2 pins are alternately pulled up then the peak to peak voltage is 10.
>
>Not unless you "store" the voltage somehow. ie. you may need some 
>diodes and capacitors. At any one time the voltage measured across the 
>two pins is always no more than Vcc.
>
>Do you do advertisements for amplifiers?

Using pins 1 & 2:

Pin 1 = 0, pin2 = 5v
then
Pin 1 = 5v, pin2 = 0

Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10 volts peak to
peak.

--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Mike Murphree

On May 25, 2005, at 8:58 PM, Ralph Hilton wrote:

> On Thu, 26 May 2005 11:49:45 +1000 you wrote:
>
>
>> Ralph Hilton wrote:
>>
>>>>> Connect it between 2 output pins and switch them alternately.  
>>>>> That effectively
>>>>> doubles the voltage.
>>>>>
>>>>
>>>> How does that work?
>>>>
>>>
>>> If the 2 pins are alternately pulled up then the peak to peak  
>>> voltage is 10.
>>>
>>
>> Not unless you "store" the voltage somehow. ie. you may need some
>> diodes and capacitors. At any one time the voltage measured across  
>> the
>> two pins is always no more than Vcc.
>>
>> Do you do advertisements for amplifiers?
>>
>
> Using pins 1 & 2:
>
> Pin 1 = 0, pin2 = 5v
> then
> Pin 1 = 5v, pin2 = 0
>
> Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10  
> volts peak to
> peak.

This technique was used in car stereo amplifiers before internal  
power inverters became commonplace.  If you connect an oscilloscope  
(with differential inputs) across the buzzer, it will appear to a 10  
volt peak-to-peak waveform even though only 5 volts is applied in  
each half-cycle.

Mike

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Peter Gargano

If only life was so simple ....

Ralph Hilton wrote:
>>Not unless you "store" the voltage somehow. ie. you may need some 
>>diodes and capacitors. At any one time the voltage measured across the 
>>two pins is always no more than Vcc.
>>
>>Do you do advertisements for amplifiers?
> 
> Using pins 1 & 2:
> 
> Pin 1 = 0, pin2 = 5v
> then
> Pin 1 = 5v, pin2 = 0
> 
> Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10 volts peak to
> peak.

Like I said "At any one time the voltage measured across the
two pins is always no more than Vcc."

And, I maintain that unless you store some charge somewhere the 
"relative" voltage you mention is just that, an interesting point to 
note in passing.

Now, lets gets some facts going here instead of speculation ...

there are (at least) two types of "piezo buzzers"

1. A simply piezo plate that you drive directly - can be used as both 
a sound source when driven electrically and a microphone when driven 
acoustically.

2. A polarised "module" that you apply power to that has its own 
internal oscillator - the power you supply drives the buzzer "indirectly".

I agree that 1. is a candidate for being driven in antiphase. On the 
other hand 2., assuming it wont be destroyed by a reverse voltage, 
will actually run at half the voltage as only half the time will it 
have 5 Volts across it when driven as suggested.

So, You say 10 Volts peak-to-peak, and I'm saying 2.5 Volts average - 
depending on the module.





OK, I have real work to do here, sorry I brought up this whole thing. 
I'll leave it to you guys to fight out this semantic argument yourselves.

Peter.

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Bernd Felsche

On Thursday 26 May 2005 10:16, Mike Murphree wrote:
> On May 25, 2005, at 8:58 PM, Ralph Hilton wrote:
> > On Thu, 26 May 2005 11:49:45 +1000 you wrote:
> >> Ralph Hilton wrote:
> >>>>> Connect it between 2 output pins and switch them alternately.
> >>>>> That effectively doubles the voltage.

> >>>> How does that work?

> >>> If the 2 pins are alternately pulled up then the peak to peak
> >>> voltage is 10.

> >> Not unless you "store" the voltage somehow. ie. you may need
> >> some diodes and capacitors. At any one time the voltage
> >> measured across the two pins is always no more than Vcc.

> >> Do you do advertisements for amplifiers?

> > Using pins 1 & 2:

> > Pin 1 = 0, pin2 = 5v
> > then
> > Pin 1 = 5v, pin2 = 0

> > Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10
> > volts peak to peak.

Not really. It's just how it appears (memntarily) at the buzzer.

> This technique was used in car stereo amplifiers before internal
> power inverters became commonplace.  If you connect an oscilloscope
> (with differential inputs) across the buzzer, it will appear to a 10
> volt peak-to-peak waveform even though only 5 volts is applied in
> each half-cycle.

To answer Peter's question; the "storage" device is the buzzer.
It's mostly a capacitor. The gates on the uC act as diodes (when
they go "high").

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!

RE: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Darren Worley

[bits snipped]

its all about **perspective** and relativity, not to mention the theory v/s
reality. Follow it from the electron flow point of reference.  ;)

/me runs, goes back to ostrich mode...  ô¿ô)


Ralph Hilton wrote:
>>Not unless you "store" the voltage somehow. ie. you may need some 
>>diodes and capacitors. At any one time the voltage measured across the 
>>two pins is always no more than Vcc.
>>
>>Do you do advertisements for amplifiers?
> Using pins 1 & 2:
> Pin 1 = 0, pin2 = 5v
> then
> Pin 1 = 5v, pin2 = 0
> Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10 volts
peak
>to peak.


I agree that 1. is a candidate for being driven in antiphase. On the 
other hand 2., assuming it wont be destroyed by a reverse voltage, 
will actually run at half the voltage as only half the time will it 
have 5 Volts across it when driven as suggested.

So, You say 10 Volts peak-to-peak, and I'm saying 2.5 Volts average - 
depending on the module.

OK, I have real work to do here, sorry I brought up this whole thing. 
I'll leave it to you guys to fight out this semantic argument yourselves.

Peter.

Re: [AVR-Chat] very faint piezo buzzer

2005-05-26 by Mike Murphree

On May 25, 2005, at 9:45 PM, Bernd Felsche wrote:

> On Thursday 26 May 2005 10:16, Mike Murphree wrote:
>
>> On May 25, 2005, at 8:58 PM, Ralph Hilton wrote:
>
>>> Relative to pin1, pin2 goes from +5 volt to - 5 volt which is 10
>>> volts peak to peak.
>>>
>
> Not really. It's just how it appears (memntarily) at the buzzer.
>
>
>> This technique was used in car stereo amplifiers before internal
>> power inverters became commonplace.  If you connect an oscilloscope
>> (with differential inputs) across the buzzer, it will appear to a 10
>> volt peak-to-peak waveform even though only 5 volts is applied in
>> each half-cycle.
>>
>
> To answer Peter's question; the "storage" device is the buzzer.
> It's mostly a capacitor. The gates on the uC act as diodes (when
> they go "high").

C'mon guys this is basic AC theory...  nothing is being stored.

A 10 volt peak-to-peak square wave is (assuming symmetrical) +5V  
applied to a load during one half-cycle followed by -5V applied to  
the load during the next half-cycle. The CMOS outputs of the AVR can  
either source or sink current depending on their state, so by using  
two outputs, you can effectively double the voltage excursion applied  
to the load. Peak voltage for an AC waveform is half of the peak-to- 
peak value and since in this case we are talking about a square wave,  
it is same as the AC RMS value.  So with one output you can achieve  
2.5 Vrms and with two outputs 5.0 Vrms.

Back to my car amplifier example, before they learned to bridge the  
amplifiers (use 2 amps, one 180 degrees out of phase with the other),  
about 4 watts was all you expect out of a direct-coupled solid-state  
amplifier.  With bridging this jumped up to 18 watts (20W at 10% THD)  
and now nearly all of them include a power inverter to remove the  
dependency on the supply voltage entirely.

Mike

Re: very faint piezo buzzer

2005-05-26 by Graham Davies

--- In AVR-Chat@yahoogroups.com, Ralph Hilton <ralph@r...> wrote:

> Connect [the piezo buzze ] between
> 2 output pins and switch them
> alternately. That effectively
> doubles the voltage.

We're talking about a buzzer, here, not a speaker. You just apply a 
voltage and the buzzer does the rest using an internal oscillator.

I think we should start this thread again.  I don't have much to 
suggest except to say that the piezo buzzers I bought from All 
Electronics are too loud and I leave the tape over the hole!

Is the OP sure that both systems are running from the same supply 
voltage? Does he have a voltmeter to measure the voltage across the 
buzzer when it is on?

Graham.

Re: very faint piezo buzzer

2005-05-26 by alwelch93021

I am driving my audio with a pull down logic and a resistor and cap to 
vcc.  I had trouble getting mine to shut up when the driver was off so 
i put a resistor across the buzzer inputs to help drain off any leakage.
Murata makes lots of these devices and they should be loud with just a 
resistor to vcc and a ground logic pulling down the minus side of the 
device.

Al Welch

--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote:
Show quoted textHide quoted text
> I have a radioshack piezo buzzer that is rated for 3-16 volts and a 3 
> or 5 MA.  I tested the current it draws with my dmm and I got the 
> rated MA being drawn.
> 
> I had used this device on a different project using a BX-24 which has 
> an 8515 as its core.
> 
> When I use it with my 128, the sound is very faint.  I tried it on 2 
> different pins and the sound was the same.
> 
> I am pretty new to AVRs.  I am pretty sure that I have the pin set to 
> output (DDRx = 1 on the appropriate pin).
> 
> Any suggestions?
> 
> -Tony

Re: very faint piezo buzzer

2005-05-26 by arhodes19044

--- In AVR-Chat@yahoogroups.com, "Graham Davies" <YahooGroups@e...> 
wrote:

> I think we should start this thread again.  I don't have much to 
> suggest except to say that the piezo buzzers I bought from All 
> Electronics are too loud and I leave the tape over the hole!
> 
> Is the OP sure that both systems are running from the same supply 
> voltage? Does he have a voltmeter to measure the voltage across 
the 
> buzzer when it is on?
> 
> Graham.

Hi, I am the OP.  As you may have seen, I figured out what the 
problem was.  It was ME.  I wrote the initialization function (to 
make the pin for OUTPUT).  But, I forgot to call the init.

Stupid error.

But, yes, the systems both are running off 5v.  I did check the 
buzzer on the raw 5v and it was normally loud.  I got it to work on 
properly once I turned the pin from "input-pullup" to "output".

Yes those things are LOUD!  Just the thing I want since the buzzer 
will be buried down in the guts of the box, and there may be some 
significant ambient external noise.

-Tony

Avrstudio debug question

2005-05-28 by wbounce

I am using winavr 3.4.1 with AVR studio 4.1.

I am trying to find out why my code is no longer driving my motors.
Anyhow I am stepping through it in AVR Studio and every so often I get
jumped to the default interrupt vector. I have defined a default
interrupt routing that just return.  (I did this because otherwise it
would just reset the MCU.) I think this may be related to my problem.

I have the following interrupts defined

SIGNAL(__vector_default)
SIGNAL(SIG_INTERRUPT6)
SIGNAL(SIG_INTERRUPT5)
SIGNAL(SIG_OUTPUT_COMPARE0)
SIGNAL(SIG_INPUT_CAPTURE3)
SIGNAL(SIG_UART0_RECV)
SIGNAL(SIG_UART1_RECV)
SIGNAL(SIG_UART0_TRANS)
SIGNAL(SIG_UART1_TRANS)


In the I/O panel the following items are in red (meaning changed on the
last single step
TCNT3L
ETIFR (OCF3A, OCF3B,OCF3C are set) (listed under Timercounter3)
ETIFR (none are set) (listed under Timercounter1) 

This would suggest something related to timer3
Here is my relavant code for timer 3

TCCR3A = BV(WGM31) | BV(WGM30); /* set timer/counter 3 to PWM mode 3 */
TCCR3A |= BV(COM3A1) | BV(COM3B1); /* Clear OCnA/OCnB/OCnC on compare
match when up-counting. Set OCnA/OCnB/OCnC on compare match when
downcounting.*/
TCCR3B |= BV(CS30) ; /* prescale: 1 @ 16 MHz, 10 bit PWM overflows @
15625 Hz giving 7812 HZ */ 
ETIMSK |= BV(TOIE3); // enable overflow interupt so we can set pwm in
int routine


Does anyone see anything wrong?

RE: [AVR-Chat] Avrstudio debug question Never mind

2005-05-28 by wbounce

Never mind. 
When I wrote up the problem it was staring me in the face. I guess it is
getting to late. 

SIGNAL(SIG_INPUT_CAPTURE3) is supposed to be SIGNAL(SIG_OVERFLOW3)
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
Behalf Of wbounce
Sent: Saturday, May 28, 2005 12:17 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Avrstudio debug question


I am using winavr 3.4.1 with AVR studio 4.1.

I am trying to find out why my code is no longer driving my motors.
Anyhow I am stepping through it in AVR Studio and every so often I get
jumped to the default interrupt vector. I have defined a default
interrupt routing that just return.  (I did this because otherwise it
would just reset the MCU.) I think this may be related to my problem.

I have the following interrupts defined

SIGNAL(__vector_default)
SIGNAL(SIG_INTERRUPT6)
SIGNAL(SIG_INTERRUPT5)
SIGNAL(SIG_OUTPUT_COMPARE0)
SIGNAL(SIG_INPUT_CAPTURE3)
SIGNAL(SIG_UART0_RECV)
SIGNAL(SIG_UART1_RECV)
SIGNAL(SIG_UART0_TRANS)
SIGNAL(SIG_UART1_TRANS)


In the I/O panel the following items are in red (meaning changed on the
last single step TCNT3L ETIFR (OCF3A, OCF3B,OCF3C are set) (listed under
Timercounter3) ETIFR (none are set) (listed under Timercounter1) 

This would suggest something related to timer3
Here is my relavant code for timer 3

TCCR3A = BV(WGM31) | BV(WGM30); /* set timer/counter 3 to PWM mode 3 */
TCCR3A |= BV(COM3A1) | BV(COM3B1); /* Clear OCnA/OCnB/OCnC on compare
match when up-counting. Set OCnA/OCnB/OCnC on compare match when
downcounting.*/ TCCR3B |= BV(CS30) ; /* prescale: 1 @ 16 MHz, 10 bit PWM
overflows @ 15625 Hz giving 7812 HZ */ 
ETIMSK |= BV(TOIE3); // enable overflow interupt so we can set pwm in
int routine


Does anyone see anything wrong?



 
Yahoo! Groups Links

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.