Ottawa Arduino Challenge #1 Support Page

Welcome to the TCRT5000 infra-red which is the mystery component for the Ottawa Arduino Contest.

The following page is one example of a reference circuit. Here’s another from Dave (the other organizer). It’s more clear: TCRT5000 circuit.

Sample TCRT5000 Circuit

The resistor connecting the blue (IR send) is about 100 ohms. The resistor on the sensor side is about 10K.

Analog-1000

Analog Example

/*
  TCRT5000 IR Sensor Analog Test
  
  Circuit http://inventorartist.com/oac-tcrt5000/

  Load this program onto the arduino and then press the SERIAL MONITOR button. 
  You should see different numbers representing the distance between the sensor 
  and an object


 */

void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(0);
  Serial.println(sensorValue);
}

 

Digital Example

/*
  TCRT5000 IR Sensor Digital Test
  
  Circuit http://inventorartist.com/oac-tcrt5000/

  Load this program onto the arduino and then press the SERIAL MONITOR button. 
  You should see a 1 or 0 depending if an object is close to the sensor or not.

 */

void setup() {
  Serial.begin(9600);
  pinMode(8, INPUT);
}

void loop() {
  int sensorValue = digitalRead(8);
  Serial.println(sensorValue);
}

Related

http://www.hacker.instanet.net/forums/viewtopic.php?f=6&t=32

http://www.bajdi.com/analogread-from-a-tcrt5000-sensor/

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *