Soldered.com ↗ GitHub ↗
Full product documentation, content & links

Ultrasonic Module HC-SR04

Sensors & Modules › Motion & Proximity
Interface ['digital_gpio'] Qwiic No

The HC-SR04 Ultrasonic Sensor measures distances from 2cm to 400cm with high accuracy, ideal for various DIY and automation projects.

A truly classic sensor! The HC-SR04 Ultrasonic Sensor is a cost-effective solution for distance measurement in a wide array of projects. With ultrasonic waves, this module accurately determines distances from 2cm to 400cm with a high resolution of 0.3cm, making it a great choice for applications requiring a wide range of proximity detection. Its design, featuring an ultrasonic transmitter, receiver, and control circuit, ensures stable performance and ease of integration. Engineered for compatibility, the HC-SR04 is a favourite among Arduino and Raspberry Pi enthusiasts. Its 4-pin interface (VCC, Trig, Echo, GND) simplifies setup, allowing for rapid prototyping and development. Whether you're building obstacle avoidance robots, smart parking systems, or interactive art installations, this sensor provides the foundational data needed to bring your visions to life with minimal effort. Its technical prowess, the HC-SR04, stands out for its value and broad applicability. It empowers hobbyists, students, and professional developers to implement ranging capabilities without significant investment. Its proven reliability and extensive community support further solidify its position as a go-to component for educational purposes, DIY electronics, and advanced automation systems, ensuring your projects benefit from accurate and consistent performance.
  • Range: 2cm - 400cm
  • Accuracy: 3mm (1cm in our library)
  • Measurement angle: 15 degrees
  • Voltage: 5V
  • Current: <2mA
  • Comes with 4-pin soldered male headers

Interface

Interface Digital Gpio
Qwiic Compatible No
Breadboard Compatible Yes

Measurement

Measurement Types Distance
Measurement Range 2cm - 400cm
Measurement Accuracy 1cm

Power

Supply Voltage Min V 5
Supply Voltage Max V 5
Logic Level 5V Only

Other

Ic Part Number HC-SR04
Start Here
1
Connect

Wire up to your microcontroller via ['digital_gpio'].

2
Install the library

Add the Soldered library for your language (below).

3
Run an example

Open the get-started example and read your first value.

ArduinoC++
MicroPythonPython
What's in the Box
1×
Ultrasonic Module HC-SR04 101202
Last updated:
Documentation 1 resource