How Proximity Sensor Works

How does Proximity Sensors work


Proximity sensors are used to detect the presence of nearby objects without physical contact. They are used in various industries and applications such as automation, manufacturing, and security. This blog discusses the features of proximity sensors, how they work, and how to connect them. Whether you're a hobbyist or a professional, understanding proximity sensors can be beneficial for various projects. So, let's dive into the world of proximity sensors and explore their exciting features and applications.

In the evolving world of IoT, proximity sensors play a vital role in enabling us to create intelligent smart automation routines saving power and deliberate effort, overall increasing the efficiency of the entire system. 

But what exactly are proximity sensors?

In this blog post, we are going to discuss what are proximity sensors, how does a proximity sensor work, the different types of proximity sensors available and their potential applications in different scenarios

What is a Proximity Sensor?

The proximity sensor is a non-contact sensor that can detect an object/person (target) without any physical contact when the target enters the sensor’s field of range. Depending on the sensor used, the proximity sensor working principle can be based on infrared, ultrasonic, light, electric properties, etc.

There are many types of proximity sensors and each identifies a target in distinctive ways.


What is Proximity Sensors


These sensors are extremely useful in applications where an object or target is to be detected in a certain space - to create alerts, or execute a chain of other automations like turning on the lights and fans when a person enters the room. 

Features of Proximity Sensors

Non-contact Detection:

Proximity sensors detect objects without touching them. While limit switches detect an object by direct contact, proximity sensors use electricity to detect objects without touching the object so that they can't cause any harm or damage to the object.

Conversion to Electrical Signal:

These sensors are crucial for converting information about object movement or presence into a strong electrical signal, making them easy to integrate into different electronic systems and processes.

Suitable Across Variety of Applications:

Proximity sensors are versatile, working well in damp conditions and over a wide temperature range from -40°C to 200°C. They're used in many devices, like smartphones, where they use infrared (IR) technology to adjust display settings based on user interaction.

Three Detection Systems:

  • Capacitive Sensing: By noticing changes in electrical capacitance as objects approach, this method accurately detects proximity to the sensor.
  • Magnetic Field Detection: This method uses magnets and reed switches to sense object proximity by monitoring changes in magnetic fields.
  • Eddy Current Induction: This method detects eddy currents generated in metal objects when they interact with electromagnetic fields.

Alignment with Japanese Industrial Standards (JIS):

Proximity sensors follow the guidelines outlined in JIS C 8201-5-2, which are in line with the IEC 60947-5-2 standard for non-contact position detection switches. This alignment ensures uniformity and compatibility across different systems, facilitating smooth integration and reliable performance.

Quick Responsiveness:

Proximity sensors react fast without needing physical contact, unlike regular switches. This speed helps them detect changes quickly, making them great for tasks where being fast and accurate is important.

Resistance to Environmental Factors:

Proximity sensors are tough and can handle different environments well, even if there's water or oil around. Unlike optical sensors that might struggle in such conditions, proximity sensors keep working fine. They can deal with things like dirt, oil, and water, so they're reliable even in rough places.

 read our blog explaining the proximity sensor types and working principle, provides comprehensive information about various proximity sensors and their applications.

How Proximity Sensor Works?

Now is the time to know how does proximity sensor work? Proximity sensors come in different varieties and forms, each more suitable than the rest in certain scenarios. Below are the list of commonly found proximity sensors one could use and the working of proximity sensor.

Inductive Proximity Sensors Working

An inductive proximity sensor working principle is to detect metallic objects. This is because the sensor utilized the magnetic field to detect the presence of objects. When a metal object enters the field, the inductive properties between the sensor and the metal get altered thereby detecting the presence of the object. Depending on the type of metal and how inductive it can get, the sensor can either detect it from a greater distance or a shorter distance.

Inductive Proximity sensors are useful in situations where the object it is designed to detect is a known metallic object with a particular inductive properties 

Inductive Proximity Sensors

Capacitive Proximity Sensors Working

Capacitive proximity sensor working principle is measure distance based on the changing capacitance between the sensor and the target. Therefore, the object it detects will not be limited to metallic targets and will work on any target capable of carrying an electrical charge. 

Capacitive type sensors are primarily used for liquid detection

Capacitive Proximity Sensors

IR-based Proximity Sensors Working

