In stock HC-SR04 Ultrasonic Distance Sensor Module
HC-SR04 Ultrasonic Distance Sensor Module view 2

Distance Proximity

HC-SR04 Ultrasonic Distance Sensor Module

Non-contact ultrasonic ranging sensor measuring 2-400cm, the most common distance sensor for robotics.

₹75 + 18% GST

SKU: BOTBIT-SEN-06 · Best for: Obstacle avoidance for mobile and wheeled robots

Overview

About HC-SR04 Ultrasonic Distance Sensor Module.

The HC-SR04 is a non-contact ultrasonic distance sensor and the most common ranging sensor in hobby robotics. It measures distance by emitting a 40 kHz ultrasonic burst and timing the echo that bounces back from an object, working reliably from about 2 cm up to 400 cm.

It is popular because it is cheap, easy to use with just two logic pins (Trigger and Echo), and works with virtually every microcontroller. You send a short pulse on Trigger, the sensor sends out eight ultrasonic pulses, and the width of the returned Echo pulse tells you how far away the object is.

For Indian students and makers building obstacle-avoiding robots, parking sensors and water-level monitors, the HC-SR04 is the default distance sensor. It is well documented, supported by libraries like NewPing, and forms part of almost every beginner robotics kit.

Key features

Why it stands out.

Non-contact ultrasonic ranging from 2 cm to 400 cm

Simple Trigger/Echo interface, works with any microcontroller

40 kHz ultrasonic operation with about 3 mm resolution

Effective measuring angle around 15 degrees for focused detection

Runs on 5V with low standby current, easy to power from Arduino

Widely supported (NewPing and similar libraries) with countless tutorials

Specifications

Selection facts.

Sensor TypeUltrasonic (40 kHz) time-of-flight distance
Measuring Range2 cm to 400 cm
Resolution~0.3 cm (3 mm)
Measuring Angle~15 degrees
Operating Voltage5V DC
Operating Current~15 mA
Trigger Signal10 us TTL pulse
Interface4-pin: VCC, Trig, Echo, GND
Frequency40 kHz
Dimensions45 x 20 x 15 mm

Applications

Where it is used.

Buying guide

How to choose.

Choose the HC-SR04 as your default distance sensor for robotics and beginner projects: obstacle avoidance, parking sensors, level monitoring and counting. It is inexpensive, universally supported and reliable for solid, flat targets in the 2-400 cm range.

Note the Echo pin outputs 5V; when using a 3.3V board like an ESP32 or Raspberry Pi, use a voltage divider or a 3.3V-tolerant variant (such as the HC-SR04P) on the Echo line to protect the input. For narrow beams or tiny targets, or for use in tight spaces, consider infrared or laser time-of-flight sensors (like the VL53L0X) instead.

Pair it with an Arduino, ESP32 or Raspberry Pi and the NewPing library for clean, non-blocking readings. It works well alongside motor drivers in obstacle-avoiding robot builds.

FAQ

Common questions.

How does the HC-SR04 measure distance?

You send a 10 microsecond pulse to the Trigger pin. The sensor emits eight 40 kHz ultrasonic pulses and raises the Echo pin high for a time proportional to the round-trip. Distance in cm equals the Echo high time in microseconds divided by 58 (using the speed of sound).

How do I wire it, and is 3.3V safe?

It has 4 pins: VCC (5V), Trig, Echo and GND. Trig connects to a digital output and Echo to a digital input. The Echo pin outputs 5V, so on 3.3V boards use a voltage divider on Echo or a 3.3V-tolerant HC-SR04P.

Which library should I use?

The NewPing library is the most popular for Arduino because it is efficient and reduces timing problems. You can also read it with plain pulseIn() in a few lines of code.

What is its range and accuracy?

It measures roughly 2 cm to 400 cm with about 3 mm resolution and a 15-degree beam. Accuracy is best on flat, hard, perpendicular surfaces; soft or angled objects can weaken the echo.

Is it available in India and what is in the box?

Yes, it is one of the most widely stocked sensors in India and part of most robotics kits. You receive one HC-SR04 module; jumper wires and any level-shifting components are usually separate.

More in Sensors & Modules

Related hardware.

You may also need

Pairs well with.

In stock Arduino Uno R3

Arduino Boards

Arduino Uno R3

The classic ATmega328P 8-bit microcontroller board, a popular beginner prototyping platform with 14 digital and 6 analog I/O pins.

₹799 + 18% GST