Arduino detects voltage on ground

analogarduinoswitch-mode-power-supply

I've been having a hard time finding a solution to this problem.

I recently ordered a 5 Volt 2Amp AC to DC switching power supply from adafruit.cc

When I connect my Arduino's analog sensor to the ground of my switch mode power supply my Arduino detects that it's oscillating.

I thought the voltage on the ground pin would always be 0 and not oscillate. The power supply on the Arduino does this properly. Why am I having this issue with the switching power supply and is there any way to to make the circuit have a consistent ground?

EDIT: Links to info
http://arduino.cc/en/Tutorial/AnalogInput
https://www.adafruit.com/products/276

I don't know how useful that analog input info will be I'm more of a programmer.

ground pin oscilloscope capture
Arduino schematic

Best Answer

Yes, @SHG is right, and you confirmed my suspicions.

The analog input measures the voltage difference between the arduino ground and some point above arduino ground.

You can only measure relative to the Arduino's ground, not measure some other point in another circuit.

You have to connect the ground of the Arduino to the ground of the remote circuit in order to get any form of meaningful signal. In your case you would basically be measuring the Arduino ground since they would both be connected together.