Go Down

Topic: Turning a Piezo buzzer off (Read 566 times) previous topic - next topic

abasel

Why does
Code: [Select]
analogWrite(buzzer,255);

turn it off and

Code: [Select]
analogWrite(buzzer,0);

turn it on.

I thought that it would be the other way around.

JimboZA

Post the circuit.... if you have the buzzer +ve to 5V, and the -ve in an i/o pin, then you need the i/o pin to be at 0V for there to be a PD across the buzzer, so off is on.
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

abasel

Hi, it's an active buzzer http://www.aliexpress.com/snapshot/6164212500.html with I/O pin connected to A3. The VCC & GND are connected to 3.5V and GND respectively

Jiggy-Ninja

Look at the circuit diagram posted on that page. It uses a PNP transistor as a high-side switch. 5V will turn it off, 0V will turn it on. That's normal behavior for a high-side PNP.

JimboZA


Look at the circuit diagram posted on that page. It uses a PNP transistor as a high-side switch. 5V will turn it off, 0V will turn it on. That's normal behavior for a high-side PNP.


Damn- you beat me to it....
"Could you do the egg bacon spam and sausage without the spam then? "

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

abasel

Thanks, I am learning slowly :-)

Go Up