infrared sensor!

i made this infrared sensor from

http://courses.cit.cornell.edu/ee476/FinalProjects/s2008/djf35_swl28/djf35_swl28/images/ir_sensor.jpg

so when i use the serial monitor i gives me a constant value of 227 could u please help me i am using analog pin zero

and heres my code

#define SENSOR 0 // select the input pin for the
// sensor resistor
int val = 0; // variable to store the value coming
// from the sensor
void setup() {
Serial.begin(9600); // open the serial port to send
// data back to the computer at
// 9600 bits per second
}
void loop() {
val = analogRead(SENSOR); // read the value from
// the sensor
Serial.println(val); // print the value to
// the serial port
delay(100); // wait 100ms between
// each send
}

please help me out

will this work out ? please help me out

yes it works checked out the volteges

Have you tried sending some infrared signal to the sensor to see if the value changes? For example using your television remote and pressing buttons while aiming it at the sensor.

even if there is nothing connecter to the pin the values keep chnanging !

yaa i tried it the aoltage differs when i press a remote button pointed at it

richard,
i checked if the infrared detedtor changed voltager when a pointesd the remote and pressed a button
and
after removing my sensor from the arduino i tried the serial port and it kept on showing werid values

ok tell me how to check the analog input :slight_smile:

thanks richard my analouge input iz perfect cheked out hte problem is with the ir receiver it dosent have ambient ir protection found i t out after googling a lot and thanks a lot for your advice! :-[

I just made a similar circuit and didn't need ambient protection / IR-only filters to detect IR from a remote.

If the reading from the analog pin changes by at least 10% I am registering a "hit". Works great.

I seem to remember I had the transistor in the circuit backwards at one point and got pretty wild readings. You might want to double-check that.

thanks dude but i cheked it out it was the led's fault