HC-SR04 Ultrasonic Distance Sensor Module – Sensor for Arduino & distance detection -HC SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Distance Sensor Module – Sensor for Arduino & distance detection -HC SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Distance Sensor Module – Sensor for Arduino & distance detection -HC SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Distance Sensor Module – Sensor for Arduino & distance detection -HC SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Distance Sensor Module – Sensor for Arduino & distance detection -HC SR04 Ultrasonic Sensor
s

Robocraze BEST PRICE GUARANTEED

HC-SR04 Ultrasonic Sensor Module | Buy Online at Robocraze

HC-SR04 Ultrasonic Distance Sensor Module

Rs 75/-
- 40%
Rs 75/-
Rs 124/-
Save Rs 49/-
Incl. GST (No Hidden Charges)
Please hurry! Only 551 left in stock

Why Buy From Robocraze

Free Delivery Above ₹999

Technical Support & Easy Returns

Same-Day Shipping (Order by 3 PM on Business Days)

Earn RC Coins on Every Prepaid Order

COD Available on Order Value Between ₹500 to ₹3,000

SKU: TIFSS0171
  • Non-Contact Distance Sensor: HC-SR04 Ultrasonic Range Finder measures 2–400cm and is suitable for various applications, making it the best distance measuring sensor 2cm to 400cm
  • Endless Possibilities: Uses sonar technology for accurate readings, ideal as an ultrasonic sensor module for robotics and IoT
  • Compact and Reliable: HC-SR04 features a small blind distance and provides stable performance
  • Durable Build: Made with high-quality materials, suitable for indoor and outdoor use
  • User-Friendly: Easy to install, perfect ultrasonic distance sensor for Arduino projects and beginners
Robocraze Academy Limited Time Offer
HC-SR04 Ultrasonic Distance Sensor Module
HC-SR04 Ultrasonic Distance Sensor Module
Rs 124/- Rs 75/-

HC-SR04 Ultrasonic Distance Sensor Module

Rs 124/- Rs 75/-
📄
Quick Decision
  • Best for Distance Sensing
  • Low Cost
  • Easy Use
  • Small Size
✔️
Benefits
  • 2cm to 400cm
  • 5V Operation
  • Fast Response
  • Simple Output
⚖️
Pros & Cons
  • Cheap Sensor
  • Easy Wiring
  • Accurate Range
  • Needs 5V
🎯
Use Cases
  • Obstacle Detection
  • Distance Measurement
  • Robotics
  • Automation

HC-SR04 Ultrasonic Sensor

The HC-SR04 Ultrasonic Sensor Module is a popular tool for measuring distance and detecting objects. It’s small, easy to use, and combines everything you need: a transmitter, receiver, and control circuit in one module. It works like a sonar, sending out sound waves to measure the distance to objects, just like how bats and dolphins sense their surroundings. This makes it an ideal ultrasonic sensor module for robotics and IoT applications where accuracy and reliability are essential.

This HC-SR04-Ultrasonic Range Finder can measure distances from 2 cm up to 400 cm with high accuracy, about 3 mm, making it the best distance measuring sensor 2cm to 400cm for both beginners and professionals. It’s reliable for many projects, from robotics to simple object detection, and works well even in different lighting conditions.

This HC SR04 ultrasonic distance sensor module has two main pins, Trigger and Echo, which connect easily to microcontrollers like Arduino, making it perfect as an ultrasonic distance sensor for Arduino projects where non-contact distance sensing is required. Understanding the HC-SR04 ultrasonic sensor working and pinout is simple, making it a go-to choice for students and developers.


Check out the best selection of Distance Sensors.

Note: The HC-SR04 sensor has a 5V output (which needs to be reduced to 3.3V to work with the Raspberry Pi).

Read our blog on how to connect ultrasonic sensor to Raspberry Pi.

Looking for the Best Price for the HC SR 04 Ultrasonic Sensor Online?

At Robocraze, the HC-SR04 ultrasonic sensor price in India starts at ₹69, and may vary based on ongoing offers, stock availability, and bundled deals. We ensure high-quality, performance-tested modules that meet reliable accuracy standards for robotics, automation, and IoT applications.

