超音波距離測定の仕組み
パルスを送り、反響時間を測って距離を求めます。
「超音波距離測定の仕組み」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。
「超音波距離測定の仕組み」で何を学びますか?
パルスを送り、反響時間を測って距離を求めます。 ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Arduino & IoT Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「超音波距離測定の仕組み」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このArduino & IoT Academyレッスンでコードを書いて実行できますか?
はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 超音波距離測定の仕組み
- TriggerとEchoを配線する
- pulseInで反響時間を測る
- 近接アラームを作る