Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Sensors & Modules

Proximity Sensor Types: IR vs Ultrasonic vs Capacitive Explained

Proximity Sensor Types: IR vs Ultrasonic vs Capacitive Explained

March 11, 2026 /Posted byJayesh Jain / 0

Choosing the wrong proximity sensor type is one of the most common mistakes in Arduino and IoT projects. An IR sensor that works perfectly indoors fails in sunlight. An ultrasonic sensor that detects objects 3 meters away struggles with soft fabrics. A capacitive sensor that detects water through a wall is completely fooled by a metal object.

Each proximity sensing technology has specific strengths and limitations that make it ideal for some applications and terrible for others. This guide breaks down every major proximity sensor type available to makers in India — IR, ultrasonic, capacitive, PIR, and LiDAR — with concrete specs, wiring guidance, and project recommendations.

Table of Contents

  1. What Is Proximity Sensing?
  2. IR (Infrared) Proximity Sensors
  3. Ultrasonic Sensors: HC-SR04 and Waterproof Variants
  4. Capacitive Proximity Sensors
  5. PIR Motion Sensors: A Special Case
  6. LiDAR: High-Precision Proximity
  7. Side-by-Side Comparison Table
  8. How to Choose the Right Proximity Sensor
  9. Arduino Code Examples
  10. Project Ideas by Sensor Type
  11. FAQ

1. What Is Proximity Sensing?

A proximity sensor detects the presence or absence of an object — and in many cases, the distance to it — without physical contact. This is fundamental to a huge range of applications: automatic door openers, robotic obstacle avoidance, liquid level detection, touchless buttons, intruder detection, and industrial assembly line verification.

Unlike a simple switch, a proximity sensor works over a distance and can return either a binary (present/absent) signal or an analog/digital value representing distance. The technology used determines everything: range, accuracy, response time, power consumption, and sensitivity to environmental conditions.

2. IR (Infrared) Proximity Sensors

How IR Proximity Works

An IR proximity sensor emits infrared light from an IR LED and measures the reflected signal with a photodetector. When an object comes within range and reflects the IR beam back, the receiver detects the increase in IR signal strength.

There are two main types:

  • Reflective IR sensors: Transmitter and receiver side by side; detects objects by reflection. Examples: TCRT5000, Sharp GP2Y series.
  • Break-beam IR sensors: Transmitter and receiver on opposite sides; object detection by interrupting the beam. Examples: optocouplers, through-beam sensors.

IR Sensor Specifications

  • Range: 2–30 cm (reflective), up to several meters (beam-break)
  • Response time: Very fast (<1 ms)
  • Power: Low (typically 20–50 mA)
  • Output: Analog or digital (depending on module)
  • Cost: Very low (₹20–150 per module)

IR Sensor Limitations

  • Sunlight interference: Bright sunlight contains strong IR and can saturate the receiver, causing false readings. This makes basic IR sensors unreliable outdoors.
  • Surface dependence: Dark or matte surfaces absorb IR and may not be detected even when close. Shiny surfaces may deflect the beam away from the receiver.
  • No distance measurement: Simple IR modules give only binary (object present/absent) output, not distance.

When to Use IR Sensors

IR sensors are ideal for indoor object detection at short ranges, line-following robots, proximity switches on enclosed machinery, and any application where cost is the primary constraint. They are NOT suitable for outdoor use, dark/absorptive materials, or when you need actual distance measurement.

AC 220V Security PIR Human Body Motion Sensor

AC 220V Security PIR Human Body Motion Sensor Detector

Mains-voltage PIR sensor for direct integration with 220V lighting — no microcontroller required. Perfect for automatic light switches and security systems.

View on Zbotic

3. Ultrasonic Sensors: HC-SR04 and Waterproof Variants

How Ultrasonic Sensing Works

Ultrasonic sensors emit a burst of sound waves at 40 kHz (above human hearing) and measure the time taken for the echo to return. Since the speed of sound in air is known (~343 m/s at 20°C), distance is calculated as:

distance_cm = (echo_time_microseconds / 2) / 29.1

The HC-SR04 is the most popular Arduino-compatible ultrasonic sensor. It has a 4-pin interface (VCC, GND, Trig, Echo), a range of 2–400 cm, and costs under ₹80.

