HC-SR04 Ultrasonic Sensor for Arduino

How it Works

  1. Trigger: A 10µs high-level (TTL) pulse is sent to the Trig pin.
  2. Transmit: The sensor emits eight 40kHz ultrasonic bursts.
  3. Receive: The Echo pin goes high when the signal starts and stays high until the echo returns.
  4. Calculate: The time the Echo pin is high (pulse width) is measured by the microcontroller, which calculates distance using the speed of sound (Distance = Speed × Time / 2).

Key Specifications

  • Voltage: 5V DC
  • Range: 2cm – 400cm (2 inches – 13 feet)
  • Accuracy: Up to 3mm
  • Frequency: 40kHz
  • Angle: < 15 degrees
  • Pins: VCC, GND, Trig, Echo

Common Applications