A sensor is a device that detects and responds to inputs from the physical environment. The input can be light, heat, motion, moisture, pressure, or any other environmental phenomena. Sensors are very important part of electronics, especially in Robotics and Automations. The output generated by the sensors are transmitted to other circuits for reading or for further processing. They make our life easy by automatically sensing and controlling devices, without human interaction. In this video, we are going to talk about "IR sensors" or Infrared sensors, how they work and how to build a "DIY IR Sensor Module".
A sensor is a device that detects and responds to inputs from the physical environment. The input
can be light, heat, motion, moisture, pressure or any other environmental phenomenon. Sensors are
very important part of electronics, especially in the field of robotics and automation. The output
generated by sensors are transmitted to other circuits for reading or for further processing.
They make our life easy by automatically sensing and controlling devices without human interaction.
In this video, we are going to talk about IR sensors or infrared sensors,
how they work and how to build a DIY IR sensor module.
Thousands of engineers, students and hobbyists worldwide are using their PCBs for their daily
work and study. When you sign up with PCBWay, you get a $5 credit and with every order you place,
you get beans which you can redeem for products and services. For this project, we need one LM358
IC, one 10k potentiometer, one LED, one IR LED, one photodiode, 100 ohm resistor, 100 kilo ohm
resistor and a 220 ohm resistor. Now let's talk about the three main components of this module.
The IR LED is a solid state light emitting diode that emits light with a longer wavelength than the
visible light. IR light is invisible to human eyes as its wavelength ranges between 700 nanometers
to one millimeter. Everything which produces heat emits infrared light. Infrared light has
the same properties as the visible light. It can be focused, reflected and polarized.
The appearance and operation of an IR LED is same as a common LED. When operated at 5 volts,
the IR transmitter consumes about 3 to 5 milliampere of current. Depending upon the
transmitter and manufacturer, IR LEDs can have light emitting angle of approximately 20 to 60
degrees and a range of approximately few centimeters to several feet. Since the human eye cannot see
the infrared radiation, it is not possible for a person to identify if an IR LED is working or not.
The simplest way to view infrared light is by using a remote control while looking through a
camera. If the infrared LED is working, it will appear on the digital camera's viewfinder as a
purple glow. Unlike LEDs that project part of the visible light spectrum,
IR LEDs are not used to provide lighting. They are instead most commonly used in various signal
transferring systems such as remote controls, night vision cameras and other devices. IR LEDs
are commonly used in conjunction with the IR receiver to support a wireless communication
between two or more devices. A photodiode is a semiconductor device that converts light into
an electric current. The current is generated when photons are absorbed by the photodiode,
similar to a light-dependent resistor. Means it has a very high resistance in the absence of light
and the resistance becomes low when light falls on it. However, unlike the LDR which is analog
and bidirectional, photodiode is a unidirectional semiconductor which has a PN junction and operates
in reverse bias. Photodiodes also look like a LED with a black color coating on its outer surface.
Different types of IR receivers exist based on the wavelength, voltage, packaging etc.
When used in an infrared transmitter receiver combination, the wavelength of the receiver
should match that of the transmitter. LM358IC is a dual operational amplifier IC integrated with
two op-amps powered by a common power supply. In this circuit, we are using it as a voltage
comparator. LM358IC has two independent voltage comparators inside it which can be powered by a
single pin so we can actually build two IR sensor modules using this IC. In this tutorial, I will
only use one comparator which have input at pin number 2 and 3 and output at pin number 1. The
voltage comparator has two inputs. One is the inverting input pin number 2 and second is the
non-inverting input or in-phase input pin number 3. When voltage at the non-inverting input is
higher than the voltage at the inverting input, then the output at pin number 1 is high and vice
versa. Pin number 4 is the negative power supply when dual power supply operates and ground when
single power supply operates. Pin number 8 is the positive power supply. Pin number 1, 2, and 3
are one op-amp channel and pin number 5, 6, 7 are the second op-amp channel. An IR sensor consists of
an IR LED and a photodiode. Together they are called optocoupler or photocoupler. IR sensor
works on the principle in which IR LED emits infrared radiation and the photodiode senses
the radiation. Photodiode's resistance changes according to the amount of IR radiation falling
on it. Hence, the voltage drop across it also changes and by using a voltage comparator IC like
the LM358 IC, we can sense the voltage change and generate the output accordingly. We can place IR
LED and photodiode in two different ways, direct or indirect. In direct incidence, the IR LED and
photodiode are placed facing each other so the IR radiation directly falls on the photodiode. When an
object is placed between the IR pair, it stops the falling of the IR light on the photodiode. And in
direct incidence, both IR LED and photodiode are placed side by side. When an object is placed in
front of the IR pair, the IR light gets reflected by the object and gets absorbed by the photodiode.
So this is how my board looks like in 2D and 3D. There are 15 individual IR modules on this 100
centimeter by 100 centimeter board. The ordering process from PCBWay is very easy. Once I had my
design ready, I just had to upload the Gerber file to the PCBWay's website and select the type, color,
any other customization that I want and then just send it for fabrication. For my project, I chose
the black color. PCBWay ships from China to most of the countries of the world within three to
seven business days. Talking about the quality, it's absolutely mind-blowing. Let's start the
project by soldering the three resistors to the board. After that, I'm soldering the 10k port
followed by the base of the LM358 IC. Next, I'm soldering the male pin header to the board.
After that, I'm soldering the optional LED indicator to the board. If you don't want the
LED indicator, then you can skip the 220 ohm resistor which we installed in step number one.
Next, I'm soldering the photodiode and the IR LED to the board. Now to finalize the setup,
I'm installing the LM358 IC to the base which we soldered in step number three. That's it. All done.
By placing my hand in front of the IR module, I'm reflecting the infrared light emitted by the IR
LED towards the photodiode. The photodiode detects the light and turns the output of the
comparator pin number one to high. When the output at the pin number one goes high, the LED indicator
lights up. By adjusting the resistance of the potentiometer, we can control the sensitivity
of the photoresistor. The IR sensor is a very popular sensor which is used in many applications
in electronics like remote controls, motion detectors, obstacle detectors, product counters,
line following robots, alarms, audio equipments, lighting equipments, night vision cameras to
distinguish between black and white color, signal transferring systems for machine-to-machine
communications, and more. The advantages include infrared devices can detect soft object which may
not be easily detected by ultrasonic sensor. They provide secured communication due to line of sight
or point-to-point mode of communication. They consume very low power to operate. They are very
small and inexpensive. They provide good stability over time. No corrosion or oxidation can affect
the accuracy of infrared sensors. They deliver high repeatability. Disadvantages include infrared
frequencies are affected by hard objects like wall, smoke, dust, fog, sunlight, etc. Hence,
it does not work through wall or doors. Infrared waves at high power can damage eyes. Objects should
not be black in color as it will absorb all the IR light. They require line of sight between
transmitter and receiver to communicate. They can control only one device at a time.
They support shorter range and hence their performance degrades as the distance increases.
They support lower data rate transmission as compared to the wire transmissions.
Thanks again for watching this video. I hope it helps you. If you want to support me,
you can subscribe to my channel and watch my other videos. Thanks. See you again in my next video. Bye
now.