HC-SR04 – Ultrasonic Sensor

HC-SR04 is a low cost ultrasonic sensor for common range measuring needs. The sensor provides 2cm to 400cm of non-contact measurement functionality with accuracy up to 3mm.


  • Easy setup
  • Low-cost
  • Good accuracy (up to 3mm)
  • Wide range – 2-400 cm.


  • Wide beam
  • Mutual Interference
  • Low read rate due to the velocity of sound

HC-SR04 Circuits

How to wire HC-SR04 to Arduino Uno
How to Wire HC-SR04 to NodeMCU
How to wire HC-SR04 to Arduino Gemma

Projects with Ultrasonic Sensors

interface range accuracy Sensing method PRICE
HCSR04 Digital GPIO 2-400cm 3mm ultrasonic Low
LV-MaxSonar-EZ1 Serial 0-645cm NA ultrasonic Med
Infrared Proximity Sensor Long Range – Sharp Analog 20-150cm NA IR Med
LIDAR Lite-v3 I2C 0-40m +/- 2.5cm at distances greater than 1m Laser High
Adafruit VL53L0X Time of Flight Distance Sensor I2C 30-1200mm  NA Light, 3D Time-of-Flight (ToF) Med
IR Obstacle Avoidance sensor digital  NA IR Low

Related Components