Using IR Sensor (TCRT 5000) With Arduino

This tutorial is on the IR sensor application. It also specifies a method to remove static and low-frequency noise.

Jul 12, 2020

94297 views

2 respects

Components and supplies

1

5k Ohm resistor

1

Resistor 100 ohm

1

Arduino UNO

1

TCRT5000

Apps and platforms

1

Arduino IDE

Project description

Code

Remove static noise from IR sensor data

arduino

This code Static and the low-frequency noise from sensor data.

Downloadable files

Schematic for connection

Schematic for connection

Schematic for connection

Schematic for connection

Comments

Only logged in users can leave comments

dmsd

a year ago

Thank you for this article. I'm curious what the y-axis value units are as I need to map these as a function of distance for my project. Hopefully this article isn't too old and or no longer reviewed. Thanks again.

rxraine

3 years ago

Thanks for the useful article. One observation is that the declaration of 'a' is missing in the first code block, so it doesn't run 'as is'. Depending on the application, an alternative is to detect the edges - keep a rolling average and look for a big change. That way you don't need to use a digital output for every sensor, and may reduce the wiring complexity of a project.