Shop Logo
Search your product from here
Product image
 - Thumbnail 1
 - Thumbnail 2
 - Thumbnail 3
 - Thumbnail 4
 - Thumbnail 5
 - Thumbnail 6
1 / 6

Ultrasonic Sensor HC-SR04

5.0(1 review)
SKU: ME-294
JD1.90JD2.50

The HC-SR04 Ultrasonic Sensor is a versatile and reliable distance measurement module that uses 40kHz ultrasonic sound waves to detect objects from 2cm to 400cm with ±3mm accuracy. Operating at 5V DC with a simple 4-pin interface (VCC, GND, TRIG, ECHO), it integrates seamlessly with Arduino, Raspberry Pi, ESP32, and other microcontrollers. Ideal for robotics, obstacle avoidance, parking sensors, object detection, and DIY electronics, this lightweight module is one of the most popular distance sensors among hobbyists worldwide.

حساس الموجات فوق الصوتية HC-SR04 هو وحدة قياس مسافة متعددة الاستخدامات وموثوقة، تستخدم موجات صوتية بتردد 40 كيلوهرتز لاكتشاف الأجسام من 2 إلى 400 سم بدقة ±3 ملم. تعمل بجهد 5 فولت DC وتتميز بواجهة بسيطة من 4 أرجل (VCC، GND، TRIG، ECHO)، وتتكامل بسلاسة مع Arduino و Raspberry Pi و ESP32 والمتحكمات الدقيقة. مثالية لـ الروبوتات، وتجنب العوائق، وحساسات ركن السيارات، وكشف الأجسام، ومشاريع الإلكترونيات DIY، وهي من أكثر حساسات المسافة شعبية بين الهواة حول العالم.

Proximity & Distance Sensors

The HC-SR04 Ultrasonic Sensor Module is one of the most popular and widely used distance measurement sensors in the maker, robotics, and embedded electronics communities. It provides non-contact distance measurement using the principle of ultrasonic sound wave reflection, similar to how bats and submarines navigate using sonar.

The module consists of two main components: an ultrasonic transmitter that emits 40kHz sound pulses, and a receiver that detects the echoes reflected from nearby objects. By measuring the time elapsed between transmission and reception and applying the speed of sound (~343 m/s), the module calculates the precise distance to the target. The formula used is simple: Distance (cm) = (Echo Time in µs) / 58.

The HC-SR04 features a straightforward 4-pin interface (VCC, GND, TRIG, ECHO) that connects effortlessly to any microcontroller. To trigger a measurement, the user sends a 10µs HIGH pulse on the TRIG pin, after which the module emits 8 ultrasonic bursts at 40kHz and outputs a HIGH pulse on the ECHO pin with a duration proportional to the distance. This pulse can be measured using the pulseIn() function in Arduino, the gpio library on Raspberry Pi, or any timer-input capability on other MCUs.

With a measurement range of 2cm to 400cm and an accuracy of ±3mm, the HC-SR04 is suitable for a wide variety of applications — from simple obstacle avoidance in robots to water level monitoring in IoT systems. The module is lightweight, low-power, and affordable, making it an essential component for hobbyists, students, and engineers alike.

The HC-SR04 is fully supported by popular Arduino libraries such as NewPing and Ultrasonic.h, which simplify integration and allow for non-blocking measurements in complex projects. It is also compatible with ESP32, ESP8266, STM32, PIC, AVR, Raspberry Pi, and any platform with timer or pulse-measuring capability.

 

How It Works

  1. Trigger: Send a 10µs HIGH pulse to the TRIG pin
  2. Transmit: Module emits 8 ultrasonic pulses at 40kHz
  3. Receive: Module waits for the echo to return
  4. Echo Output: ECHO pin goes HIGH for a duration proportional to the round-trip time
  5. Calculate Distance: Distance (cm) = (Echo Time µs) × 0.0343 / 2

 

Specifications

  • Sensor Model: HC-SR04
  • Operating Voltage: 5V DC
  • Operating Current: ~15 mA
  • Quiescent Current: <2 mA
  • Working Frequency: 40 kHz
  • Measuring Range: 2 cm – 400 cm (0.78" – 13 ft)
  • Resolution: 0.3 cm
  • Accuracy: ±3 mm
  • Measuring Angle: ~15° (effective beam angle)
  • Trigger Input Pulse Width: 10 µs (minimum)
  • Echo Output Signal: Pulse-width proportional to distance
  • Number of Pins: 4 (VCC, GND, TRIG, ECHO)
  • Module Dimensions: 45 × 20 × 15 mm
  • Weight: ~9 g
  • Operating Temperature: -15°C to +70°C
  • Compliance: RoHS Compliant

 

Pinout

  • Pin 1 (VCC): +5V Power Supply
  • Pin 2 (TRIG): Trigger Input (10µs pulse to start measurement)
  • Pin 3 (ECHO): Echo Output (pulse width = distance)
  • Pin 4 (GND): Ground

 

Applications

  • Mobile Robotics — obstacle detection and avoidance for autonomous robots
  • Parking Assist Sensors — proximity warning systems for vehicles
  • Object Detection & Tracking — automated counting and presence detection
  • Range-Finding Devices — DIY tape-measure replacements
  • Autonomous Mobile Robots (AMR) — SLAM, navigation, and mapping
  • Smart Home Automation — proximity-triggered lights and devices
  • Liquid Level Monitoring — water tanks, reservoirs, and aquariums
  • Drone Altitude Control — short-range terrain following
  • Educational & STEM Projects — teaching ultrasonic principles and timing
  • Door & Gate Sensors — automated opening based on proximity
  • Security & Alarm Systems — perimeter intrusion detection
  • People Counting Systems — entrance traffic monitoring
  • Industrial Automation — object presence on conveyor belts
  • Interactive Art Installations — proximity-triggered displays and exhibits
  • Smart Trash Cans — automatic lid opening when approached
  • Touchless Devices — gesture-triggered hand sanitizer dispensers
  • Replacement Sensor — for damaged HC-SR04 modules in existing projects
Loading...
Loading...
Loading...
Loading...