How To Interface Ultrasonic Sensor HC-SR04 to Arduino ?

by Tom Victor Posted on July 13, 2016, 1:15 p.m.

Introduction

 

The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats or dolphins do. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package. From 2cm to 400 cm or 1” to 13 feet. It operation is not affected by sunlight or black material like Sharp rangefinders are (although acoustically soft materials like cloth can be difficult to detect). It comes complete with ultrasonic transmitter and receiver module.

 

Features

Power Supply :+5V DC

Quiescent Current : <2mA

Working Currnt: 15mA

Effectual Angle: <15°

Ranging Distance : 2cm – 400 cm/1" - 13ft

Resolution : 0.3 cm

Measuring Angle: 30 degree

Trigger Input Pulse width: 10uS

Dimension: 45mm x 20mm x 15mm

Pins

VCC = +5VDC

Trig = Trigger input of Sensor

Echo = Echo output of Sensor

GND = GND