0Pricing
Arduino & IoT Academy · Lektion

So funktioniert die Ultraschall-Entfernungsmessung

Senden Sie einen Ping und messen Sie das Echo, um die Entfernung zu bestimmen.

So funktioniert die Ultraschall-Entfernungsmessung ist eine kostenlose Arduino & IoT Academy-Lektion auf CoddyKit. Dies ist Lektion 1 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Arduino & IoT Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

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. ✅

Häufig gestellte Fragen

Ist die Lektion „So funktioniert die Ultraschall-Entfernungsmessung“ kostenlos?

Ja — der vollständige Text von „So funktioniert die Ultraschall-Entfernungsmessung“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Arduino & IoT Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „So funktioniert die Ultraschall-Entfernungsmessung“?

Senden Sie einen Ping und messen Sie das Echo, um die Entfernung zu bestimmen. Du übst Arduino & IoT Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Arduino & IoT Academy zu starten?

Keine Vorkenntnisse erforderlich. Arduino & IoT Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 1 von 4.

Wie lange dauert die Lektion „So funktioniert die Ultraschall-Entfernungsmessung“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Arduino & IoT Academy-Lektion Code schreiben und ausführen?

Ja. Jede Arduino & IoT Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. So funktioniert die Ultraschall-Entfernungsmessung
  2. Trigger- und Echo-Verdrahtung
  3. Mit pulseIn das Echo messen
  4. Einen Näherungsalarm bauen
← Zurück zu Arduino & IoT Academy