Hi everyone, I am not sure if I post on the right place.
My project is going to output negative and positive voltage to Buzzer(-5V~5V).
I am using the Arduino Uno and its operating voltage is 5V. I am wondering how can I output negative voltage without any extra IC or board?
I have tried a solution but I am not sure if I am doing right. I used the potentiometer to adjust the analogInput from 0~1023 to change the output from -5V to 5V. And my code is :
I used "map" command and set the (toLow, toHigh) to (-5, 5). I don't know if this is right for setting the voltage range from -5 to 5, but the buzzer was turned off when the serial monitor shows the output=0.
Could you guys give me some suggestion or advice? Thank you so much.
is this a buzzer with a built-in tone generator or a piezo transducer/speaker?
The Arduino runs from a +5V supply and it cannot go negative. It's also digital so the output is either high (about +5V) or low (about zero volts). Analog out is only approximated with PWM, and although you may be able to hear the PWM it may not be what you want. The tone() function puts-out a square wave. (50% PWM should give you the loudest signal because it's also a square wave.)
But there is a "trick"... You can connect the piezo transducer between two output pins. Drive the pins in opposite directions and you create a bridge connection and you'll get 10V peak-to-peak across the piezo. But, you can't use the tone() function without an external inverter chip because it won't drive the pins oppositely.
DVDdoug:
But there is a "trick"... You can connect the piezo transducer between two output pins. Drive the pins in opposite directions and you create a bridge connection and you'll get 10V peak-to-peak across the piezo. But, you can't use the tone() function without an external inverter chip because it won't drive the pins oppositely.
Doug, Can you explain how this comes about, never heard of it before. Maybe a link?