Ultrasonic Sensor Specifications

  • Range: 2–400 cm (HC-SR04), 20–600 cm (JSN-SR04T waterproof)
  • Accuracy: ±3 mm
  • Beam angle: ~15° cone
  • Response time: ~60 ms (one measurement cycle)
  • Power: 15 mA at 5V
  • Output: PWM pulse width proportional to distance

Ultrasonic Sensor Advantages

  • Works on nearly any object regardless of colour or surface texture
  • Not affected by ambient light (including sunlight)
  • Provides actual distance, not just presence/absence
  • Waterproof variants available for outdoor and liquid-level applications
  • Excellent range for the price

Ultrasonic Sensor Limitations

  • Soft/angled surfaces: Sound-absorbing materials (foam, fabric, acoustic tiles) return weak echoes or none at all. Surfaces angled away from the sensor deflect the beam.
  • Temperature sensitivity: Speed of sound changes with temperature (~0.6 m/s per °C). For high accuracy in variable temperatures, compensate using a temperature sensor.
  • Minimum distance: Cannot measure objects closer than ~2 cm reliably (the echo overlaps the pulse).
  • Slow update rate: ~60 ms per measurement limits use in fast-moving applications.
A86 JSN-SR04T Waterproof Ultrasonic Rangefinder Module

A86 JSN-SR04T Waterproof Ultrasonic Rangefinder Module Version 3.0

IP67-rated waterproof ultrasonic sensor — ideal for water tank level monitoring, outdoor proximity detection, and harsh-environment distance measurement.

View on Zbotic

4. Capacitive Proximity Sensors

How Capacitive Sensing Works

Capacitive sensors detect objects by measuring changes in an electric field. Any material — water, plastic, metal, human skin, wood, or food — that changes the capacitance of the sensing element is detectable. This makes capacitive sensors uniquely able to detect objects through non-conductive barriers (like a plastic container wall).

In maker projects, capacitive sensing shows up in:

  • Touch buttons and sliders
  • Liquid level sensing through tank walls
  • Soil moisture measurement (capacitive soil sensors)
  • Human presence detection for touchless interfaces

Capacitive Sensor Specifications

  • Range: 0–20 mm (industrial), 0–10 mm (maker modules)
  • Materials detected: Almost everything (metals, liquids, organics, plastics)
  • Output: Digital (threshold) or analog (capacitance value)
  • Speed: Very fast (<1 ms)
  • Power: Very low (microamps for some types)

Capacitive Sensor Limitations

  • Short range: Industrial capacitive sensors detect objects at only a few millimetres distance.
  • Interference: Humidity and temperature changes affect capacitance readings. Metal objects near the sensor can create false detections.
  • Not suitable for long-range detection.
Capacitive Soil Moisture Sensor

Capacitive Soil Moisture Sensor

Uses capacitive sensing to measure soil dielectric constant — no corrosion, no electrolysis. Detects moisture through the soil medium without direct contact with water.

View on Zbotic

5. PIR Motion Sensors: A Special Case

PIR (Passive Infrared) sensors are often grouped with proximity sensors but work quite differently. Rather than emitting any signal, they passively detect changes in infrared radiation emitted by warm bodies (humans, animals). A PIR sensor does NOT measure distance — it detects the change in heat pattern across its field of view when a person moves through it.

Key PIR Characteristics

  • Detection range: 5–10 metres (typical for modules), adjustable on most modules
  • Field of view: 110° typical (lens-dependent)
  • Output: Digital HIGH when motion detected
  • Power: Very low (milliamps)
  • Limitations: Cannot detect stationary people; pets may trigger false alarms; detection zone has blind spots close to sensor

PIR sensors are the right choice for room occupancy detection, automatic lighting, and security systems. They are the wrong choice if you need to detect non-moving objects or measure exact distances.

B2X2 4 Elements Infrared Motion Analog PIR sensor

B2X2 4 Elements Infrared Motion Analog PIR Sensor for Lighting

4-element dual-axis PIR sensor with analog output — reduces false triggers by requiring motion across both sensing zones. Ideal for directional detection in corridors.

View on Zbotic

6. LiDAR: High-Precision Proximity

