Why are my sensors not working (the reaction time is so slow)? //testing the light sensor;
int sensor=A0; // setting as input is by default;
int sensorval;
int pin=13;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(pin,OUTPUT);
  pinMode(sensor,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  sensorval=analogRead(sensor);
  Serial.println(sensorval);
  if(sensorval&gt;900)
    digitalWrite(pin,HIGH);
  else  digitalWrite(pin,LOW);
    delay(1000);
}


I am using a photocell, a temperature sensor and a potentiometer with an Arduino Uno and it always gives me 1023 0 1023 0 1023 0 1023 ....... All my wires are connected properly and I tried all this stuff online and they are working correctly.
Have you tried with a different trimmer?

I dont seem to be able to find any issue with your code or your schematic, so can you please cross verify that the trimmer is not spoilt. 

Can you also check if, when A0 is left floating (nothing connected) it give a random value.