0Pricing
Arduino & IoT Academy · Lektion

Trigger- und Echo-Verdrahtung

Verbinden Sie die beiden Steuerpins des Sensors.

Trigger- und Echo-Verdrahtung ist eine kostenlose Arduino & IoT Academy-Lektion auf CoddyKit. Dies ist Lektion 2 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.

Four Little Pins

The HC-SR04 has four pins in a row: VCC, Trig, Echo, and GND. Get these connected correctly and the sensor just works.

Power It Up

Connect VCC to the Arduino 5V pin. This sensor needs a full 5 volts to charge up and fire its sound pulses properly.

Share a Ground

Wire GND to an Arduino GND pin. Without a shared ground, the signals have no common reference and your readings turn to nonsense.

Trig Is the Speaker

The Trig pin is the sensor's input. When you pulse it HIGH for a moment, the sensor sends out its burst of ultrasonic sound.

Echo Is the Listener

The Echo pin is the sensor's output. It goes HIGH for exactly as long as the sound is travelling out and bouncing back.

Pick Two Digital Pins

Connect Trig and Echo to any two digital pins, for example pin 9 and pin 10. You will name these in code so the Arduino knows where to look.

Name Your Pins

At the top of your sketch, give each pin a clear name. Constants make the rest of your code far easier to read and edit later.

const int trigPin = 9;
const int echoPin = 10;

Set the Directions

In setup, declare Trig as OUTPUT so you can drive it, and Echo as INPUT so the Arduino can read the returning pulse.

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);

Mind the Echo Voltage

The Echo pin outputs 5V, which a standard Uno reads fine. On a 3.3V board like an ESP32, add a divider so you do not over-volt the pin. ⚠️

Use a Breadboard

Plug the sensor and jumper wires into a breadboard for solid, tidy connections. Loose wires are the top cause of flickering readings.

Double-Check Before Power

Never swap VCC and GND. Before powering on, trace each wire once more so you protect both the sensor and your board.

Quick Check

Think about which pin does what.

Wired and Ready

Power, ground, and two named digital pins, that is the whole hookup. With Trig driving and Echo listening, you are ready to time the pulse. ✅

Häufig gestellte Fragen

Ist die Lektion „Trigger- und Echo-Verdrahtung“ kostenlos?

Ja — der vollständige Text von „Trigger- und Echo-Verdrahtung“ 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 „Trigger- und Echo-Verdrahtung“?

Verbinden Sie die beiden Steuerpins des Sensors. 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 2 von 4.

Wie lange dauert die Lektion „Trigger- und Echo-Verdrahtung“?

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