PartIn the simulatorsens-hc-sr04

HC-SR04 ultrasonic sensor

Measures distance with an echo, from about 2 cm to 4 m. The eyes of the obstacle-avoiding and keep-distance robots.

See the price in the shop

Where to buy

Uzum MarketUzum Marketdagi qidiruv natijalari · Delivery on the seller’s terms · All of UzbekistanSee the price in the shopBuy

Prices and stock are set by the shops. The site sends you to the shop; you buy there.

A 10 µs pulse on TRIG makes it send a short burst of ultrasound. ECHO then stays HIGH for as long as the sound takes to reach the object and come back. Distance in cm = pulse length in µs / 58.

  • Wait about 60 ms between measurements, so old echoes die away.
  • Soft or slanted surfaces can send no echo back.

Learn it in Measuring distance with the HC-SR04 and read How ultrasonic sensors see.

More in “Sensors”