Home HC-SR04 ultrasonic ranging sensor
Post
Cancel

HC-SR04 ultrasonic ranging sensor

Information

This is the HC-SR04 ultrasonic distance sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.

There are only four pins that you need to worry about on the HC-SR04: VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground). You will find this sensor very easy to set up and use for your next range-finding project!

SR04 Connect diagram

This sensor has additional control circuitry that can prevent inconsistent “bouncy” data depending on the application.

For a Raspberry PI it needs resistors on the ECHO port.

More information …

Setup

In order to use the HC-SR04 ultrasonic ranging sensor use the following settings:

Mandatory

Hardware
HC-SR04 ultrasonic ranging sensor
Types

distance

Address
Enter the physical pin number where the trigger and echo pins are connected in that order
Ex: 27,23

Other settings can be found at the sensor setup information

This post is licensed under CC BY 4.0 by the author.