Home » Electronic Sensors » 2 Simple Proximity Sensor Circuits
2 Simple Proximity Sensor Circuits

2 Simple Proximity Sensor Circuits

In this post we learn how to design your own simple yet useful proximity detector circuits using a single opamp LM351 and a couple of infrared diodes. Two concepts are explained here, the first one using an ordinary opamp, while the second one using IC LM567 which works with a phase locked loop principle ensuring very accurate response for the detection.


A sensor is a device that detects and measures any physical parameter of our environment and converts it into electric signals.

There is a long list of sensors that are available in market today. Some of them are humidity sensor, flex sensor, touch sensor, fingerprint sensor, pressure sensor and many  more.

We come across a lot of sensors in our day-to-day life. One such sensor is proximity sensor.

In this post , we are about to unravel how a proximity sensor works and what provide the necessary knowledge to make this project at home. As the name suggests, the unit detects whether an object  is near or far from it. They can be designed in different ways.

But, the most common method is the one based on INFRARED rays and OPAMP. Some common uses of this device can be seen in cell phones, automatic flush systems , automatic taps, hand dryers and never-falling robots.

Components Required

1.   IR led: Every led emits some form of electromagnetic radiation when powered up. From our household experience, we have known leds that emit visible light.

But, there are also some special leds that emit infra red rays. Just as there can be visible led of different colours , IR led also emit rays of different wavelengths. Infra Red rays can be of varying wavelengths and can take up any value belonging to their waveband.

So , it is very important that the IR photodiode used must be able to detect the particular wavelength of INFRA RED given out by the IR led.


IR led


2.   IR PHOTODIODE:  It is a special type of diode which is connected in reverse bias for IR rays detection. In the absence of IR radiation , it has a very high resistance and practically zero current passes through it.

But when the IR rays fall on to it  ,its resistance decreases and a current proportional to the intensity of the radiation is allowed to pass through it.

This property of photodiode is used to generate an electric signal in proximity sensor on incidence of IR rays.



3.   Op-amp (IC LM358): Op-amp or operational amplifier is a multi-purpose ic  and is highly revered in the electronics world.

In this project op-amp is used as a comparator. LM358 IC has two op-amps which means we can make two proximity detectors using just one IC. The reason to use op-amp in the circuit is to convert analog signal into digital signal.

Op-amp (IC LM358)


Op-amp or operational amplifier is a multi-purpose ic


4.   Preset: Preset is basically  a resistor having three terminals.

The function of a preset is to divide the total voltage available in a way that the user can access a fraction of it. We just have to set  the middle terminal to an appropriate position.

The preset sets the threshold voltage above which the output voltage should be generated. It can be manually set to resistance of any value by rotating its head using a suitable screwdriver.


Preset is basically  a resistor having three terminals


5.   Red led : I have used a red led for my project but in general led of any colour can be used. It acts as a visual signal to show that the obstacle has come close enough.

Red led


6.   Resistors:  Two 220 ohms and one 10k ohm.

7.   Power supply:   5 v to 6v.

How it work

The principle lying behind the working of a proximity sensor is fairly simple. A typical concept has two leds parallel to each other – IR emitting led and a photodiode.

They act as a transmitter-receiver pair. When an obstacle comes in front of emitter rays, they are reflected back and intercepted by the receiver.

As per the properties of the photodiode ,the intercepted IR rays decrease the resistance of the photodiode and the resultant electric signal is generated. This signal in practice is the voltage across the 10k resistor which is directly fed to non-inverting end of op-amp.


How does a proximity sensor work


The function of the op-amp is to compare the two inputs given to  it.

The signal from the photodiode is given to the non-inverting pin (pin 3) and the threshold voltage from potentiometer is given to the inverting pin (pin 2).If the voltage at the non-inverting pin is greater than the voltage at the inverting pin the op-amp output is high otherwise the output is low.

All in all, op-amp converts analog signal into digital signal in this circuit.


The sensor output can be used in two forms: ANALOG and DIGITAL.

Digital output is in the form of either high or low. Digital output signal of a proximity sensor can be used to stop the motion of an obstacle-avoiding robot. As soon as, the obstacle comes close enough, signal can be directly fed to the input pins of motor driver to stop the motors.

Analog output is a continuous range of values from zero to some finite value. Such signal cannot be directly given to motor drivers and other switching devices. First they need to be processed by the microcontrollers and converted into digital form through ADC and some coding. This output form requires an additional microcontroller but eliminates the use of op-amp.

Full Circuit Digaram

simple IR proximity sensor circuit using opamp



UPDATE from Admin

The above circuit design could be also built using an ordinary single opamp IC 741, as shown below:

simple proximity sensor using a single LM 741

Video Clip 


Accurate Proximity Detector Circuit

The following post explains an accurate infrared (IR) based motion detector circuit which incorporates the IC LM567 for ensuring reliable, and foolproof operations. The circuit also works as a obstacle or a proximity detector circuit.

The Circuit Concept

I found this design on the net while searching for an accurate and reliable yet cheap proximity sensor circuit.

