Amplifier not driving analong input?

Hey guys,

For the project I'm working on, we're using a KMZ10A magnetic field sensor as a compass. It outputs a small differential voltage (~5 mV), so we're amplifying that with an AD623.

When the compass + amp are on their own, they work fine (ie, the voltage output by the amp as seen by my voltmeter is exactly what is expected). However, when I attach the output of the amp to an analog input, that analog channel always reads 1 - not what the voltage-value should be.

I've tested the analog pins with other things to make sure they're still working, and they work fine. Just not when attached to the amp.

Here's a test sketch I'm using:

void setup()

void loop()

And an abbreviated schematic of the compass - amp - arduino connections:

Anyone have any ideas what's going on? Thanks!!

You may want to setup your analog pin as an input. I would start there.

Ok, that worked, and now I feel retarded. Thanks!

Though, how come when running the same sketch as above (without setting the pin mode to input), the arduino reads voltages just fine (just not with the amp)? All of the other analog pins I’m using don’t have to be set to input to work properly first either…

You may want to setup your analog pin as an input. I would start there.

No, that's not necessary. You only need to do that if you are using the analog input pin as a digital pin.

If you can post a schematic, maybe that will shed some light.