TCRT5000 Infrared IR proximity Obstacle sensor interfacing
with Arduino, Node MCU, ESP32
The working of the IR sensor module is very simple, it consists of two main components: the first is the IR transmitter section and the second is the IR receiver section. In the transmitter section, IR led is used which emits Infrred light which gets bounced by the object in front in the range from 0.5 cm to 1.5 cm and in the receiver section, a photodiode or a transistor.
Which receives infrared signal bounced back from the obstructing object. This received signal is amplified and fed to the comparator where after filtering out the noice a fine square wave is produced which can be fed to Arduino.
When there is no obstruction in the front the IR rays transmitted by IR LED is not reflected back and consequently IR receiver does not get any return signal. Total Time taken for IR signal to travel to object and get reflected back and reach the receiver is known as time of flight. We can compute distance to the object by multimplying speed of light by half of time of flight.
IR LED emits infrared light, means it emits light in the range of Infrared frequency. We cannot see Infrared light through our eyes, they are invisible to human eyes. The wavelength of Infrared (700nm – 1mm) is just beyond the normal visible light. Everything which produce heat, emits infrared like our human body. Infrared have the same properties as visible light, like it can be focused, reflected and polarised like visible light.
IR Receiver : TSOP is available in many frequency ranges like TSOP1730, TSOP1738, TSOP1740 etc. Last two digits represent the frequency (in Khz) of modulated IR rays, on which TSOP responds. Like for example TSOP1738 reacts when it receives the IR radiation modulated at 38Khz. Means it detects the IR which is switching On and Off at the rate of 38Khz.
We are using TSOP1738 as IR receiver, so we need to generate the modulated IR of 38 kHz. You can use any TSOP, but you need to generate IR of respective frequency as TSOP. So we are using 555 timer in Astable mode to oscillate the IR at 38KHz frequency. As we know oscillation frequency of 555 timer is decided by resistor R1, R2 and capacitor C1. As you can see in the blow IR Transmitter Circuit
We have used 1k R1, 20K R2 and 1nF capacitor to generate the frequency of approx. 38 KHz. It can be calculated using this formula: 1.44/((R1+2*R2)*C1).
When there is no obstruction in the front the IR rays transmitted by IR LED is not reflected back and consequently IR receiver does not get any return signal. Some of the sensor boards come with additional enable pin in which case it can be connected to digital Pin 8. There is one potentiometer for adjusting sensitivity. By adjusting sensitivity potentiometer we can adjust the distance of the reflecting object. Most of the commonly available boards will only have single potentiometer for adjusting distance threshold. But there are a few boards come with additional potentiometer for adjusting frequency.
TCRT5000 Infrared IR proximity Obstacle sensor interfacing with Arduino:
There are 3 pins on this sensor of which VCC & GND are connected to 5 volts DC and ground of Arduino. Output pin is connected to Pin 7 of Arduino which in turn activates Pin 8.
There are two LEDs and one buzzer to highlight certain conditions. Green LED is connected to Pin 2 of Arduino which is switched on when Arduino starts working. Then there is Red LED which is connected to Pin 3 of Arduino which together with Buzzer connected to Pin 4 switches on whenever there is an obstacle encountered or there is something within the range to which it is set.
TCRT5000 Infrared IR proximity Obstacle sensor interfacing with Node MCU:
There are 3 pins on this sensor of which VCC & GND are connected to 3.3 volts DC and ground of Node MCU. Output pin is connected to Pin GPIO7 of Node MCU which in turn activates Pin GPIO8. There are two LEDs and one buzzer to highlight certain conditions. Green LED is connected to Pin GPIO2 of Node MCU which is switched on when Node MCU starts working. Then there is Red LED which is connected to Pin GPIO3 of Node MCU which together with Buzzer connected to Pin GPIO4 switches on whenever there is an obstacle encountered or there is something within the range to which it is set.
TCRT5000 Infrared IR proximity Obstacle sensor interfacing with ESP32:
There are 3 pins on this sensor of which VCC & GND are connected to 3.3 volts DC and ground of ESP32. Output pin is connected to Pin GPIO7 of ESP32 which in turn activates Pin GPIO8. There are two LEDs and one buzzer to highlight certain conditions. Green LED is connected to Pin GPIO2 of ESP32 which is switched on when ESP32 starts working. Then there is Red LED which is connected to Pin GPIO3 of ESP32 which together with Buzzer connected to Pin GPIO4 switches on whenever there is an obstacle encountered or there is something within the range to which it is set.