1. Introduction and Overview
The ELEGOO HC-SR04 Ultrasonic Module is a device designed for non-contact distance measurement. It operates by emitting ultrasonic sound waves and measuring the time it takes for the echo to return, thereby calculating the distance to an object. This module is suitable for various applications requiring distance sensing, such as obstacle avoidance in robotics and level sensing.
This manual provides detailed instructions for the setup, operation, and maintenance of your HC-SR04 Ultrasonic Module.

2. Product Features
- Non-contact distance measurement using ultrasonic technology.
- Integrated ultrasonic transmitter, receiver, and control circuit.
- Measures distances from 3 cm to 450 cm.
- High ranging accuracy of up to 3 mm.
- Low quiescent current consumption (less than 2mA).
- Wide effectual angle of less than 15 degrees.
- Compatible with various microcontrollers like Arduino UNO, MEGA, and Nano.
3. Package Contents
Each package contains the following items:
- 5 x ELEGOO HC-SR04 Ultrasonic Modules
- Connecting jumper wires (quantity may vary, typically enough for basic connections)

4. Safety Information
Warning:
- Keep this product away from children under 3 years old due to small parts.
- Ensure proper voltage supply (5V DC) to prevent damage to the module or connected devices.
- Handle with care to avoid electrostatic discharge, which can harm electronic components.
5. Setup
The HC-SR04 module has four pins: VCC, Trig, Echo, and GND. Follow these steps for basic connection to a microcontroller (e.g., Arduino):
- Connect VCC: Connect the VCC pin of the HC-SR04 module to the 5V output pin of your microcontroller.
- Connect GND: Connect the GND pin of the HC-SR04 module to the GND pin of your microcontroller.
- Connect Trig: Connect the Trig (Trigger) pin of the HC-SR04 module to a digital output pin on your microcontroller (e.g., Arduino Pin 9). This pin sends the ultrasonic pulse.
- Connect Echo: Connect the Echo pin of the HC-SR04 module to a digital input pin on your microcontroller (e.g., Arduino Pin 10). This pin receives the reflected ultrasonic pulse.
Note: If connecting to a 3.3V microcontroller (like Raspberry Pi), a voltage divider circuit is required for the Echo pin to prevent damage, as the HC-SR04's Echo pin outputs 5V.

6. Operating Principles
The HC-SR04 module operates on the principle of sonar. Here's how it works:
- The microcontroller sends a short pulse (e.g., 10 microseconds) to the Trig pin.
- This pulse causes the ultrasonic transmitter to emit a burst of 8 cycles of 40 kHz ultrasonic sound waves.
- These sound waves travel through the air. If they encounter an object, they reflect off its surface.
- The reflected sound waves (echo) are detected by the ultrasonic receiver.
- The Echo pin goes HIGH for the duration that the sound waves travel from the transmitter, reflect off the object, and return to the receiver.
- The microcontroller measures the duration of this HIGH pulse on the Echo pin.
- The distance is calculated using the formula:
Distance = (Time of Flight * Speed of Sound) / 2
(Divided by 2 because the sound travels to the object and back).

7. Operation
To operate the HC-SR04 module, you will need to write code for your microcontroller. Below is a conceptual example for Arduino:
7.1. Arduino Code Example (Conceptual)
// Define pins
const int trigPin = 9;
const int echoPin = 10;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600); // Initialize serial communication
}
void loop() {
// Clear the trigPin by setting it LOW for 2 microseconds
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Set the trigPin HIGH for 10 microseconds to send a pulse
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Measure the duration of the pulse on the echoPin
long duration = pulseIn(echoPin, HIGH);
// Calculate the distance (speed of sound in air is approximately 343 meters/second or 0.0343 cm/microsecond)
// Distance = (duration * 0.0343) / 2; // in cm
// Or, more commonly, duration / 58 for cm, or duration / 148 for inches
float distanceCm = duration / 58.0;
// Print the distance to the Serial Monitor
Serial.print("Distance: ");
Serial.print(distanceCm);
Serial.println(" cm");
delay(1000); // Wait for 1 second before the next measurement
}
Upload this code to your Arduino board. Open the Serial Monitor in the Arduino IDE to view the distance readings.
7.2. Applications
The HC-SR04 module is versatile and can be used in:
- Robotics for obstacle detection and navigation.
- Automated systems for level sensing (e.g., water tank levels).
- Security systems for proximity sensing.
- Interactive art installations.

8. Maintenance
The HC-SR04 Ultrasonic Module requires minimal maintenance. Follow these guidelines to ensure its longevity and accurate performance:
- Keep Clean: Ensure the ultrasonic transducers (the two "eyes" on the module) are free from dust, dirt, or moisture. Use a soft, dry cloth to gently clean them if necessary.
- Avoid Physical Damage: Protect the module from impacts or excessive force, which can damage the transducers or the circuit board.
- Proper Storage: When not in use, store the modules in an anti-static bag in a dry environment to prevent electrostatic discharge and moisture damage.
- Stable Power Supply: Always provide a stable 5V DC power supply. Fluctuations can affect performance or damage the module.
9. Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No readings or erratic readings |
|
|
| Module not powering on |
|
|
| Inaccurate distance readings |
|
|
10. Specifications
| Parameter | Value |
|---|---|
| Model Number | EL-SM-001 |
| Operating Voltage | 5V DC |
| Quiescent Current | Less than 2mA |
| Effectual Angle | Less than 15° |
| Ranging Distance | 3cm - 450cm |
| Resolution | 0.3 cm |
| Product Dimensions | 0.59 x 1.77 x 1.18 inches (approx. 1.5 x 4.5 x 3 cm) |
| Weight | 0.32 ounces (approx. 9 grams) |

11. Warranty and Support
For warranty information and technical support, please refer to the official ELEGOO website or contact their customer service directly. Details are typically provided with the product packaging or on the manufacturer's website.
Manufacturer: ELEGOO
For further assistance, visit: www.elegoo.com