Member-only story

Ultimate Guide for Beginner to Ultrasonic Sensor

Luffy
4 min readNov 11, 2019

--

This article helps beginners understand how ultrasonic sensor work and how to use it with Arduino. The animated image makes it easy to understand.

About Ultrasonic Sensor

Ultrasonic sensor HC-SR04 is used to measure the distance to an object by using ultrasonic waves.

Pinout

The ultrasonic sensor HC-SR04 includes four pins:

  • VCC pin: needs to be connected to VCC (5V)
  • GND pin: needs to be connected to GND (0V)
  • TRIG pin: this pin receives the control signal (pulse) from Arduino.
  • ECHO pin: this pin sends a signal (pulse) to Arduino. Arduino measures the duration of pulse to calculate distance

How It Works

  1. Micro-controller generates a 10-microsecond pulse on the TRIG pin.
  2. The ultrasonic sensor automatically emits the ultrasonic waves.
  3. The ultrasonic wave is reflected after hitting an obstacle.
  4. The ultrasonic sensor detects the reflected ultrasonic wave and measures the…

--

--

Luffy
Luffy

Written by Luffy

A firmware engineer: love making IoT stuff, creating DIY devices, writing tutorials and articles in his free time.

No responses yet