SainSmart HC-SR04

SainSmart HC-SR04 Ultrasonic Distance Sensor User Manual

Model: HC-SR04 | Brand: SainSmart

1. Wprowadzenie

The SainSmart HC-SR04 Ultrasonic Distance Sensor module is designed for precise non-contact distance measurement. It utilizes ultrasonic waves to determine the distance to an object, making it suitable for various applications such as robotics, obstacle avoidance, and level sensing. This module offers a measurement range from 2 cm to 400 cm with high accuracy.

SainSmart HC-SR04 Ultrasonic Distance Sensor front view

Rycina 1: Przód view of the HC-SR04 Ultrasonic Distance Sensor, showing the two ultrasonic transducers and the module's pins.

2. Funkcje produktu

3. Specyfikacje

Wymiary produktu1.3 x 0.4 x 0.05 cala
Waga przedmiotu0.8 uncji
Numer modeluHC-SR04
Zasilacz5V prądu stałego
Prąd spoczynkowy<2mA
Efektywny kąt<15 stopni
Odległość pomiaru2cm - 400cm
Rezolucja0.3cm

4. Wyprowadzenia i połączenia

The HC-SR04 module features four pins for connection to a microcontroller or other circuit:

SainSmart HC-SR04 Ultrasonic Distance Sensor back view z szpilkami

Rysunek 2: Tył view of the HC-SR04 module, showing the electronic components and the four connection pins.

Ensure correct polarity when connecting VCC and GND to avoid damage to the module.

5. Konfiguracja

To set up the HC-SR04 sensor for operation, follow these steps:

  1. Podłączenie zasilania: Połącz VCC pin to a 5V DC power source and the GND pin to the ground of your microcontroller or power supply.
  2. Trigger Pin Connection: Połącz Wymuskany pin to a digital output pin on your microcontroller (e.g., Arduino, Raspberry Pi).
  3. Echo Pin Connection: Połącz Echo pin to a digital input pin on your microcontroller.
  4. Montowanie: Securely mount the sensor in the desired location, ensuring a clear line of sight to the target object. Avoid mounting in areas with excessive vibrations or acoustic interference.

Notatka: For microcontrollers operating at 3.3V (like some Raspberry Pi models), a voltage divider or level shifter may be required for the Echo pin to prevent damage, as the Echo pin outputs 5V.

6. Działanie

The HC-SR04 operates by emitting an ultrasonic sound wave and measuring the time it takes for the echo to return. The process is as follows:

  1. Wyzwalanie: To initiate a measurement, the microcontroller sends a short high-level pulse (at least 10 microseconds) to the Wymuskany szpilka.
  2. Ultrasonic Burst: Upon receiving the trigger pulse, the HC-SR04 module automatically emits eight 40 kHz ultrasonic sound waves.
  3. Echo Reception: The module then waits for the echo of these sound waves. When an echo is detected, the Echo pin goes high.
  4. Duration Measurement: The microcontroller measures the duration for which the Echo pin remains high. This duration represents the time taken for the ultrasonic wave to travel from the sensor to the object and back.
  5. Obliczanie odległości: The distance to the object can be calculated using the following formula:

    Distance (cm) = (Duration of high level on Echo pin (microseconds) * Speed of Sound (cm/µs)) / 2

    The speed of sound in air is approximately 340 meters per second (0.034 cm per microsecond). Therefore, the formula simplifies to:

    Distance (cm) = Duration (µs) / 58

    (Alternatively, Distance (inches) = Duration (µs) / 148)

It is recommended to introduce a small delay (e.g., 60ms) between consecutive measurements to allow the ultrasonic waves to dissipate and prevent interference with subsequent readings.

7. Konserwacja

The HC-SR04 module is a low-maintenance device. To ensure optimal performance and longevity:

8. Rozwiązywanie Problemów

If you encounter issues with your HC-SR04 sensor, consider the following common problems and solutions:

9. Gwarancja i wsparcie

SainSmart products are designed for reliability and performance. For specific warranty information, please refer to the documentation provided with your purchase or visit the official SainSmart website. For technical support, troubleshooting assistance, or inquiries about product functionality, please contact SainSmart customer service through their official channels.

Zasoby internetowe: Many online communities and forums dedicated to Arduino, Raspberry Pi, and electronics projects offer extensive resources and examples for using the HC-SR04 sensor. Searching for "HC-SR04 Arduino tutorial" or "HC-SR04 Raspberry Pi Python" can provide valuable code examples and project ideas.

Powiązane dokumenty - HC-SR04

Przedview Instrukcja obsługi płyty sterującej SainSmart Genmitsu (GRBL)
Kompleksowa instrukcja obsługi płytki sterującej SainSmart Genmitsu (GRBL) z obudową ABS i wbudowanym wentylatorem, kompatybilna z ploterami CNC, takimi jak 3018, 3018-PRO i 1810-PRO. Obejmuje konfigurację, połączenia, ustawienia Vref, aktualizacje oprogramowania układowego i akcesoria.
Przedview Instrukcja obsługi zestawu modułu laserowego SainSmart 5.5 W do maszyny CNC Genmitsu 3018-PROVer/MX3
Instrukcja obsługi zestawu modułów laserowych SainSmart 5.5 W, kompatybilnego z maszynami CNC Genmitsu 3018-PROVer i 3018-MX3. Zawiera instrukcje instalacji, podłączenia i ustawiania ostrości dla oprogramowania LaserGRBL i Mach3.
Przedview Zestaw obrotowy SainSmart 4th Axis – skrócona instrukcja obsługi
Skrócona instrukcja obsługi zestawu SainSmart 4th Axis Rotary Kit, zawierająca zasoby, dokumentację i instrukcje konfiguracji dla systemu CNC 4040 Pro. Zawiera linki do instrukcji obsługi, przewodników instalacji i zasobów dotyczących obróbki.
Przedview Instrukcja obsługi drukarki 3D SainSmart Ender-3
Instrukcja obsługi drukarki 3D SainSmart Ender-3 zawierająca wskazówki dotyczące montażu, przewodniki konfiguracji, instalacji oprogramowania, rozwiązywania problemów i informacje pomocnicze.
Przedview SainSmart Wireless Control Kit for CNC Router Review i podręcznik użytkownika
Kompleksowe ponowneview and user guide for the SainSmart Wireless Control Kit for CNC Routers, detailing installation, app features, module variants, and performance for Genmitsu CNC machines.
Przedview Instrukcja obsługi bezprzewodowej podkaszarki do drewna SainSmart w wersji 1.0
Instrukcja obsługi bezprzewodowej podkaszarki do drewna SainSmart, zawierająca szczegółowe ostrzeżenia dotyczące bezpieczeństwa, obsługi, montażu, specyfikacji i konserwacji. Zawiera informacje na temat zarządzania akumulatorem i akcesoriów.