little confusion in analog stuffs

Discussion in 'Embedded Systems and Microcontrollers' started by bhuvanesh, Jan 3, 2014.

  1. bhuvanesh

    Thread Starter Member

    Aug 10, 2013
    Code ( (Unknown Language)):
    1. void setup()
    2. {
    3.   Serial.begin(9600);
    4.  }
    5. void loop()
    6. {
    7.   int a= analogRead(3);
    8.   Serial.println(a);
    9.   delay(1000);
    10. }
    but i have not connected anything to that analog pin but i am getting values around 500.whats the reason for that
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    Hard to say exactly why it could be say noise pickup. But a thumb rule in electronics is. Undefined input will get you undefined output. So measuring some floating input (not connected) do not give any meaning at all. It is like a radio tuned between to stations
    bhuvanesh likes this.