Unlike low-grade alternatives in the market, our HC-SR04 sensors undergo quality checks to deliver stable distance measurements and consistent trigger/echo response. With competitive HC-SR04 ultrasonic sensor price in India, genuine components, and technical support, Robocraze provides better value compared to many generic sellers online.

Features:

  • Non-Contact Distance Sensor
  • Measures 2cm to 400cm
  • Sonar technology for accuracy
  • Suitable for robotics and DIY projects, including ultrasonic sensor module for robotics and IoT
  • Stable performance indoors and outdoors
  • Durable materials
  • Easy to install, user-friendly
  • 5V DC power supply
  • High resolution: 0.3 cm
  • Best ultrasonic sensor for Arduino and Raspberry Pi projects, ideal for ultrasonic distance sensor for Arduino projects

Applications:

  • Used to avoid and detect obstacles with robots like biped robots, obstacle avoider robots, path-finding robots, etc.
  • Used to measure the distance within a wide range of 2cm to 400cm
  • Can be used to map the objects surrounding the sensor by rotating it
  • The depth of certain places like wells, pits, etc. can be measured since the waves can penetrate through the water
  • Its wide measuring range makes it the best distance measuring sensor 2cm to 400cm for real-world applications.

Read our blog explaining the ultrasonic sensor working.

Working & Pinout Explanation:

Understanding the HC-SR04 ultrasonic sensor working and pinout is essential for integrating it into your projects. The module operates using two main pins:

  • Trigger Pin: Sends ultrasonic pulses
  • Echo Pin: Receives reflected signals

The sensor calculates distance based on the time taken for the sound waves to return. This simple mechanism makes it highly effective for automation, robotics, and obstacle detection systems. Its easy interface is one reason why it is widely used as an ultrasonic distance sensor for Arduino projects.

Important Note for ESP32 & 3.3V Microcontrollers: The HC-SR04 operates at 5V. If you are interfacing it with a 3.3V logic board like the ESP32, you must use a voltage divider (e.g., 1kΩ and 2kΩ resistors) or a logic level shifter on the Echo pin to prevent damaging your microcontroller. The Trigger pin can be driven directly by 3.3V.

Pinout

HC-SR04 Ultrasonic Distance Sensor Module Pinout

Wiring Diagram:

Wiring Diagram

HC SR 04 Ultrasonic Sensor Specifications Comparison:

Parameter HC-SR04 Ultrasonic Sensor (Robocraze) Typical Low-Grade Alternative
Operating Voltage 5V DC 5V DC
Operating Current 15mA 15–20mA
Measuring Range 2cm – 400cm 3cm – 300cm
Measuring Angle < 15° 15–20°
Accuracy ±3mm ±5mm or higher
Frequency 40 kHz 40 kHz
Build Quality Quality-tested PCB with stable soldering Inconsistent soldering quality
Performance Stability Reliable echo response and stable readings Possible signal noise and unstable readings

HC-SR04 vs Waterproof JSN-SR04T vs IR Sensor: Which to Choose?

Choosing the right distance or obstacle detection sensor depends entirely on your project’s environment and range requirements. Here is a quick breakdown to help you decide:

Feature HC-SR04 Ultrasonic Sensor JSN-SR04T Waterproof Sensor IR (Infrared) Sensor
Best Environment Indoor, dry, controlled settings Outdoor, wet, dusty, or humid conditions Indoor, controlled lighting
Typical Range 2 cm – 400 cm 25 cm – 450 cm 2 cm – 30 cm (varies by model)
Sunlight Interference None (uses 40kHz sound waves) None (uses sound waves) High (struggles in direct sunlight)
Ideal Use Cases Arduino distance code, indoor obstacle avoiding robot, general measurement Water level detection, outdoor robotics, agricultural automation Line-following robots, edge detection, short-range proximity

1. HC-SR04 Ultrasonic Sensor (The All-Rounder)

This is the most popular choice for students, hobbyists, and general robotics. It offers an excellent balance of price, accuracy (±3mm), and a wide 2–400cm range. Choose this if your project is indoors or in a dry environment and you need a reliable, non-contact ultrasonic distance sensor.

2. Waterproof JSN-SR04T (The Outdoor Specialist)

