Go Down

Topic: Loud buzzer without using tone() ? (Read 4558 times) previous topic - next topic

rep8

I have a small 5v buzzer which I am using, I initially used the tone() function and that all worked fine. Only problem is that it is not loud enough for what I am using it for. I tried applying 3.7v to it from a lithium ion battery and it was much louder, I then tried using digitalWrite to apply the voltage but it barely does anything. Anyone know how to get it working as I dislike using the tone() funtion. (Do not have link/information for the buzzer)

dc42

If all you need to do to make it sound is connect it to a battery, then try driving it via an NPN transistor as you would a small motor. See http://embedded-lab.com/blog/wp-content/uploads/2010/12/Circuit_SingleTransistorDCMotor.png but don't use a BC547, use a BC337 or 2N2222A.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Erdin

Is that buzzer buzzing on its own if you connect it to 5V ?
The Tone() library is to generate a tone to a loudspeaker.

rep8


Is that buzzer buzzing on its own if you connect it to 5V ?
The Tone() library is to generate a tone to a loudspeaker.



If you mean connecting it directly to a 5v power source, then yes. I know the tone() library generates a frequency and not direct voltage.
Still don't understand why I cant connect it to a pin and ground, set the pin high and achieve the same result as connecting it directly to a battery.

dc42


Still don't understand why I cant connect it to a pin and ground, set the pin high and achieve the same result as connecting it directly to a battery.


1. Maybe there was an error in your code. Did you remember to set the pinMode to OUTPUT?

2. Maybe the buzzer takes too much current for the pin to supply. Did you measure the voltage on the pin?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

rep8


1. Maybe there was an error in your code. Did you remember to set the pinMode to OUTPUT?

2. Maybe the buzzer takes too much current for the pin to supply. Did you measure the voltage on the pin?


I am certain that there is no error in the code, I even used the blink sketch and re-assigned the pin to ensure it. There is an extremely faint sound when it is set high, and about 3.1-3.2 volts are on the pin (using an arduino fio (3.3v))

Grumpy_Mike

Then you need to drive it with a transistor and stop killing your arduino output pin.

Go Up