Go Down

Topic: Turning a Piezo buzzer off (Read 525 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.
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

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....
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

abasel

Thanks, I am learning slowly :-)

Go Up