0% found this document useful (0 votes)
316 views

Introduction To Arduino TCRT5000 (IR Sensor)

TCRT5000

Uploaded by

Marreza Rifa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
316 views

Introduction To Arduino TCRT5000 (IR Sensor)

TCRT5000

Uploaded by

Marreza Rifa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BLOG.HUNTGANG.COM (HTTP://BLOG.HUNTGANG.

COM/)
THE MIND IS A TERIBLE THING TO WASTE

HOME (HTTP://BLOG.HUNTGANG.COM/) | ABOUT ME (HTTP://BLOG.HUNTGANG.COM/ABOUT-ME/)

Introd 17 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comments) Search SEARCH


uction to Arduino TCRT5000 (IR Sensor)
Posted on June 17, 2014 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/) by dave
(http://blog.huntgang.com/author/dave/) RECENT POSTS
Ant Communicator SCAF (Systme de
Communication Avec les Fourmis)
(http://blog.huntgang.com/wp-content/uploads/2014/06/arduino-tcrt5000.jpg)I ended up with about 300 (http://blog.huntgang.com/2017/05/15/ant-
of these little TCRT5000 Infra Red Sensors after an eBay purchase and wasnt quite sure what I should communicator-scaf-systeme-de-communication-avec-
do with them. And then I was having a discussion with a friend (Darcy (http://inventorartist.com/)) who les-fourmis/)

was talking about a way to get people a bit more involved with the Arduino community in Ottawa. After Bolt Reference Chart for Makers
a few beers, the Ottawa Arduino Challenge (http://inventorartist.com/oac/) was born. The idea was (http://blog.huntgang.com/2017/02/28/bolt-reference-
simple. Give participants a small surprise sensor or component which they must use in their project chart-makers/)

submission within 4 weeks. In order to win, it would be vote by public so you really needed to be able Fusion 360 31 Day Challenge
to share your project with the world. (http://blog.huntgang.com/2016/12/05/fusion-360-31-
day-challenge/)

New NL6621 SoC Launched


(http://blog.huntgang.com/2016/01/28/new-nl6621-
soc-launched/)

Cheap DIY Quadcopter FPV Racing Gates Tutorial


(http://blog.huntgang.com/2015/07/06/cheap-diy-
quadcopter-fpv-racing-gates-tutorial/)

C ATEGORIES
3D Design (http://blog.huntgang.com/category/3d-
design/) (2)

3D Printing (http://blog.huntgang.com/category/3d-
printing/) (8)

Arduino (http://blog.huntgang.com/category/arduino/)
(7)
What is a TCRT5000 IR Sensor?
Christmas Lights
Well, I can tell you what it isnt! And despite its looks, it unfortunately is not a Star Wars Walker!!!
(http://blog.huntgang.com/category/christmas-lights/)
However, it is an IR Emitter and an IR PhotoTransistor packaged together. The Ardiuno TCRT5000 is (3)
designed to sense the distance to an object using Infra Red light waves. It can also identify the
FPV Racing (http://blog.huntgang.com/category/fpv-
difference between white and black based on the contrast of an object and its reflective properties. racing/) (1)

Fusion 360
(http://blog.huntgang.com/category/fusion-360/) (2)

Home Theater
(http://blog.huntgang.com/category/home-theater/) (2)

Laser Cutter
(http://blog.huntgang.com/category/laser-cutter/) (10)

NL6621 (http://blog.huntgang.com/category/nl6621/)
(1)

Other (http://blog.huntgang.com/category/other/) (3)

Reference Material
(http://blog.huntgang.com/category/reference-
material/) (1)

Video (http://blog.huntgang.com/category/video/) (3)

Vixen Lights
(http://blog.huntgang.com/category/vixen-lights/) (2)

ARCHIVES
May 2017 (http://blog.huntgang.com/2017/05/) (1)

February 2017
(http://blog.huntgang.com/2017/02/) (1)

December 2016
(http://blog.huntgang.com/2016/12/) (1)

January 2016 (http://blog.huntgang.com/2016/01/) (1)

July 2015 (http://blog.huntgang.com/2015/07/) (1)


(http://blog.huntgang.com/wp-content/uploads/2014/06/TCRT5000-datasheet.jpg)
February 2015
(http://blog.huntgang.com/2015/02/) (1)

January 2015 (http://blog.huntgang.com/2015/01/) (1)

December 2014
How To Use the Arduino TCRT5000 (http://blog.huntgang.com/2014/12/) (1)

November 2014
Wiring up the TCRT5000 to an Arduino is relatively straight forward. Simply connect the Anode (A) of
(http://blog.huntgang.com/2014/11/) (2)
the IR emitter to a 100 ohm resistor which has 5V applied, then connect the Cathode (C) of the IR
Emitter to Ground (GND) on the arduino. Next you need to connect the Emitter (E) of the Photo October 2014 (http://blog.huntgang.com/2014/10/) (1)

Transistor to ground, then apply 5V to a 10,000 ohm resistor which connects to the Collector (C). July 2014 (http://blog.huntgang.com/2014/07/) (1)
Finally to measure the voltage drop produced by the transistor all we need to do is connect an analog
June 2014 (http://blog.huntgang.com/2014/06/) (2)
pin from the Arduino to the Collector (C) of the Transistor.
April 2014 (http://blog.huntgang.com/2014/04/) (2)

January 2014 (http://blog.huntgang.com/2014/01/) (2)

December 2013
(http://blog.huntgang.com/2013/12/) (1)

August 2013 (http://blog.huntgang.com/2013/08/) (3)

April 2013 (http://blog.huntgang.com/2013/04/) (2)

March 2013 (http://blog.huntgang.com/2013/03/) (4)

February 2013
(http://blog.huntgang.com/2013/02/) (1)

RSS Stream (http://blog.huntgang.com/feed/)

(http://blog.huntgang.com/wp-content/uploads/2014/06/Breadboard-Layout-TCRT50002.jpg)

Sample Arduino TCRT5000 Code


You actually dont even have to write any code to start using the Arduino TCRT5000 sensor, all you
need to do is launch the AnalogReadSerial example and Upload it to your Arduino. Then simply open
the serial monitor window to see what is going on.

1 /*
2 AnalogReadSerial
3 Reads an analog input on pin 0, prints the result to the serial monitor.
4 Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
5
6 This example code is in the public domain.
7 */
8
9 // the setup routine runs once when you press reset:
10 void setup() {
11 // initialize serial communication at 9600 bits per second:
12 Serial.begin(9600);
13 }
14
15 // the loop routine runs over and over again forever:
16 void loop() {
17 // read the input on analog pin 0:
18 int sensorValue = analogRead(A0);
19 // print out the value you read:
20 Serial.println(sensorValue);
21 delay(1);// delay in between reads for stability
22 }

Arduino (http://blog.huntgang.com/category/arduino/), Laser Cutter (http://blog.huntgang.com/category/laser-


cutter/)

DAVE
M O R E P O S T S ( H T T P : // B L O G . H U N T G A N G . C O M /A U T H O R / D A V E / )

HOME THEATER BUILD UPDATE ARDUINO TCRT5000 DISTANCE SENSOR


(HTTP://BLOG.HUNTGANG.COM/2014/04/29/HOME- (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-
THEATER-BUILD-UPDATE/) TCRT5000-DISTANCE-SENSOR/)

17 COMMENTS
Pingback: Arduino TCRT5000 Distance Sensor - blog.huntgang.com
(http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-distance-sensor/)
Pingback: Electronic 1 | www.snellathomas.wordpress.com
(http://snellathomas.wordpress.com/2014/09/27/electronic-1/)

June 8, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=2120#RESPOND)


2015 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-2120)
SERGEY

Hi! Great post! Could you tell me how to increase measure distance?

October 13, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=2527#RESPOND)


2015 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-2527)
DODUTILS

Hello,

Do you know how this TCRT5000 would compare with a H21B1 Photodarlington Optical Interrupter
Switch (cut in the middle with the two parts glued side by side) ?

regards.

February REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=3164#RESPOND)


22, 2016
(http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-3164)
RAVI

can we use tcrt 5000 for eye blinking detection

REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=3165#RESPOND)
February 22, 2016 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-
sensor/#comment-3165)
DAVE

Certainly, Darcy worked on this at one point and shared some of his work here
http://inventorartist.com/blink-detector/ (http://inventorartist.com/blink-detector/)

May 10, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=3439#RESPOND)


2016 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-3439)
RICHARD (HTTP://CNCARTISANAT.COM)

This article helped me enormously.

October 6, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=3934#RESPOND)


2016 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-3934)
IDUL

Can you explain why should you use 10k and 100 ohms resistors?

November REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=4102#RESPOND)


19, 2016 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-4102)
ROB

Cheers for this used it to build the sensor into a Lego brick. :o)

February 3, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5217#RESPOND)


2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5217)
ROBERT

@IDUL The 100 ohm resistor lets the LED run at 50 mA which is 10 mA under the maximum, so it
running bright but within safe limits. Look up V=IR. The 10k ohm resistor is chosen to be in a useful
range for the transistor to be in active mode. Look up NPN transistor and phototransistor. From the
datasheet for this device, a 0.5 mA collector current (switch closed) corresponds to 5V collector-
emitter voltage when LED is running at 50 mA and a reflecting surface is right up close. Vcc (5V) with a
10k resistor yields a 0.5 mA max current through the phototransistor. The intensity of reflected light will
then produce values of between 5V (no light) and 0.2V (full light) for the voltage between collector and
emitter (and your Arduino analog pin is connected to measure this). It will yield digital values of to 1023.
My understanding is that you cant get true zero Vce due to current coming from the base (in this case
generated by the photo thingy) but I cant elaborate further as its beyond the scope of my knowledge.

February 3, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5219#RESPOND)


2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5219)
ROBERT

The previous post needs an edit. If the moderator (hello dave?) can simply delete it, that would be
appreciated.
February REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5363#RESPOND)
18, 2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5363)
JOSEPH

I would like to ask if we can use tcrt5000 to detect a fluid drop. Thanks.

REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5388#RESPOND)
February 21, 2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-
sensor/#comment-5388)
DAVE

I would use an ultasonic sensor http://playground.arduino.cc/Main/UltrasonicSensor


(http://playground.arduino.cc/Main/UltrasonicSensor)

February REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5409#RESPOND)


24, 2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5409)
MARTIN

@Dave: I think the ultrasound sensor might be too slow.


@Joseph: the TCRT5000 can be fooled by sunlight, you have to account for this

February REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5414#RESPOND)


25, 2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5414)
GANESH

How do the TCRT5000 and CNY70 sensors compare when used for rotary encoder wheels?

March 29, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5564#RESPOND)


2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5564)
IVAN CUERVO

What would change in the code for the TCRT5000 to detect lines and avoid them

April 1, REPLY (HTTP://BLOG.HUNTGANG.COM/2014/06/17/ARDUINO-TCRT5000-BUILD-IR-SENSOR/?REPLYTOCOM=5599#RESPOND)


2017 (http://blog.huntgang.com/2014/06/17/arduino-tcrt5000-build-ir-sensor/#comment-5599)
GASTON

Can i use this code and connection , and how? , so when the TRCT5000 detects something a little
engine starts working ?

LEAVE A REPLY

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

COMMENT

NAME *
EMAIL *

WEBSITE

POST COMMENT

2017 blog.huntgang.com. All rights reserved. Hiero (http://athemes.com/theme/hiero) by aThemes

You might also like