Infrared Sensor

Hi everyone!

Is there a code out there for turning on an LED on HIGH for 15 seconds when the Arduino senses infrared light with a TSOP sensor? Thanks!

Sounds like a quite simple program? ONly I don't know hte sensor

void setup()
{
  pinMode(10, OUTPUT);
}

void loop()
{
  int x = readSensor();  // to write

  if (x > THRESHOLD)  // fill in real value
  {
    digitalWrite(10,HIGH);
    delay(15);
    digitalWrite(10,LOW);
  }
}

Thank you, but with my sensor, it doesn't work.

Is there a link to where we might find your sensor?

It is a TSOP 1736. Here is the data sheet download: http://www.datasheetdir.com/TSOP1736+IrDA

Thank you, but with my sensor, it doesn't work.

so, you need to add a digitalRead() to read the sensor.

Opps...I must be tired :slight_smile:

Thank you all.

That sensor will only respond to modulated IR light at 36KHz you know. Also if the light goes on for longer than about 40 pulses it will stop signalling you have IR.
Does that fit in with what you want to do?

Yes...It does fit. Thank you for the information, though!