This post’s subject are the infrared sensors. It is possible to build one or buy a complete, and make many electronic and robotic projects.
How it works?
A LED emits infrared light, the LED’s operation has been explained in another post, the button below will access the post.
The infrared light is reflected by a surface and goes to the receiver.
The receiver is a phototransistor, a bipolar junction transistor which instead of base terminal, it is encapsulated with transparent material, allowing the light to enter. The current is controlled by light intensity. In the schematics, the phototransistor is represented like a transistor, however with two arrows and without base terminal.
Some phototransistors has a base terminal do control the component.
In the phototransistor, the areas of base and collector are bigger than in the normal BJT transistor. When light hits the base, electron-hole pairs are generated in base-collector junction, move by electric field between the collector and emitter, creating a base current. In NPN, the collector is positive with respect to emitter, in PNP case, it is negative with respect to the emitter.
The most used material is the doped gallium arsenide (GaAs). In phototransistors with heterojunction structure, like in the figure below, the material to the emitter is aluminum gallium arsenide (AlGaAs).
Building the sensor
The components to build an infrared (IR) sensor are: 1 IR LED, 1 phototransistor and 2 resistors: one of 10 kΩ and other of 330 Ω.
This is the schematics.
This is the sensor assembled in protoboard. The phototransistor is the transparent, the flatted part must be linked to the resistor.
And assembled in a printed circuit board.
The circuit below makes the relay switching when IR sensor detects some object. The MOSFET (Field Effect Transistor) used is IRF840 and the relay is Metaltex AT1RC1 6VDC.
The circuit assembled in printed circuit board, the phototransistor and IR LED are in the other side.
Commercial infrared sensors
Instead to use a IR LED and phototransistor individually, can use a reflective infrared sensor like the TCRT5000.
This is another commercial IR sensor obstacle detector, was made to be connected to Arduino. Turns on a LED behind when detects an object in front.
This sensor has a screw behind to adjust the detection distance.
The sensor connected to Arduino. The white wire is the sensor’s data input and is in digital pin 7.
The algorithm test does not have nothing new.
When there is no obstacle present, appears “1” in the serial screen. When detects an obstacle, the screen shows “0” and LED behind lights on. Other IR modules work in similar way.