The circuit may be understood with the help of the following description:

Referring to the below shown infrared (IR) motion detector circuit, we see  the design consisting of two main stages, one involving the IC LM567 while the other with the IC555.

Basically the IC LM567 becomes the heart of the circuit which solely performs the functions of the generating/transmitting the IR frequency and also detecting the same.

Moreover the IC has an internal phase locked loop circuitry which makes it highly reliable with frequency detecting  circuit applications.

It means once it reads and latches to a given frequency, its detection feature gets locked to that frequency and therefore any other stray disturbance no matter how strong it may be doesn't influence or rattle its functioning.

Circuit Operation

An internal oscillator frequency determined by R3, C2 feeds the IR diode D274 via a current controlled stage consisting T1, R2. This frequency decides the center frequency of the chip.

With the above conditions the IC gets set and centered at the above frequency generating a constant high at its output pin#8.

Input pin#3 of the IC waits to receive a frequency which may be exactly equal to the above "centered" frequency of the IC.

The IR receiver or the sensor connected across pin#3 of the IC is positioned exactly for this purpose.

As soon the IR beam from the LD274 finds an obstacle, its beam gets reflected and falls on the appropriately positioned detector diode BP104.

The IR frequency from the LD274 now passes to the input pin#3 of the IC, since this frequency will be exactly same to the set center frequency of the IC, the IC recognizes this and instantly switches its output from high to LOW.

The above low trigger at pin#2 of the IC 555 which is configured as a monostable  in turn switches its output high, causing the connected alarm to blow.

The above condition persists for so long as the interruption from of the IR sensor/ detector stays and allows the beams to get reflected. With the inclusion of R9 and C5, the output of IC555 exhibits a certain delay off condition for the connected buzzer even after the motion or the obstacle moves away.

For adjusting the delay-off effect, R9 and C5 may be tweaked as per preference.

The above explained circuit may also be used as a  proximity detector circuit and obstacle detector circuit.

Circuit Diagram

Precision proximity detector circuit using LM567

Test Circuit

The following test circuit shows how to verify the results from a basic LM567 IR based design. The schematic can be seen below:

How LM567 detects proximity targets

As you can see, only the LM567 stage is incorporated in the design while the IC 555 stage has been eliminated in order to keep the fundamental testing procedures simpler.

Here the red LED at pin#8 of the IC lights up and remains illuminated as long as the IR LEDs are held parallel to each other within a distance of 1 foot.

If you try replacing the Tx infrared red transmitter LED with some other external source having a different frequency, the LM567 is stop detecting the signals and the red LED will stop glowing.

The photo diodes are not crucial, you can use any similar or standard photo diodes for the transmitter and receiver LEDs.

Video clip for the above test set up:


About the Author

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials. If you have any circuit related query, you may interact through comments, I'll be most happy to help!

6 thoughts on “2 Simple Proximity Sensor Circuits”

  1. Howdy, Friend! Interested to Learn Circuit Designing? Let's Start Discussing below!
  2. Dear Swagatham
    No, I assembled a different circuit for detector stage. But transmitter, I used your simple 3v IR transmitter circuit. That is a very efficient transmitter.
    I made some modifications in a transistorised IR sensor circuit. I used N-Mosfets for motor driving.
    I assembled two identical IR based motor driving circuits. I fixed left IR sensor at right side and right IR sensor at left side.
    When the right side sensor detect an object, left motor will switch OFF, robot car will turn to LEFT and vice versa.
    I got smooth turning for both sides….!!!!!
    My practical experience want to share here.
    At first I used a 3mm small IR LED, the obstucle detecting distance was only 3cms. Before detecting the object, my car hit the object due to high speed.
    Then I just replaced 3mm IR LED with an IR LED from a TV remote control and reduced speed of motor also. The range increased to 15cms, which is morethan enough for an obstucle avoidance small toy car.

    Thanks and Regards.

  3. Hi dear Swagatham
    Recently I assembled an IR obstacle avoiding robot. First I tried IR led with series resistor, the distance was very low. Then I assembled a two transistor based IR transmitter circuit from one of your project “Automatic door lock ” I got more than enough range as I expected…….!!!!! But, what I want to do is to replace that circuit with single resistance method for simplicity and save space.

    Inthe above posted circuit, supply voltage is 5v, IR Led series resistance 220ohms, IR led current is only 16ma. Will this 16ma emit sufficient IR rays to get minimum atleast 10cm range, when the Photodiode and IR led placed side by side position as in an obstacles avoiding robots toys….?

    ( I wish to share my idea with you and other readers………
    I know, it is very difficult to connect motors properly with wheels for robotic cars. The best solution is to buy a toy JCB with mannual control ( not remote controlled ), remove showel, mechanical arm etc. This JCB has 2 x 6volt geared motors for left and right wheels independently. And also, the back wheel is connected with front wheel, is also a good option.

    The same JCB chassis, after modification can be used for LINE FOLLOWING robot too…..

    Thanks in advance…


Leave a Comment

Do NOT follow this link or you will be banned from the site!