Battery provides inconsistent power

When I use a USB cord to power my Arduino, the connected piezo buzzer provides a consistant noise.
However, when I use a 9V battery to power my Arduino (both using battery jack, and VIN), the buzzer is extremely inconsistent, making the buzzer sound like a geiger counter.

Piezo wiring is just a digital pin connected to the + end, and a resistor connected to the - end.
Also, the buzzer sounds normal when it it connected directly to 5V, instead of a digital pin.

The code just sets the pin to output, then uses tone() to play a noise.

  • Some piezo buzzers make sound by an internal circuit when connected to power.
    Are you saying your buzzer is like that.

  • Please tell us you are not trying to use a 9v battery like this.

1 Like

That sounds like an active buzzer, not a piezo disk, and it cannot be powered by a digital pin. Use a piezo disk buzzer instead.

9V block batteries are for low power devices like smoke alarms, and are generally not useful for Arduino applications.

Ok, thank you very much.

How would you recommend battery powering the arduino?

  • How long will it need to be powered ?

If you have NiMH rechargeable AA batteries and a charger for them, you can use 4 of these in a holder like those shown by @LarryD above. This will provide around 5V and so can be connected to the 5V pin on the Arduino.

Rechargeable AA batteries would be useful. However, be mindful of the run-time of the arduino. Different AA batteries have different capacities (measured in mAh).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.