OHMFORGELEARN · BUILD · VERIFY
← مختبر الحساسات
Sensors Lab · distance

حساس الموجات فوق الصوتية HC-SR04

HC-SR04

حساس مسافة بالموجات فوق الصوتية يستخدم عادة في الروبوتات وقياس المسافات القصيرة.

An ultrasonic distance sensor commonly used in robots and short-range distance-measurement projects.

Pulse · نبضينوع الإشارة
5V–5Vجهد التشغيل
Digital pulseInterface
2GPIO
تنبيه هندسي

خرج Echo قد يكون 5V؛ مع ESP32 يلزم خفض مستوى الإشارة قبل GPIO.

01 · HOW IT WORKS

كيف يعمل؟

يرسل نبضة فوق صوتية ثم يقيس زمن عودة الصدى؛ يستخدم المتحكم زمن الرحلة لتقدير المسافة إلى الجسم.

It sends an ultrasonic pulse and measures the return-echo time; the controller uses the travel time to estimate distance.

02 · WIRING

التوصيل

صِل VCC وGND، ثم Trigger إلى خرج رقمي وEcho إلى دخل رقمي. مع ESP32 خفّض مستوى Echo من 5V إلى مستوى مناسب لـ3.3V.

Connect VCC and GND, Trigger to a digital output, and Echo to a digital input. With ESP32, reduce the 5V Echo level to a safe 3.3V-compatible level.

03 · TEST

طريقة الاختبار

ضع جسمًا مسطحًا على مسافة معروفة، اقرأ عدة قياسات وقارن المتوسط بالمسافة الفعلية. تحقق من مستوى Echo قبل توصيله بمدخل 3.3V.

Place a flat target at a known distance, take several readings, and compare the average with the actual distance. Verify the Echo voltage level before connecting it to a 3.3V input.

04 · TROUBLESHOOT

الأخطاء الشائعة

قراءات صفرية أو متذبذبة بسبب الهدف أو التوصيل؛ إدخال Echo بجهد 5V مباشرة إلى ESP32 دون خفض مستوى.

Zero or unstable readings caused by target geometry or wiring; feeding a 5V Echo signal directly into an ESP32 input without level reduction.

MINI PROJECT

تجربة عملية مصغرة

مشروع مصغر: مؤشر اقتراب يعرض ثلاث حالات للمسافة قبل استخدام الحساس لاحقًا في روبوت تجنب العوائق.

Mini project: build a proximity indicator with three distance states before using the sensor in an obstacle-avoiding robot.

المشاريع التطبيقية
BUILD

مشاريع تستخدم هذا الحساس