If your project involves water, rain, or heavy dust, the standard HC-SR04 will eventually fail. The JSN-SR04T Waterproof Ultrasonic Sensor features a sealed, potting-compound transducer that can be exposed to the elements. Choose this if you are building outdoor robots or water tank level indicators.

3. IR Sensors (The Short-Range Specialist)

Infrared sensors (like the TCRT5000 or E18-D80NK) are excellent for very short-range detection. However, they are easily blinded by direct sunlight and struggle to detect black or highly transparent surfaces. Choose this if you need ultra-fast, short-range detection for line-maze robots.

Common Problems: Why is My HC-SR04 Reading 0 or Max Distance?

The HC-SR04 is a highly reliable module, but like any electronic component, it can occasionally give erratic readings. If your Arduino distance code is returning 0 cm or constantly maxing out, don't panic. Here is how to troubleshoot the most common issues.

Problem 1: The Sensor Constantly Reads "0 cm"

A reading of exactly zero usually means the sensor sent the trigger pulse but never received a valid echo back, or the object is inside the sensor's "blind zone".

  • Object is too close: The HC-SR04 has a minimum blind distance of about 2 cm. Move the object further away.
  • Sound-absorbing materials: Soft fabrics, foam, or angled surfaces absorb or deflect the 40kHz sound waves. Ensure the target is a hard, flat surface positioned perpendicular to the sensor.
  • Echo pin wiring issue: Double-check that the Echo pin is securely connected to the correct digital pin on your microcontroller.

Problem 2: The Sensor Reads "Max Distance" or Times Out

If your serial monitor outputs a massive number (or 0, depending on how your pulseIn() timeout is coded), it means the sensor is waiting for an echo that never arrives, or there is a hardware fault.

  • Out of range: Ensure the object is strictly within the 2 cm to 400 cm measuring range.
  • Loose connections: Vibration in robotics projects (like an obstacle avoiding robot) can easily loosen jumper wires. Reseat your Trig, Echo, VCC, and GND pins.
  • Power starvation: The HC-SR04 requires a stable 5V. If it's sharing a power rail with heavy motors, voltage drops can cause the sensor to freeze or fail.
💡 Hardware Pro Tip: If you are still getting random max-distance errors, add a 10µF to 100µF electrolytic capacitor directly across the VCC and GND pins on the back of the sensor. This stabilizes the power supply during the high-current ultrasonic burst and eliminates 90% of erratic readings!

What's in the Box:

  • 1 x HC-SR04 Ultrasonic Distance Sensor Module

Please note: This package contains the sensor module only. Jumper wires are not included. Need wires for your setup? Add a Jumper Wire Set (M2M, M2F, F2F) to your order!

Specifications:

Power Supply+5V DC
Working Current15mA
Output SignalElectrical frequency signal
Ranging Distance2cms – 400 cms
Resolution0.3 cm
Measuring Angle15°
Accuracy±3 mm
Dimensions 3 x 2 x 1cms
Weight 15 grams

Arduino Code:


const int trigPin = 9;
const int echoPin = 10;

long duration;
float distance;

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);

  distance = duration * 0.0343 / 2;

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  delay(500);
}

1. How does ultrasonic sensor work?

As we connect the ultrasonic sensor to 5V and initialize the input pin, it starts transmitting the sound waves which then travel through the air and hit the required object. These waves hit and bounce back from the object and are then collected by the receiver of the module. Distance is directly proportional to the time these waves require to return to the receiving end. The more the time taken, the greater the distance will be. This explains the HC-SR04 ultrasonic sensor working and pinout, which is widely used for accurate distance measurement.

2. Is ultrasonic sensor better or IR sensor for my project?

Choosing a sensor is completely dependent on your application. There are a lot of limitations in infrared sensors, like the inability to use them in sunlight due to interference. It can make outdoor or dark indoor applications difficult. Ultrasonic sensors work using sound waves, and obstacle detection is not affected by as many environmental factors. If reliability is important, ultrasonic sensors are more dependable, especially in applications like ultrasonic sensor module for robotics and IoT projects.

3. What is the basic principle of ultrasonic sensor?

Ultrasonic sensors rely on the principles of echolocation to measure distances and detect objects. They generate ultrasonic waves that bounce off objects and return as echoes. This data is used to calculate distance by measuring the time between transmission and reception. Understanding this principle helps in learning the HC-SR04 ultrasonic sensor working and pinout, which is essential for accurate implementation. These sensors are widely used across industries due to their precision and compact design.