IR proximity sensor working principle is applying a voltage to an IR LED, which emits infrared light. The light then hits the target, bounced back and the photodiode will detect the intensity of the reflected light. Based on the threshold settings of the sensor, the proximity sensor can determine if a target is close to the sensor and accordingly give a signal.

IR-type proximity sensors are relatively inexpensive and are suitable for hobby-grade projects requiring simple target detection capability

IR-based Proximity Sensors

Ultrasonic Proximity Sensors Working

Ultrasonic proximity sensor working principle is emitting sound frequencies greater than the audible limit of human hearing. They are mainly used for measuring distance but can also be easily used as a proximity sensor. The basic principle of the ultrasonic IR proximity sensor is similar to that of IR. The ultrasonic proximity sensor emits an ultrasonic pulse and receives a pulse back. Based on the time difference between sending the pulse and receiving the pulse, the ultrasonic sensor can determine the distance between the sensor and the target object. Based on the set condition, the ultrasonic sensor can output logic high or low.

Because ultrasonic sensors are based on sound and not electricity or electromagnetic waves, they can be used in situations where the former types of sensors would have trouble, like reflective surfaces, clear plastics, etc.

Ultrasonic Proximity Sensors

How to connect a proximity sensor?

Due to its relatively simple design and operation, connecting a proximity sensor is extremely simple and easy to use. Moreover, it should be able to work with any microcontroller or board with onboard GPIO with very few lines of code

Since the sensor is just designed to give a Logic HIGH or logic LOW signal, it will have one wire indicating the same signal. In addition, the sensor will also require power, so there will also be a VCC and GND cable. Hence typical proximity sensor modules will come with 3 wires for interfacing

  • VCC
  • GND
  • OUT

VCC will be connected to the sensor's appropriate voltage supply from the interfacing device like 3.3V, 5V, or 12V (please check the sensor datasheet). 

GND should be connected GND terminal of the interfacing device

OUT should be connected to a digital input pin of the interfacing device. The device should then read the signal and this particular port in order to determine the sensor’s output


The code will vary between different platforms and different programming languages. But since proximity sensors are relatively simple devices the general pseudo code to read the sensor is as simple as reading the digital pin the OUT wire is connected to

For example, in Arduino, if the sensor is connected to pin 7, the following 

int proximityPin = 7;

int reading;

void setup() {


  pinMode(proximityPin, OUTPUT);



void loop() {


  reading = digitalRead(proximityPin);

  if (reading == HIGH){

    Serial.println("Object Detected");

  } else {

    Serial.println("Object not detected");




For Raspberry Pi with Python, the following code can be used, if the sensor is connected to pin 7

import RPi.GPIO as GPIO

import time

proximity_pin = 7


GPIO.setup(proximity_pin, GPIO.IN)

while True:

read = GPIO.input(proximity_pin)

if read == HIGH:

print("Object detected")


print("Object not detected")



In this blog post, we have learned how proximity sensor works, proximity sensors are relatively simple, inexpensive, easy-to-use sensors capable of detecting an object or target using a non-contact method. These sensors play a vital role in the future of IoT and smart automation as proximity sensors are frequently used as triggers to carry out a smart function.

If you appreciate our work don't forget to share this post and leave your opinion in the comment box.


Please do check out other blog posts about Popular Electronics


Make sure you check out our wide range of products and collections (we offer some exciting deals!)

You may also like to read

Frequently Asked Questions

1. How do proximity sensors work?

Proximity sensors work by emitting an electromagnetic field, which reflects off nearby objects and returns to the sensor. The sensor then analyzes the strength of the returned signal to determine the distance and location of the object. 

2. What is proximity sensor used for?

The proximity sensor! A wondrous device that detects the presence of objects without physical contact. By emitting electromagnetic fields and detecting disruptions, it conjures up information about the world around it. From mobile phones to industrial applications, this wonder tool prevents collisions and makes adjustments with ease. Truly, a marvel of modern technology!

3. Can proximity sensor detect human?

Yes, proximity sensors can detect humans. They emit some sort of electromagnetic field or beam that bounces back when it detects a human nearby. This then triggers a response that can activate automatic doors, motion-activated lighting, or object detection systems. Fascinating! 

4. What is the Proximity sensor working principle?

Proximity sensors detect objects without touching them. They operate using principles like electromagnetic induction (inductive), changes in capacitance (capacitive), reflection of ultrasonic waves (ultrasonic), or interruption of light beams (photoelectric).

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.

You may also like to read