Non-contact ultrasonic ranging from 2 cm to 400 cm

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.
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 Type | Ultrasonic (40 kHz) time-of-flight distance |
|---|---|
| Measuring Range | 2 cm to 400 cm |
| Resolution | ~0.3 cm (3 mm) |
| Measuring Angle | ~15 degrees |
| Operating Voltage | 5V DC |
| Operating Current | ~15 mA |
| Trigger Signal | 10 us TTL pulse |
| Interface | 4-pin: VCC, Trig, Echo, GND |
| Frequency | 40 kHz |
| Dimensions | 45 x 20 x 15 mm |
Applications
Where it is used.
- Obstacle avoidance for mobile and wheeled robots
- Car reverse/parking distance sensors
- Water-tank and liquid-level monitoring
- Automatic touchless dispensers and counters
- Proximity and presence detection
- Robotics and Arduino learning projects and kits
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.
Distance Proximity
VL53L0X Time-of-Flight (ToF) Laser Ranging Sensor Module
Laser ToF sensor giving accurate short-range distance up to 2m over I2C, immune to target colour/reflectance.
₹126 + 18% GST
Distance Proximity
IR Infrared Obstacle Avoidance Sensor Module
IR transmitter-receiver module with adjustable range giving digital output on obstacle detection, used in line-following robots.
₹45 + 18% GST
Environment
DHT11 Digital Temperature and Humidity Sensor Module
Low-cost single-wire digital temperature (0-50C) and humidity (20-90% RH) sensor, the default beginner Arduino sensor.
₹60 + 18% GST
Environment
DHT22 / AM2302 Temperature and Humidity Sensor Module
Higher-accuracy digital temperature (-40 to 80C) and humidity (0-100% RH) sensor, upgrade over DHT11.
₹199 + 18% GST
You may also need
Pairs well with.
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
Breadboards Jumpers
MB102 830 Points Solderless Breadboard
Full-size 830 tie-point solderless prototyping breadboard with power rails, accepts 20-29 AWG wire.
₹90 + 18% GST