New to the forum. I just decided to start playing with Arduinos and electronics while I am quarantined so forgive me if I have not provided enough info or if my vocab is not correct.
I am trying to create a countdown timer with audio indicators. For the audio indicators I am using a piezo buzzer which requires 9V to 16V. To get that voltage, I am using a non inverting amplifier with two equal resistors so that it produces 10V when it gets 5V from the Arduino. I am powering the Op Amp with two 9V batteries in series so I have a total power voltage of 18V. To test it I decided to use the blink without delay example which I modified so that the buzzer should be on for 10 seconds and then off for another 10 seconds.
My problem is that while the circuit works when the digital pin is driven high (i.e. when 5V comes from the Arduino, I get 10V at the Op Amp output) the circuit does not work when the digital pin is driven low. When the program is running the output voltage from the Op Amp will be 18V when the input voltage from the Arduino is 0V. The net result of this is the buzzer is producing some kind of noise all the time. I want the buzzer to be either completely off or completely on.
I have confirmed that the output voltage from the Arduino is alternating between 0V and 5V as expected. Furthermore, when the Arduino is not connected at all and the Op Amp is powered, the output voltage is 0V.
I'm not entirely sure what else I could look at or what else I could do to solve that problem. Do any of y'all have any ideas.
I am using an Arduino Uno, a TL071 for the Op Amp, and a CPE-243 for the buzzer.
I think we need a circuit diagram for this and a specification for the buzzer.
A buzzer that needs 9-16v ?? I would imagine this the supply voltage range - can you confirm? So I’d expect , 0v is quiet , anything 9-16v is “buzz” - correct ?
If this is so you don’t need an op amp ( it may not even have enough power to drive the buzzer) just a transistor switch to switch the buzzer to the higher voltage ( google Arduino transistor switch )
Things like this go much better with a schematic. You have a buzzer Piezo Buzzer Indicator typically run at 12 VDC and at the rated voltage, "current consumption at rated voltage 35 mA". The absolute max current out on any pin is 40 mA. Less a schematic I haven't a clue how your op-amp is actually configured but I'll share this much. The TL071 is an old operational amplifier and it is not a single supply op-amp. It needs a V+ and V- supply to operate. The TL071 will not source enough output current to drive your buzzer.
If you want to drive a buzzer with your Arduino I suggest a simple transistor like a 2N2222 or even a 2N3904 or for that matter a simple 2N7000 little MOSFET. If you are limited with power options power the buzzer off your two 9 volt batteries in series and add an in series resistor (about 200 Ohms).
A Google of 2N7000 Arduino should bring up plenty of circuit suggestions.
My bad as the TL071 can be run on a single supply.
hammy:
A buzzer that needs 9-16v ?? I would imagine this the supply voltage range - can you confirm? So I’d expect , 0v is quiet , anything 9-16v is “buzz” - correct ?
Yes this is correct. The buzzer produces the correct sound when the pin is high, the issue occurs when the pin is low and the output form the Op Amp is 18V.
Ron_Blain:
The TL071 is an old operational amplifier and it is not a single supply op-amp. It needs a V+ and V- supply to operate. The TL071 will not source enough output current to drive your buzzer.
I have supply voltage of 18V+ going to the Op Amp. Here is a schematic for y'all:
I am also going to try using a pull down resistor on the signal coming from the Arduino. I'll let you know how it goes.
My bad, the TL071 can run single supply and +18V is fine so what are you expecting for Vout and what do you plan to do with Vout? I don't think you can source your buzzer current from the TL071 and your circuit shows no ground reference? I assume it is the negative side of your batteries in series?
The op-amp is running out of specs (not a rail2rail op-amp).
Input common mode range starts from about 2.5volt, not 0volt.
An op-amp is the wrong approach to drive a buzzer.
If it's a passive (not active) piezo buzzer, then try the toneAC library with the piezo connected between two pins.
That way (H-bridge) you get 10volt AC on the piezo from 5volt pins.
Leo..
Correct, ground is the negative side of the two batteries. I expect Vout to be 10V when Vin is 5V (this is happening) and for Vout to be 0V when Vin is 0V (this is not happening). At present, when Vin is 0V I get 18V at Vout.
The buzzer does make the expected sound when Vin is 5V so it appears that the buzzer current is being sourced from the TL071. The datasheet for the buzzer I have says that it has a max current draw of 35mA at rated voltage.
I have also tried to put a 20kohm pull down resistor at Vin and that did not work.
It is an active piezo buzzer so unfortunately toneAC will not work. Since it only requires DC voltage, would an op amp be a good approach or is it better to use a transistor better to use as Ron suggested? The reason I am using an op amp is that I was able to easily get my hands on one.
+Batt to +Buzzer.
-Buzz to the collector of an NPN transistor (2N2222 or similar).
Emitter of the transistor to Batt- and Arduino ground.
Base, via a 1k resistor to a digital Arduino pin.
A small diode (1N4148) can be added across the buzzer, to protect the transistor against inductive kickback.
But probably not required for a piezo buzzer.
Leo..