Arduino's Serial Monitor Showing Constant Value I have a breadboard Arduino; made with ATMega328PU and a UART connector using a CT2102 breakout board. With the help of this site I created a simple IR sensor, now the problem is that in the Serial Monitor I'm getting a constant value of 1023. Even on removing the receiver (photodiode), the value's starts dropping like a capacitor discharges, and then stabilizes at some value (around 260-300). 

When everything was working correctly, the value dropped to a sudden zero on removing the receiver, but now it isn't.

The "robot" was working perfectly and was reading the values correctly, but suddenly, the values dropped; we checked it and the Serial Monitor showed the same values. To check if the connections are working, I removed a wire from the Analog Pin of the Breadboard-Duino, and the values started to drop: like a periodic function.

The following code was used:

int pd=2;                      //Photodiode to digital pin 2
int buzz=13;                   //piezo buzzer to digital pin 13  
int senRead=0;                 //Readings from sensor to analog pin 0  or A0
int limit=850 / 4;                 //Threshold range of an obstacle  
void setup()    
{  
  pinMode(pd,OUTPUT);  
  pinMode(buzz,OUTPUT);  
  digitalWrite(pd,HIGH);       //supply 5 volts to photodiode  
  digitalWrite(buzz,LOW);      //set the buzzer in off mode (initial condition)  
  Serial.begin(9600);          //setting serial monitor at a default baund rate of 9600  
 }  
void loop()  
{  
  int val=analogRead(senRead) / 4;  //variable to store values from the photodiode  
  Serial.println(val);          // prints the values from the sensor in serial monitor  
  if(val &lt;= limit)              //If obstacle is nearer than the Threshold range  
  {  
   digitalWrite(buzz,HIGH);     // Buzzer will be in ON state  
   delay(20);  
  }  
  else if(val &gt; limit)          //If obstacle is not in Threshold range  
  {  
   digitalWrite(buzz,LOW);      //Buzzer will be in OFF state  
       delay(20);  
  }  
}  


Any help will be appreciated.

EDIT

The phototransistor/diode is a standard 2pin component which came with the IR sensor.
In your initialisation where you declare each variable and 'connecting' them to a pin you make a mistake. Now you say that senRead is a digital pin instead of a analog pin. Change the value to A0 so you will get 

int senRead = A0;

Also in your void Setup() you forget to declare your analog pin as an input. Add a pinMode command that sets senRead as an input. 

If this doesn't fix your problem then it is probably hardware related. Check the connections on your breadboard will most of the times solve alot of problems.