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
-
\$\begingroup\$ And maybe a schematic of how you're wiring it up? It sounds to me like you're not doing what you think you are. I have my suspicions but I'd like you to confirm them with a schematic before I post an answer. \$\endgroup\$Majenko– Majenko2014年12月20日 18:43:00 +00:00Commented Dec 20, 2014 at 18:43
-
\$\begingroup\$ okay posted a picture of it. The pin on the bottom of the barrel jack is hot/positive and the on on the side is neutral or useless I don't really know. \$\endgroup\$Gabe– Gabe2014年12月20日 19:07:04 +00:00Commented Dec 20, 2014 at 19:07
2 Answers 2
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.
-
\$\begingroup\$ Thanks I must have forgotten that bit I remember reading about it now. \$\endgroup\$Gabe– Gabe2014年12月20日 19:21:32 +00:00Commented Dec 20, 2014 at 19:21
You have to measure a voltage difference between two points here it looks like you are trying to measure by only connecting one pin? That wire sure makes a nice antenna though.
Explore related questions
See similar questions with these tags.