Strange Arduino Behavior with the 9 Volt Power Supply

Hello,

I am new to the arduino platform and code, so the answer to this problem may be obvious to you, but not me. I have been powering my arduino project with a 9 volt battery for a while. It worked fine for the passed few days, until today. Whenever I plug in my power supply, I am getting strange behavior. After this, I plugged the arduino into my computer and it worked fine.

What is going on?

Thanks,

I_Got_Pi

Just a guess, but it's possible that your 9V battery isn't a 9V battery anymore; those things have a reputation for not lasting. Measure the voltage if you have a meter: the Vin pin will be at the voltage applied, and so will show the battery voltage while it's under the load of the Arduino).

Or just replace it with a new one and see if that works.

(ps.. what is the "strange behaviour"?)

My project involves a speaker and a ping sensor. It is a simple theremin of some sort. The closer to the ping sensor, the lower the pitch. The problem is, when I plug in my 9V battery, instead of playing the tones according to my hand and the ping sensor, it gives one long, low tone.

Well if it a) used to work with the battery and b) works with the usb it's probably the battery.

Do you have a meter to check it?

I have a multimeter to check it... but how? I am also new to electronics and I can't understand your instructions from your previous post.

Just to let you know, I am using an arduino uno. (If this is helpful)

Well two things…

First, just check the battery when it’s disconnected from everything. Simply set your meter to VDC (Volts Direct Current) and usually there will be ranges like 2VDC or 20VDC… obviously you will need to set it to 20 since 9 > 2.

Sometimes meters don’t say “DC” but have the DC symbol which is like an = sign but with one line dotted. (This is as distinct from Alternating Current which will say AC or have a ~ symbol… AC is what comes out the wall.)

A fresh battery should obviously be round 9V…

Second, you’ll get a better reading if you measure the battery when it’s actually doing some work. It’s voltage will be lower and that’s a more meaningful value of the battery condition. So to do that, if you can get at the battery terminals while it’s connected, that’s the easy way. But if you have one of those press-on connector things the terminals may be inaccessible. So then you can go for the Vin pin on your UNO and measure that. Stick a wire into Vin and another into Ground and measure the voltage there. That’s the same voltage that the UNO is getting from the battery… see pic attached.

Edit… added another pic of the wires in Vin and Ground, connected to my meter

ArduinoUno_R3_Front_arrows.jpg

I_Got_Pi: I am new to the arduino platform and code, so the answer to this problem may be obvious to you, but not me. I have been powering my arduino project with a 9 volt battery for a while.

Time to replace the battery.

Those 9V batteries are basically a handful of "coin" cells stacked on top of each other.

Thanks a lot! Your help solved my problem!