LiDAR (Light Detection and Ranging) uses pulsed laser light and time-of-flight measurement to determine distance with very high precision. Unlike ultrasonic sensors, LiDAR can detect objects at very high speed, over long ranges, with millimetre accuracy.

Consumer LiDAR modules like the TF-Luna, TFmini, or Benewake AD2-S-X3 bring this technology to maker-level projects. They communicate via UART or I2C and provide distance measurements up to 8–250 metres depending on the model.

LiDAR vs Ultrasonic

  • LiDAR: faster (up to 1000 Hz), more accurate (±3 mm), longer range, works better on angled surfaces, but costs more and can be affected by transparent surfaces and strong ambient light.
  • Ultrasonic: cheaper, works in fog/dust/some reflective scenarios LiDAR cannot handle, minimum range >2 cm, slower.
Benewake AD2-S-X3 High-Performance Automotive-Grade LiDAR

Benewake AD2-S-X3 High-Performance Automotive-Grade LiDAR

Automotive-grade 3D LiDAR for autonomous driving and advanced robotics — extremely precise 3D mapping at high update rates, far beyond what ultrasonic or IR can achieve.

View on Zbotic

7. Side-by-Side Comparison Table

Feature IR Ultrasonic Capacitive PIR LiDAR
Range 2–30 cm 2–400 cm 0–20 mm 5–10 m 0.1–250 m
Measures Distance? No (basic) Yes No No Yes
Works Outdoors? Poor Yes Yes Yes Yes
Surface Dependent? High Low None None Medium
Typical Cost (India) ₹20–150 ₹60–500 ₹80–300 ₹50–400 ₹1,500+
Best Use Case Indoor, close range Distance/level Touch/liquid Human presence Robotics/auto

8. How to Choose the Right Proximity Sensor

Use this decision tree to pick the right technology:

  1. Do you need to detect humans/animals specifically? → PIR sensor.
  2. Do you need distance measurement up to 4 metres, on solid objects, in any lighting? → Ultrasonic (HC-SR04 or JSN-SR04T for waterproof).
  3. Do you need distance measurement with high accuracy and speed, budget allows? → LiDAR.
  4. Do you need to detect liquid level, soil moisture, or objects through a non-conductive barrier? → Capacitive sensor.
  5. Indoor only, close range (<20 cm), cost-sensitive? → IR sensor.

9. Arduino Code Examples

Ultrasonic HC-SR04 Distance Measurement

#define TRIG_PIN 9
#define ECHO_PIN 10

void setup() {
  Serial.begin(9600);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
}

float getDistanceCm() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  long duration = pulseIn(ECHO_PIN, HIGH, 30000);
  if (duration == 0) return -1; // timeout = out of range
  return (duration / 2.0) / 29.1;
}

void loop() {
  float dist = getDistanceCm();
  if (dist < 0) {
    Serial.println("Out of range");
  } else {
    Serial.print("Distance: ");
    Serial.print(dist);
    Serial.println(" cm");
  }
  delay(100);
}

PIR Motion Detection

#define PIR_PIN 2
#define LED_PIN 13

