ELEGOO EL-SM-001

Manual de instrucțiuni pentru senzorul de distanță al modulului cu ultrasunete ELEGOO HC-SR04

Model: EL-SM-001

1. Introducere și Pesteview

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.

Five ELEGOO HC-SR04 ultrasonic sensors and two sets of multi-colored jumper wires.
Image 1.1: A set of five HC-SR04 Ultrasonic Modules with connecting wires.

2. Caracteristicile produsului

  • 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. Conținutul pachetului

Fiecare pachet conține următoarele articole:

  • 5 x ELEGOO HC-SR04 Ultrasonic Modules
  • Connecting jumper wires (quantity may vary, typically enough for basic connections)
Five ELEGOO HC-SR04 ultrasonic sensors and two sets of multi-colored jumper wires, laid out on a white surface.
Image 3.1: Contents of the HC-SR04 Ultrasonic Module package.

4. Informații de siguranță

Avertizare:

  • Keep this product away from children under 3 years old due to small parts.
  • Asigurați-vă că volumul corespunzătortage 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. Configurare

The HC-SR04 module has four pins: VCC, Trig, Echo, and GND. Follow these steps for basic connection to a microcontroller (e.g., Arduino):

  1. Connect VCC: Connect the VCC pin of the HC-SR04 module to the 5V output pin of your microcontroller.
  2. Connect GND: Connect the GND pin of the HC-SR04 module to the GND pin of your microcontroller.
  3. 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.
  4. 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.

Nota: 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.

An ELEGOO HC-SR04 ultrasonic sensor connected to a breadboard with jumper wires, with an Arduino board visible in the background.
Image 5.1: HC-SR04 module connected to a breadboard for prototyping.

6. Principii de funcționare

The HC-SR04 module operates on the principle of sonar. Here's how it works:

  1. The microcontroller sends a short pulse (e.g., 10 microseconds) to the Trig pin.
  2. This pulse causes the ultrasonic transmitter to emit a burst of 8 cycles of 40 kHz ultrasonic sound waves.
  3. These sound waves travel through the air. If they encounter an object, they reflect off its surface.
  4. The reflected sound waves (echo) are detected by the ultrasonic receiver.
  5. The Ecou pin goes HIGH for the duration that the sound waves travel from the transmitter, reflect off the object, and return to the receiver.
  6. The microcontroller measures the duration of this HIGH pulse on the Echo pin.
  7. 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).
Diagram illustrating the operation of an ultrasonic sensor, showing sound waves emitted from a transmitter, reflecting off an object, and returning to a receiver.
Image 6.1: Illustration of ultrasonic distance measurement principle.

7. Funcționare

To operate the HC-SR04 module, you will need to write code for your microcontroller. Below is a conceptual exampchiul pentru 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. Aplicații

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.
An ELEGOO HC-SR04 ultrasonic sensor mounted on the front of a small robot chassis, indicating its use in robotic applications.
Image 7.1: HC-SR04 module integrated into a robotic platform.

8. Întreținere

The HC-SR04 Ultrasonic Module requires minimal maintenance. Follow these guidelines to ensure its longevity and accurate performance:

  • Păstra curat: 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.
  • Evitați daunele fizice: Protect the module from impacts or excessive force, which can damage the transducers or the circuit board.
  • Depozitare adecvată: When not in use, store the modules in an anti-static bag in a dry environment to prevent electrostatic discharge and moisture damage.
  • Sursă de alimentare stabilă: Always provide a stable 5V DC power supply. Fluctuations can affect performance or damage the module.

9. Depanare

ProblemăCauza posibilaSoluţie
No readings or erratic readings
  • Incorrect wiring (VCC, GND, Trig, Echo).
  • Obstruction on transducers.
  • Code error (e.g., incorrect pin definitions, timing issues).
  • Object too close (less than 3cm) or too far (more than 450cm).
  • Echo pin connected directly to 3.3V logic without voltage divizor.
  • Double-check all connections according to Section 5.
  • Clean the transducers.
  • Review your code for logical errors and correct pin assignments.
  • Ensure the object is within the 3cm-450cm range.
  • Folosiți un voltage divider for 3.3V microcontrollers.
Modulul nu pornește
  • Fără alimentare sau volum incorecttage.
  • Faulty VCC or GND connection.
  • Verify 5V DC power supply.
  • Check continuity of VCC and GND wires.
Citiri inexacte ale distanței
  • Environmental factors (temperature, humidity, air currents).
  • Soft, sound-absorbing objects.
  • Narrow beam angle causing reflections from unintended surfaces.
  • Consider environmental compensation in code if precision is critical.
  • Test with hard, flat surfaces.
  • Adjust module position or add physical barriers to focus the beam.
  • Implement averaging of multiple readings in your code.

10. Specificații

ParametruValoare
Numărul de modelEL-SM-001
Vol. De operaretage5V DC
Curent de repausMai puțin de 2mA
Unghiul efectivMai puțin de 15°
Distanta de distanta3 cm - 450 cm
Rezoluţie0.3 cm
Dimensiunile produsului0.59 x 1.77 x 1.18 inci (aprox. 1.5 x 4.5 x 3 cm)
Greutate0.32 uncii (aproximativ 9 grame)
Packaging for the ELEGOO HC-SR04 Ultrasonic Sensor, displaying technical specifications such as power supply, quiescent current, effectual angle, ranging distance, and resolution.
Image 10.1: Technical specifications as printed on product packaging.

11. Garanție și asistență

Pentru informații despre garanție și asistență tehnică, vă rugăm să consultați pagina oficială ELEGOO. website-ul web sau contactați direct serviciul lor de asistență pentru clienți. Detaliile sunt de obicei furnizate pe ambalajul produsului sau pe eticheta producătorului. website-ul.

Manufacturer: ELEGOO

Pentru asistență suplimentară, vizitați: www.elegoo.com

© 2025 ELEGOO. Toate drepturile rezervate.

This manual is for informational purposes only. ELEGOO reserves the right to make changes to product specifications without prior notice.