ADC Question about Arduino pro

I met a strange problem, here is my ADC code, the A3 should be the only input, however, through my testing, I just connect arduino to my laptop, and there's nothing connect to A3, but when I open serial monitor, it still display some values: Can anyone tell me why?

int sensorPin = A3; // select the input pin int sensorValue = 0; // variable to store the value

void setup() { pinMode(A3, INPUT); Serial.begin(9600); }

void loop() { sensorValue = analogRead(sensorPin);

Serial.print("Analog value:");

Serial.println(sensorValue*0.004883);

delay(sensorValue); }

Because the pin has a voltage whether or not you connect something to it.

CMOS inputs are ultra-high resistance (think about 10000 Mohms) so will float and pick up nearby signals capacitively.

MarkT:
Because the pin has a voltage whether or not you connect something to it.

CMOS inputs are ultra-high resistance (think about 10000 Mohms) so will float
and pick up nearby signals capacitively.

So how can I solve this problem? It will affect the testing result, if I connect A3 to a power supply, it can not display the correct value

Connect A3 to what you want to measure, that way you measure it and not interference.

@assassin, what's with that unrelated image in your post?

[quote author=Coding Badly link=topic=219458.msg1599793#msg1599793 date=1392849308]

@assassin, what's with that unrelated image in your post?

[/quote]

That is the image for my serial monitor, but it doesn't show correctly.

Your power supply has a very low impedance. It will overwhelm any other signals and the pin will read the power supply voltage.

KeithRB: Your power supply has a very low impedance. It will overwhelm any other signals and the pin will read the power supply voltage.

I try to connect A3 to power supply, but serial monitor cannot display the correct value =( =(

Gee, too bad. We can't see your circuit, so it is hard to help you. What do you expect it to read? what do you get? Try printing sensor value by itself. (And why the heck are you delaying by sensor value?)

Note, your Arduino can only measure up to its supply voltage.

KeithRB: Gee, too bad. We can't see your circuit, so it is hard to help you. What do you expect it to read? what do you get? Try printing sensor value by itself. (And why the heck are you delaying by sensor value?)

Note, your Arduino can only measure up to its supply voltage.

I just want my arduino pro to measure analog signal correctly, I connect the power supply to A3, but it can not show the correct value in the laptop.

Serial.println(sensorValue*0.004883);

The sensor value is an integer, you can not multiply it by a fraction, try:-

Serial.println((float)sensorValue*0.004883);

Grumpy_Mike: Serial.println(sensorValue*0.004883);

The sensor value is an integer, you can not multiply it by a fraction, try:- Serial.println((float)sensorValue*0.004883);

=( Doesn't work, it seems that the A3 is sensitive to anything, even though I ground A3, it can still affect the values.

OK stop crying it is annoying.

Now tell us what you have wired A3 to. Tell us what you see on the serial monitor do not just say it doesn't work. If you do not do these things no one can help you. Do you understand this?

Grumpy_Mike:
OK stop crying it is annoying.

Now tell us what you have wired A3 to. Tell us what you see on the serial monitor do not just say it doesn’t work.
If you do not do these things no one can help you.
Do you understand this?

Yes I know, I try to insert image, but failed. Let me describe the situation, I just connect arduino to laptop through FTDI cable, there’s nothing connect to any other pins, the serial monitor display like this:

Analog value:1.87
Analog value:1.87
Analog value:1.88
Analog value:1.85
Analog value:1.94
Analog value:1.95
Analog value:1.95
Analog value:1.93
Analog value:1.85
Analog value:1.84
Analog value:1.94
Analog value:1.91
Analog value:1.84
Analog value:1.95
Analog value:1.94
Analog value:1.88
Analog value:1.89

If I connect A3 to power supply and provide 2V for A3, it display like this:
Analog value:0.00
Analog value:0.00
Analog value:0.00
Analog value:0.00
Analog value:5.00
Analog value:0.00
Analog value:0.00
Analog value:0.00
Analog value:0.00
Analog value:4.44
Analog value:5.00
Analog value:3.88
Analog value:5.00
Analog value:4.83
Analog value:0.00
Analog value:0.04
Analog value:4.62

The values are not correct. Someone told me I should use a pull-up resistor to make the pin works in normal state.

If I connect A3 to power supply and provide 2V for A3, it display like this:

And have you connected the ground of this power supply to the ground of the Arduino?

Bring up an Arduino IDE. On the menu, select File->Examples->Analog->AnalogInput Wire a potentiometer to pin A0, following the instructions in the sketch. Run the sketch, and vary the potentiometer. Put a Serial.begin() into setup(). Put in a Serial.println(SensorValue); into loop() Vary the potentiometer.

If you don't have a potentiometer, put two resistors in series from GND to 5V, and connect the junction of them to A0. While running the sketch, place another resistor across one of the two in series, then across the other one.

Once you have that working, figure out why your circuit and sketch isn't.

Grumpy_Mike:

If I connect A3 to power supply and provide 2V for A3, it display like this:

And have you connected the ground of this power supply to the ground of the Arduino?

Oh I think I didn't, I'll have a try, thank you!