4. What is ultrasonic sensor used for?

Ultrasonic sensors are used for detecting object proximity and measuring distances in various applications. They are commonly used in industrial automation, robotics, and smart systems. These sensors are ideal as an ultrasonic distance sensor for Arduino projects, helping developers build obstacle detection systems, smart parking solutions, and automation setups.

5. Is HC-SR04 analog or digital?

The HC-SR04 is a well-known ultrasonic sensor used in various electronic projects. It operates by transmitting high-frequency sound waves and measuring the time taken for the echo to return. This enables accurate distance calculation, making it the best distance measuring sensor 2cm to 400cm for many DIY and professional applications. Its output is pulse width modulated (PWM), which can be interpreted as either analog or digital depending on usage.

6. Is the HC SR 04 Ultrasonic Sensor Original and Genuine?

Yes. The HC SR 04 Ultrasonic Sensor available at Robocraze is sourced from verified manufacturers and trusted suppliers to ensure originality and consistent performance. Each unit is quality-tested for accurate distance measurement (2cm–400cm range) and stable signal response. With a competitive HC-SR04 ultrasonic sensor price in India, we ensure reliable performance for robotics, Arduino, Raspberry Pi, and automation projects.

7. What is the maximum reliable range of the HC-SR04?

Officially rated 2-400cm, but for stable, repeatable readings in Arduino projects we recommend staying within 2-250cm.

8. Does the HC-SR04 work with a 3.3V ESP32?

Yes, but you must take a crucial precaution. The HC-SR04 operates at 5V. While the ESP32 can successfully send a 3.3V signal to the sensor’s Trigger pin, the sensor’s Echo pin will output a 5V signal back. Sending 5V directly into an ESP32 GPIO pin can permanently damage the microcontroller.
The Solution: Use a simple voltage divider (two resistors, e.g., 1kΩ and 2kΩ) or a dedicated logic level shifter on the Echo pin to safely step the 5V signal down to 3.3V before it reaches the ESP32.

9. How accurate is an ultrasonic sensor?

Under ideal conditions, the HC-SR04 ultrasonic distance sensor offers a high accuracy of ±3mm. However, real-world accuracy depends on a few key factors:

  • Target Surface: Hard, flat surfaces positioned perpendicular to the sensor yield the most accurate results. Soft materials (like cloth or foam) absorb the 40kHz sound waves, while angled surfaces deflect them, causing false or max-distance readings.
  • Environment: Extreme temperatures or high humidity can slightly alter the speed of sound, though this is negligible for most standard Arduino, Raspberry Pi, and robotics projects.

10. HC-SR04 vs IR Sensor: Which is better for obstacle detection?

For most general-purpose obstacle avoiding robots, the HC-SR04 ultrasonic sensor is the better choice. Here is why:

  • Lighting Independence: Ultrasonic sensors use sound waves, meaning they work flawlessly in pitch darkness or bright, direct sunlight. IR sensors are easily blinded by strong ambient light.
  • Object Recognition: The HC-SR04 can reliably detect transparent objects (like glass) and dark-colored objects, which IR sensors often fail to see.
  • Range: The HC-SR04 offers a much wider detection range (2cm to 400cm) compared to typical IR sensors (usually 2cm to 30cm).
  • When to choose IR: Only choose an IR sensor if your project requires ultra-fast response times for very short-range detection, such as line-following robots or drop-off edge detection.

Shipping Policy

  • Free Delivery on all Orders Above Rs 999/-
  • All orders confirmed before 3:00 PM IST are shipped the same day, barring rare pickup delays on holidays or disturbances.
  • Delivery time in Metro cities is 1–3 days; for other locations, it is 3–7 days. Delivery varies based on location and courier service.

Return & Refund Policy

  • Return window: 7 days from receipt unless stated otherwise.
  • No refunds or replacements after the return window.
  • Returns are accepted only for non-working or damaged products.
  • Initiate return requests via a Support ticket or contact us at +91-8123057137.
  • Refunds are processed within 3–4 working days after inspection and approval.

Recently Viewed Products