void setup() {
  Serial.begin(9600);
  pinMode(PIR_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  delay(30000); // PIR warm-up time (important!)
  Serial.println("PIR ready");
}

void loop() {
  int motion = digitalRead(PIR_PIN);
  if (motion == HIGH) {
    digitalWrite(LED_PIN, HIGH);
    Serial.println("Motion detected!");
  } else {
    digitalWrite(LED_PIN, LOW);
  }
  delay(100);
}

10. Project Ideas by Sensor Type

IR Sensor Projects

  • Line-following robot (TCRT5000 array)
  • Automatic coin counter
  • Touchless hand sanitizer dispenser
  • Visitor counter for shops

Ultrasonic Sensor Projects

  • Water tank level monitor with SMS alert
  • Obstacle-avoiding robot
  • Parking distance sensor
  • Blind stick distance warning system

PIR Sensor Projects

  • Automatic corridor light
  • Home security alarm
  • Energy-saving monitor (turn off devices when room empty)
  • Wildlife camera trigger

Capacitive Sensor Projects

  • Smart plant watering system
  • Touchless elevator buttons
  • Liquid level in sealed tanks
  • Interactive music instrument

FAQ: Proximity Sensor Types

What is the difference between an IR proximity sensor and a PIR sensor?

An IR proximity sensor actively emits infrared light and detects reflection from objects — it can detect any object at close range. A PIR (Passive Infrared) sensor does not emit anything; it passively detects changes in heat (infrared radiation) emitted by warm bodies. PIR sensors only detect moving warm objects (humans, animals) at longer range but cannot detect static objects or measure distance.

Can an ultrasonic sensor detect water level?

Yes, ultrasonic sensors work very well for water level detection. Mount the sensor above the tank pointing downward. As water level rises, the distance decreases. The waterproof JSN-SR04T version is ideal as it can be mounted in humid or splashing environments. This is one of the most popular uses of ultrasonic sensors in Indian maker projects — overhead tank level monitors with mobile notifications.

Why does my IR sensor give false readings in sunlight?

Sunlight contains a broad spectrum of infrared radiation. If this ambient IR is strong enough, it saturates the IR photodetector even when no object is present, causing constant false detections. Solutions: use a sensor with modulated IR (like Sharp GP2Y series or TCRT5000 with modulated driver), add an IR filter lens, shade the sensor from direct sunlight, or switch to an ultrasonic sensor which is immune to light interference.

Which proximity sensor is best for a robot obstacle avoidance project?

For indoor robots, an HC-SR04 ultrasonic sensor provides reliable detection of most solid obstacles at 2–400 cm. For faster, more accurate robots, a TFmini or TF-Luna LiDAR is better (1000 Hz update rate, ±3mm accuracy). Many competition robots use both: ultrasonic for wide-angle detection and a LiDAR for precise forward distance. IR sensors are used for short-range cliff detection or line following but are unreliable for general obstacle avoidance.

Can a proximity sensor detect a person sitting still?

PIR sensors cannot detect a stationary person — they only respond to movement. For detecting a stationary person, you need an active sensor: ultrasonic (detects the body as a physical object), capacitive (detects the body’s electrical field changes), or a time-of-flight sensor. Some modern PIR modules combine PIR with radar for this purpose, but for simple Arduino projects, point an ultrasonic sensor at the chair/seat and check for a distance reading below a threshold.

Find the Right Proximity Sensor for Your Project

Understanding the difference between IR, ultrasonic, capacitive, and PIR proximity sensors is the key to building projects that actually work reliably. Stop guessing — pick the right technology for your specific application and your project will run smoothly from day one.

Zbotic stocks all major proximity sensor types for maker, student, and professional projects across India.

Shop Proximity Sensors at Zbotic

Tags: capacitive sensor, ir sensor, PIR sensor, Proximity Sensor, ultrasonic sensor
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
PCB Trace Width Calculator: Cu...
blog pcb trace width calculator current capacity and heat management 596682
blog bo motor vs tt motor vs n20 which for robot chassis 596687
BO Motor vs TT Motor vs N20: W...

Related posts

Svg%3E
Read more

Encoder Module: Position and Speed Measurement with Arduino

April 1, 2026 0
A rotary encoder converts the angular position and rotation speed of a shaft into electrical signals that Arduino can count... Continue reading
Svg%3E
Read more

Infrared Obstacle Sensor: Line Follower and Object Detection

April 1, 2026 0
Infrared obstacle sensors are the building blocks of line-following robots, edge detection systems, and proximity triggers. These tiny modules emit... Continue reading
Svg%3E
Read more

Rain Sensor and Raindrop Detection Module: Arduino Guide

April 1, 2026 0
A rain sensor module detects the presence of water droplets on its surface, giving Arduino a simple signal to trigger... Continue reading
Svg%3E
Read more

LiDAR Sensor TFmini: Distance Measurement Beyond Ultrasonic

April 1, 2026 0
When ultrasonic sensors hit their limits — range too short, accuracy too coarse, outdoor sunlight causing interference — LiDAR sensors... Continue reading
Svg%3E
Read more

Pressure Sensor BMP280: Weather Station and Altitude Meter

April 1, 2026 0
The BMP280 barometric pressure sensor by Bosch measures atmospheric pressure with ±1 hPa accuracy and temperature with ±1°C precision. These... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now