0Pricing
Arduino & IoT Academy · درس

كيف يعمل قياس المسافة بالموجات فوق الصوتية

أرسل نبضة واحسب زمن الصدى لمعرفة المسافة.

كيف يعمل قياس المسافة بالموجات فوق الصوتية درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Seeing with Sound

An ultrasonic sensor measures distance the way a bat does: it sends out a sound pulse and listens for the echo bouncing back. 🦇

Too High to Hear

The pulse is ultrasonic, around 40 kHz, far above what your ears can detect. The sensor works silently while still using real sound waves.

Send, Then Listen

The trick is timing. The sensor fires a quick ping, then starts a stopwatch and waits for that same sound to return after hitting an object.

The Round Trip

The sound travels out to the object and all the way back, so the measured time covers a round trip, twice the actual distance to the target.

Sound Has a Speed

Sound moves through air at about 343 meters per second. Because that speed is known, time can be turned directly into distance.

Time to Distance

Distance equals speed times time. Knowing how long the echo took, you can compute exactly how far the sound traveled before bouncing.

// distance in cm, time in microseconds
distance = duration * 0.0343 / 2;

Why You Divide by Two

Since the echo covers the path twice, you halve the result. That single division converts a round trip into the real one-way distance.

Microseconds Matter

These pulses return in microseconds, so the sensor times very tiny intervals. Tinier time differences simply mean a closer object.

The HC-SR04

The popular HC-SR04 module does all this for you. It has one transmitter that chirps and one receiver that catches the returning echo.

Its Useful Range

This sensor reliably reads from about 2 cm to 400 cm. Closer than 2 cm or farther than that, and the readings stop being trustworthy.

Where Echoes Fail

Soft or angled surfaces can scatter the sound away, so a flat, solid target gives the cleanest, most accurate distance readings.

Quick Check

Think about the path the sound takes.

You Get It Now

Ultrasonic ranging is just timed echoes: ping, wait, and convert the round-trip time into distance. Next you will wire the sensor up. ✅

الأسئلة الشائعة

هل درس «كيف يعمل قياس المسافة بالموجات فوق الصوتية» مجاني؟

نعم — نص درس «كيف يعمل قياس المسافة بالموجات فوق الصوتية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

ماذا ستتعلم في «كيف يعمل قياس المسافة بالموجات فوق الصوتية»؟

أرسل نبضة واحسب زمن الصدى لمعرفة المسافة. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟

لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «كيف يعمل قياس المسافة بالموجات فوق الصوتية»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟

نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. كيف يعمل قياس المسافة بالموجات فوق الصوتية
  2. توصيل طرفَي Trigger وEcho
  3. استخدام pulseIn لقياس زمن الصدى
  4. بناء إنذار اقتراب
← العودة إلى Arduino & IoT Academy