Ultrasonic distance sensor not working when using batteries as power suply

Hello, I have a project where I get the distance from an ultrasonic sensor and save it in a log in a file using a Wifi shiled. When the arduino is connected to the computer everything works fine but when I connect it to a 6 AA batteries adapter I only get ceros in the log. The batteries are new.

I noticed that connected to the pc the TX led is very bright but connected to the batteries I can barely see it.

Do I need more power? What are the options?

Thanks

but when I connect it to a 6 AA batteries adapter

Did you mean a 6V (4xAA) or 9V (6xAA)?

How is this source connected?

AWOL:

but when I connect it to a 6 AA batteries adapter

Did you mean a 6V (4xAA) or 9V (6xAA)?

How is this source connected?

9V (6xAA)

I have this adapter http://cdn.shopify.com/s/files/1/0192/8922/products/ADEX-03-AA_1024x1024.jpeg?v=1370607211

The ultrasonic sensor needs 5V to work and the arduino mega board from 6V to 12V. Do I have to sum both voltages (5V + 6V) to determine how much I need? If so I need minimum 11V.

I'm not an electronics person

Do I have to sum both voltages (5V + 6V) to determine how much I need?

No you don't.

Have you got a multimeter?
If so, measure the 5V pin.
Measure the voltage on the barrel of the adapter and the hollow inside.

The fastest way to determine a power source issue is to try using a wall adapter to power it, a 9-12V one if you can through the 2.1 DC jack. If it works fine then everything is ok but the power supply.

I’m not going to bother looking up the specs for the wifi shield but I’m going to assume it has a fairly good current/power draw.

By best guess is that the AA batteries can’t provide the required current, replace with a single 9V plug battery as a temporary test, they have a much better current capacity and I would suspect fixes the issue.

If that fixes the issue, and want to stick with AA you’ll need to double up the batteries at a minimum (in parallel) till they can provided the required current.

If this doesn’t solve the issue then more information is required.

What kind of 9V battery is it that has better current delivery than a pack of AA's? Certainly NOT the Brick (a.k.a. transistor radio battery).

I was using the mega adk. I switched to mega 2560 and it works perfectly.