I have pulled down the analog pins to ground with different resistor values to stop the floating of the analog pins when they are unused but still failed to get a proper 0 at the output. My serial monitor always shows some value(different for different pull-down resistance). Is there any way to make the floating to stop? and have a proper zero as output? What will be the suitable value for the pull-down resistor?

I was testing the voltage reading from a 10k potentiometer.

My test code:

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println(analogRead(A4));
delay(100);
}

When I disconnecting the output from the pot it should show zero instead it is showing like this.

output

0
0
0
0
0
0
33
130
165
165
163
159
173
0
0
0
0
0
0
33
130
165
165

Schematic:

enter image description here

  • 2
    Tell us which resistors and which sketch you use and what the resulting values in the serial monitor are. Please add the extra information to your question. – Jot Sep 13 at 7:27
  • for 10k as pull-down it is showing a fluctuating value from 215 to 217 for 470ohm as pull-down it is showing a fluctuating value from 3 to 6 for 1k as pull-down it is showing a fluctuating value from 13 to 15 and I am only measuring voltage values from a 10k potentiometer(5v to GND). – Peouse Dutta Sep 13 at 7:35
  • When I connect a resistor from a0 to gnd, the analogRead returns zero. I have tested it with 1k, 10k and 100k. Are you testing this with a potentiometer? Please update your question and add the extra information to your question. Can you show a photo or a schematics as well? – Jot Sep 13 at 7:49
  • 1
    You have to explain what you are doing. The problem is in the part that you are not telling us. Can you show the sketch to start with? Do you use resistors or a potentiometer? Please update your question at the top with the extra information. – Jot Sep 13 at 7:59
  • 1
    Looking at the numbers, I've got the feeling that your code is enabling the internal pull-up resistors. This, combined with you pull-down resistor will create a voltage divider. PS I notice you talk about a potentiometer in the comments, but never mentioned that in the question. – Gerben Sep 13 at 9:29

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.