Pages: [1]   Go Down
Author Topic: Infrared Sensor  (Read 371 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Code:
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);
  }
}

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2947
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12487
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thank you, but with my sensor, it doesn't work.
so, you need to add a digitalRead() to read the sensor.


Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Opps...I must be tired smiley

Thank you all.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 515
Posts: 31573
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: