-24%
,

HC-SR04 Ultrasonic Distance Sensor Module

(9 customer reviews)
Availability:

In stock


– Accurate non-contact distance measurement from 2 cm to 400 cm
– High precision with up to 3 mm resolution
– Uses 40 kHz ultrasonic waves for reliable detection
– Easy 4-pin interface (VCC, Trig, Echo, GND); Arduino and Raspberry Pi compatible
– Fast response time (<10 ms) and low power consumption (15 mA)
– Compact, lightweight, and cost-effective for robotics, automation, and DIY projects

WhatsAppChat on WhatsApp

₨ 190 ₨ 250

In stock

HC-SR04 Ultrasonic Distance Sensor Module Overview

The HC-SR04 Ultrasonic Distance Sensor Module is a versatile, low-cost solution for accurate non-contact distance measurement. Using 40 kHz ultrasonic pulses, the module measures distances from 2 cm to 400 cm with a typical resolution of 3 mm. It is widely used in robotics, automation, security, and hobby electronics because of its simple four-pin interface and reliable performance.

Key Features

  • Wide measurement range: 2 cm to 400 cm (1 inch to 13 feet)
  • High resolution: up to 3 mm for precise readings
  • Fast response: typical response time under 10 milliseconds
  • Low power consumption: around 15 mA during operation
  • Simple 4-pin connection: VCC, Trig, Echo, GND for easy integration
  • Compact design: dimensions 45 mm x 20 mm x 15 mm for tight spaces
  • Durable construction: built with components for dependable operation

Technical Specifications

  • Operating voltage: 5 V DC
  • Working current: 15 mA
  • Measuring range: 2 cm to 400 cm
  • Resolution: 3 mm
  • Operating frequency: 40 kHz
  • Trigger input: 10 microsecond TTL pulse
  • Echo output: pulse width proportional to distance
  • Dimensions: 45 mm x 20 mm x 15 mm

Applications

  • Obstacle avoidance and distance sensing for robots
  • Proximity detection for security systems
  • Object detection in automation and industrial setups
  • Liquid level measurement in non-corrosive containers
  • Distance-measuring devices and DIY electronics projects

Wiring and Integration

The HC-SR04 uses four pins for a straightforward connection to most microcontrollers.

  • VCC: 5 V DC power supply
  • Trig: Trigger input (send a 10 microsecond pulse to start measurement)
  • Echo: Echo output (receive pulse width proportional to distance)
  • GND: Ground

Arduino Quick Start

  • Connect VCC to 5 V and GND to ground.
  • Connect Trig to a digital output (e.g., D9) and Echo to a digital input (e.g., D10).
  • Send a 10 microsecond HIGH pulse to Trig, then measure the pulse width on Echo to calculate distance: distance (cm) = pulseDuration / 58.

Raspberry Pi Quick Start

  • Use a 5 V power source for VCC, and connect GND to Pi ground.
  • Use a GPIO pin for Trig (output) and a GPIO pin for Echo (input). Because Echo can output 5 V, use a level shifter or voltage divider to protect Pi GPIOs.
  • Generate a 10 microsecond pulse on Trig and measure the Echo pulse width via timing routines to compute distance.

Tips and Best Practices

  • Mount the sensor on a stable surface to avoid false readings caused by vibration.
  • Avoid placing the sensor near soft, angled, or highly absorbent surfaces that can scatter or absorb ultrasonic waves.
  • For improved accuracy, average multiple readings and filter out outliers.
  • Use a level shifter when connecting Echo to 3.3 V microcontrollers like Raspberry Pi.

Why Choose the HC-SR04 Ultrasonic Distance Sensor

The HC-SR04 strikes an excellent balance between cost, accuracy, and ease of use. Its compact size and low power draw make it ideal for battery-powered projects and compact robotic platforms. Whether you are building a simple proximity alarm or an advanced autonomous robot, the HC-SR04 provides reliable distance sensing with minimal integration effort.

Note: Images are for illustration purposes only. Actual product may vary.

What power supply does the HC-SR04 need?

The module runs on 5 V DC and draws about 15 mA during operation, so a standard 5 V rail on your Arduino or a regulated 5 V supply is enough.

Keep these points in mind when you power it:

  • VCC goes to 5 V and GND to ground. Do not feed it 3.3 V and expect stable readings.
  • The Echo pin outputs a 5 V pulse. When you connect it to a 3.3 V board such as a Raspberry Pi, use a level shifter or a voltage divider.
  • Power the sensor from the same ground as your microcontroller so the trigger and echo signals share a reference.
  • If readings jump around, check the supply first. A weak USB port or a long, thin jumper wire can cause noise.

For a tidy build, mount the module on a stable base and keep the wiring short. You can pair it with a MB102 830 Tie Points Solderless Breadboard for quick testing before you solder anything.

How accurate is the HC-SR04 for high precision distance measurement?

The HC-SR04 gives a typical resolution of 3 mm over a range of 2 cm to 400 cm, which is good for obstacle avoidance, level sensing and student projects but not for millimetre-grade measurement.

What affects accuracy in practice:

  • Surface type: soft, angled or absorbent materials scatter the 40 kHz pulse and cause false or missing readings.
  • Mounting: vibration on a moving robot adds noise, so fix the sensor firmly.
  • Timing: send a clean 10 microsecond trigger pulse and measure the Echo width carefully.
  • Filtering: average several readings and discard outliers in your code.

For most school, college and university projects, this level of precision is more than enough. If you need help picking between sensor types, read how to choose the right sensor for your Arduino or ESP32 project.

What does the HC-SR04 cost and how is it delivered?

The HC-SR04 Ultrasonic Distance Sensor Module is priced at Rs. 190 and is in stock. Prices were checked in October 2026.

College Road Electronics is based on College Road, Rawalpindi, and ships nationwide across Pakistan at a flat-rate shipping charge of Rs 350. Students building school, college or university projects can also ask for parts and guidance.

Common add-ons for a first build:

Frequently Asked Questions

Is the HC-SR04 a 4-pin sensor?

Yes. The HC-SR04 has four pins: VCC, Trig, Echo and GND. VCC takes 5 V, Trig accepts a 10 microsecond pulse to start a reading, Echo outputs a pulse width proportional to distance, and GND is ground. This simple layout is why it works with Arduino, ESP32 and Raspberry Pi boards with little wiring.

Can I use the HC-SR04 with a Raspberry Pi without damaging it?

The Echo pin outputs 5 V, while Raspberry Pi GPIO pins are 3.3 V. Use a level shifter or a simple voltage divider on the Echo line before it reaches the Pi. Power VCC from a 5 V source, share ground with the Pi, and trigger readings from a GPIO output pin.

What is the measuring range of the HC-SR04?

It measures from 2 cm to 400 cm, roughly 1 inch to 13 feet, using 40 kHz ultrasonic pulses. Readings closer than 2 cm or beyond 400 cm are not reliable. The typical resolution is 3 mm, and the response time is under 10 milliseconds, which suits robots and proximity alarms.

How much does the HC-SR04 cost in Pakistan?

The HC-SR04 Ultrasonic Distance Sensor Module is priced at Rs. 190 and is in stock at College Road Electronics. Prices were checked in October 2026. Delivery is nationwide across Pakistan at a flat-rate shipping charge of Rs 350, and students can ask for help choosing parts for their projects.

Why does my HC-SR04 give random or zero readings?

Common causes are a weak 5 V supply, loose jumper wires, a shared ground missing between sensor and board, or a soft or angled target that scatters the pulse. Mount the sensor firmly, keep wiring short, average several readings in code, and filter out outliers before using the value.

9 reviews for HC-SR04 Ultrasonic Distance Sensor Module

  1. Raheel Qamar (verified owner) –

    Raheel Qamar –

  2. Muhammad Awais (verified owner) –

    Muhammad Awais –

  3. Abdul Momin (verified owner) –

    Abdul Momin –

  4. Afaq (verified owner) –

    Afaq –

  5. Umar K. (verified owner) –

    The prices are reasonable, the customer service feels truly luxurious, and the staff is always well-mannered. The products are high quality, making the overall experience excellent.

    Umar K. –

  6. Ahsan Sajjad (verified owner) –

    Ahsan Sajjad –

  7. Tushar (verified owner) –

    Tushar –

  8. Hussain Hussain (verified owner) –

    Hussain Hussain –

  9. Hannan (verified owner) –

    Hannan –

Only logged in customers who have purchased this product may leave a review.

Vendor Information

  • Store Name: College Road Electronics
  • Vendor: College Road Electronics
  • Address: Microwave Electronics, Basement Azhar Shaheed Plaza, DAV College Road
    Rawalpindi
    Punjab
    46000
  • 4.81 rating from 608 reviews
0
0
Your Cart
Your cart is emptyReturn to Shop